diff
stringlengths
41
2.03M
msg
stringlengths
1
1.5k
βŒ€
repo
stringlengths
5
40
sha
stringlengths
40
40
time
stringlengths
20
20
mmm a / tests / runner . py <nl> ppp b / tests / runner . py <nl> class Child2 : Parent { <nl> public : <nl> Child2 ( ) : Parent ( 9 ) { printf ( " Child2 : % d \ \ n " , value ) ; } ; <nl> int getValCube ( ) { return value * value * value ; } <nl> + static void printStatic ( ) { printf ( " * static * \ \ n " ) ; } <nl> private : <nl> void doSomethingSecret ( ) { printf ( " security breached ! \ \ n " ) ; } ; / / we should not be able to do this <nl> } ; <nl> class Child2 : Parent { <nl> } catch ( e ) { } <nl> print ( succeeded ) ; <nl> <nl> + Child2 . prototype . printStatic ( ) ; / / static calls go through the prototype <nl> + <nl> print ( ' * ok * ' ) ; <nl> ' ' ' <nl> <nl> def post2 ( filename ) : <nl> 0 <nl> 0 <nl> 1 <nl> + * static * <nl> * ok * <nl> ' ' ' , post_build = post2 ) <nl> <nl> mmm a / tools / bindings_generator . py <nl> ppp b / tools / bindings_generator . py <nl> def path_from_root ( * pathelems ) : <nl> if args [ i ] . get ( ' default ' ) : <nl> method [ ' first_default_param ' ] = i <nl> <nl> + if method [ ' static ' ] : <nl> + method [ ' rtnType ' ] = method [ ' rtnType ' ] . replace ( ' static ' , ' ' ) <nl> + <nl> # Second pass - generate bindings <nl> # TODO : Bind virtual functions using dynamic binding in the C binding code <nl> <nl> def generate_class ( generating_classname , classname , clazz ) : <nl> args = method [ ' parameters ' ] <nl> constructor = method [ ' constructor ' ] # we fixed this before <nl> destructor = method [ ' destructor ' ] <nl> + static = method [ ' static ' ] <nl> <nl> - print " zz generating : " , generating_classname , classname , mname , constructor <nl> + print " zz generating : " , generating_classname , classname , mname , constructor , method [ ' rtnType ' ] <nl> <nl> if destructor : continue <nl> if constructor and inherited : continue <nl> def generate_class ( generating_classname , classname , clazz ) : <nl> continue <nl> <nl> ret = ( ( classname + ' * ' ) if constructor else method [ ' rtnType ' ] ) . replace ( ' virtual ' , ' ' ) <nl> - callprefix = ' new ' if constructor else ' self - > ' <nl> + callprefix = ' new ' if constructor else ( ' self - > ' if not static else ( classname + ' : : ' ) ) <nl> <nl> actualmname = ' ' <nl> if mname = = ' __operator___assignment_ ' : <nl> def generate_class ( generating_classname , classname , clazz ) : <nl> else : <nl> actualmname = method . get ( ' truename ' ) or mname <nl> <nl> - typedargs = ( [ ] if constructor else [ classname + ' * self ' ] ) + map ( lambda arg : arg [ ' type ' ] + ' ' + arg [ ' name ' ] , args ) <nl> + need_self = not constructor and not static <nl> + typedargs = ( [ ] if not need_self else [ classname + ' * self ' ] ) + map ( lambda arg : arg [ ' type ' ] + ' ' + arg [ ' name ' ] , args ) <nl> justargs = map ( lambda arg : arg [ ' name ' ] , args ) <nl> fullname = ' emscripten_bind_ ' + generating_classname + ' __ ' + mname <nl> generating_classname_suffixed = generating_classname <nl> def generate_class ( generating_classname , classname , clazz ) : <nl> % s % s_p % d ( % s ) { <nl> % s % s % s ( % s ) ; <nl> } <nl> - ' ' ' % ( ret , fullname , i , ' , ' . join ( typedargs [ : i + ( 0 if constructor else 1 ) ] ) , ' return ' if ret . replace ( ' ' , ' ' ) ! = ' void ' else ' ' , callprefix , actualmname , ' , ' . join ( justargs [ : i ] ) ) ) <nl> + ' ' ' % ( ret , fullname , i , ' , ' . join ( typedargs [ : i + ( 0 if not need_self else 1 ) ] ) , ' return ' if ret . replace ( ' ' , ' ' ) ! = ' void ' else ' ' , callprefix , actualmname , ' , ' . join ( justargs [ : i ] ) ) ) <nl> <nl> c_funcs . append ( fullname + ' _p ' + str ( i ) ) <nl> <nl> def generate_class ( generating_classname , classname , clazz ) : <nl> calls + = ' ' ' this . ptr = _ % s_p % d ( % s ) ; <nl> ' ' ' % ( fullname , i , ' , ' . join ( justargs [ : i ] ) ) <nl> else : <nl> - calls + = ' ' ' % s_ % s_p % d ( this . ptr % s ) ; <nl> - ' ' ' % ( ' return ' if ret ! = ' void ' else ' ' , fullname , i , ( ' , ' if i > 0 else ' ' ) + ' , ' . join ( justargs [ : i ] ) ) <nl> + calls + = ' ' ' % s_ % s_p % d ( % s % s ) ; <nl> + ' ' ' % ( ' return ' if ret ! = ' void ' else ' ' , fullname , i , ' this . ptr ' if need_self else ' ' , ( ' , ' if i > 0 else ' ' ) + ' , ' . join ( justargs [ : i ] ) ) <nl> <nl> print ' Maekin : ' , classname , generating_classname , mname , mname_suffixed <nl> if constructor : <nl> def generate_class ( generating_classname , classname , clazz ) : <nl> # Nothing to generate for pure virtual classes <nl> <nl> def check_pure_virtual ( clazz , progeny ) : <nl> - if any ( [ check_pure_virtual ( classes [ parent [ ' class ' ] ] , [ clazz ] + progeny ) for parent in clazz [ ' inherits ' ] ] ) : return True <nl> + print ' Checking pure virtual for ' , clazz [ ' name ' ] , clazz [ ' inherits ' ] <nl> + # If we do not recognize any of the parent classes , assume this is pure virtual - ignore it <nl> + if any ( [ ( ( not parent [ ' class ' ] in classes ) or check_pure_virtual ( classes [ parent [ ' class ' ] ] , [ clazz ] + progeny ) ) for parent in clazz [ ' inherits ' ] ] ) : return True <nl> <nl> def dirtied ( mname ) : <nl> # print ' zz checking dirtiness for ' , mname , ' in ' , progeny <nl> def dirtied ( mname ) : <nl> <nl> # In addition , generate all methods of parent classes . We do not inherit in JS ( how would we do multiple inheritance etc . ? ) <nl> for parent in clazz [ ' inherits ' ] : <nl> + if parent [ ' class ' ] not in classes : <nl> + print ' Warning : parent class ' , parent , ' not a known class . Ignoring . ' <nl> + continue <nl> generate_class ( classname , parent [ ' class ' ] , classes [ parent [ ' class ' ] ] ) <nl> <nl> # TODO : Add a destructor <nl>
support for binding static functions
emscripten-core/emscripten
78241b0617a8bbe62023ba578c412238ce802b80
2011-07-24T06:43:01Z
mmm a / Source / SGDLib / SGD . cpp <nl> ppp b / Source / SGDLib / SGD . cpp <nl> void SGD < ElemType > : : TrainOrAdaptModel ( int startEpoch , ComputationNetworkPtr net , <nl> m_lastFinishedEpochTrainLoss = epochCriterion . Average ( ) ; <nl> for ( size_t j = 0 ; j < epochEvalErrors . size ( ) ; j + + ) <nl> epochEvalErrors [ j ] . LogCriterion ( evaluationNodes [ j ] - > NodeName ( ) ) ; <nl> - fprintf ( stderr , " totalSamplesSeen = % d ; learningRatePerSample = % . 8g ; epochTime = % . 6gs \ n " , ( int ) totalTrainingSamplesSeen , learnRatePerSample , epochTime ) ; <nl> + fprintf ( stderr , " totalSamplesSeen = % zu ; learningRatePerSample = % . 8g ; epochTime = % . 6gs \ n " , totalTrainingSamplesSeen , learnRatePerSample , epochTime ) ; <nl> # if 0 <nl> / / TODO : This was only printed if > 1 eval criterion . Why ? Needed ? <nl> LOGPRINTF ( stderr , " Finished Epoch [ % 2d of % d ] : Criterion Node [ % ls ] Per Sample = % . 8g \ n " , <nl>
Integrate 91c0fd06a9da3e74adc667a935567f2432f1d802 into master
microsoft/CNTK
d66929bda4ad5a04ee7c7595e1fa46fa931bbf05
2017-07-05T20:20:04Z
mmm a / filament / backend / src / metal / MetalDriver . mm <nl> ppp b / filament / backend / src / metal / MetalDriver . mm <nl> <nl> mContext - > driverPool = [ [ NSAutoreleasePool alloc ] init ] ; <nl> mContext - > device = MTLCreateSystemDefaultDevice ( ) ; <nl> mContext - > commandQueue = [ mContext - > device newCommandQueue ] ; <nl> + mContext - > commandQueue . label = @ " Filament " ; <nl> mContext - > pipelineStateCache . setDevice ( mContext - > device ) ; <nl> mContext - > depthStencilStateCache . setDevice ( mContext - > device ) ; <nl> mContext - > samplerStateCache . setDevice ( mContext - > device ) ; <nl>
Label Metal command queue
google/filament
54e224e9fa4bb5f66578aa4f2ac9cd64bd1a96a4
2019-08-07T16:51:50Z
mmm a / db / btree . cpp <nl> ppp b / db / btree . cpp <nl> <nl> # include " dbhelpers . h " <nl> # include " curop - inl . h " <nl> # include " stats / counters . h " <nl> + # include " dur_commitjob . h " <nl> <nl> namespace mongo { <nl> <nl> - / / # define VERIFYTHISLOC dassert ( thisLoc . btree ( ) = = this ) ; <nl> - / / with _DURABLE , this assert wouldn ' t work without getting fancier as there are multiple mmap views for _DEBUG mode . . . <nl> - # define VERIFYTHISLOC <nl> + # define VERIFYTHISLOC dassert ( thisLoc . btree ( ) = = this | | testIntent ) ; <nl> <nl> / * * <nl> * give us a writable version of the btree bucket ( declares write intent ) . <nl> namespace mongo { <nl> <nl> / * BucketBasics mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm * / <nl> <nl> + void BucketBasics : : assertWritable ( ) { <nl> + if ( cmdLine . dur ) <nl> + dur : : assertAlreadyDeclared ( this , sizeof ( * this ) ) ; <nl> + } <nl> + <nl> string BtreeBucket : : bucketSummary ( ) const { <nl> stringstream ss ; <nl> ss < < " Bucket info : " < < endl ; <nl> namespace mongo { <nl> void BucketBasics : : _pack ( const DiskLoc thisLoc , const Ordering & order , int & refPos ) const { <nl> if ( flags & Packed ) <nl> return ; <nl> + <nl> + VERIFYTHISLOC <nl> + <nl> + / * * TODO perhaps this can be optimized . for example if packing does no write , we can skip intent decl . <nl> + an empirical approach is probably best than just adding new code : perhaps the bucket would need <nl> + declaration anyway within the group commit interval , in which case we would just be adding <nl> + code and complexity without benefit . <nl> + * / <nl> thisLoc . btreemod ( ) - > _packReadyForMod ( order , refPos ) ; <nl> } <nl> + <nl> + / * * version when write intent already declared * / <nl> void BucketBasics : : _packReadyForMod ( const Ordering & order , int & refPos ) { <nl> + assertWritable ( ) ; <nl> + <nl> if ( flags & Packed ) <nl> return ; <nl> <nl> namespace mongo { <nl> n = i ; <nl> int dataUsed = tdz - ofs ; <nl> memcpy ( data + ofs , temp + ofs , dataUsed ) ; <nl> + <nl> + / / assertWritable ( ) ; <nl> + / / TEMP TEST getDur ( ) . declareWriteIntent ( this , sizeof ( * this ) ) ; <nl> + <nl> emptySize = tdz - dataUsed - n * sizeof ( _KeyNode ) ; <nl> assert ( emptySize > = 0 ) ; <nl> <nl> namespace mongo { <nl> } <nl> <nl> inline void BucketBasics : : truncateTo ( int N , const Ordering & order , int & refPos ) { <nl> + dbMutex . assertWriteLocked ( ) ; <nl> + assertWritable ( ) ; <nl> + <nl> n = N ; <nl> setNotPacked ( ) ; <nl> _packReadyForMod ( order , refPos ) ; <nl> namespace mongo { <nl> <nl> void BtreeBucket : : split ( const DiskLoc thisLoc , int keypos , const DiskLoc recordLoc , const BSONObj & key , const Ordering & order , const DiskLoc lchild , const DiskLoc rchild , IndexDetails & idx ) <nl> { <nl> + assertWritable ( ) ; <nl> + <nl> if ( split_debug ) <nl> out ( ) < < " " < < thisLoc . toString ( ) < < " . split " < < endl ; <nl> <nl>
more asserts
mongodb/mongo
324086f927ba1866ccd376b323de51099f726e00
2010-12-24T17:20:33Z
mmm a / src / mongo / dbtests / counttests . cpp <nl> ppp b / src / mongo / dbtests / counttests . cpp <nl> namespace CountTests { <nl> } <nl> } ; <nl> <nl> - class CountBasic : public Base { <nl> + class Basic : public Base { <nl> public : <nl> void run ( ) { <nl> insert ( " { \ " a \ " : \ " b \ " } " ) ; <nl> namespace CountTests { <nl> } <nl> } ; <nl> <nl> - class CountQuery : public Base { <nl> + class Query : public Base { <nl> public : <nl> void run ( ) { <nl> insert ( " { \ " a \ " : \ " b \ " } " ) ; <nl> namespace CountTests { <nl> } <nl> } ; <nl> <nl> - class CountFields : public Base { <nl> + class Fields : public Base { <nl> public : <nl> void run ( ) { <nl> insert ( " { \ " a \ " : \ " b \ " } " ) ; <nl> namespace CountTests { <nl> } <nl> } ; <nl> <nl> - class CountQueryFields : public Base { <nl> + class QueryFields : public Base { <nl> public : <nl> void run ( ) { <nl> insert ( " { \ " a \ " : \ " b \ " } " ) ; <nl> namespace CountTests { <nl> } <nl> } ; <nl> <nl> - class CountIndexedRegex : public Base { <nl> + class IndexedRegex : public Base { <nl> public : <nl> void run ( ) { <nl> insert ( " { \ " a \ " : \ " b \ " } " ) ; <nl> namespace CountTests { <nl> } <nl> <nl> void setupTests ( ) { <nl> - add < CountBasic > ( ) ; <nl> - add < CountQuery > ( ) ; <nl> - add < CountFields > ( ) ; <nl> - add < CountQueryFields > ( ) ; <nl> - add < CountIndexedRegex > ( ) ; <nl> + add < Basic > ( ) ; <nl> + add < Query > ( ) ; <nl> + add < Fields > ( ) ; <nl> + add < QueryFields > ( ) ; <nl> + add < IndexedRegex > ( ) ; <nl> } <nl> } myall ; <nl> <nl>
Remove ' Count ' prefix from unit test class names .
mongodb/mongo
090476bf93e79687111d5310a658030b18b8dac0
2012-04-04T17:19:48Z
mmm a / cocos / scripting / lua / bindings / CCLuaEngine . cpp <nl> ppp b / cocos / scripting / lua / bindings / CCLuaEngine . cpp <nl> int LuaEngine : : executeEvent ( int nHandler , const char * pEventName , Ref * pEventSou <nl> _stack - > pushString ( pEventName ) ; <nl> if ( pEventSource ) <nl> { <nl> - _stack - > pushObject ( pEventSource , pEventSourceClassName ? pEventSourceClassName : " cc . Object " ) ; <nl> + _stack - > pushObject ( pEventSource , pEventSourceClassName ? pEventSourceClassName : " cc . Ref " ) ; <nl> } <nl> int ret = _stack - > executeFunctionByHandler ( nHandler , pEventSource ? 2 : 1 ) ; <nl> _stack - > clean ( ) ; <nl> int LuaEngine : : handleCommonEvent ( void * data ) <nl> } <nl> else <nl> { <nl> - _stack - > pushObject ( commonInfo - > eventSource , " cc . Object " ) ; <nl> + _stack - > pushObject ( commonInfo - > eventSource , " cc . Ref " ) ; <nl> } <nl> } <nl> int ret = _stack - > executeFunctionByHandler ( commonInfo - > handler , commonInfo - > eventSource ? 2 : 1 ) ; <nl> int LuaEngine : : handlerControlEvent ( void * data ) <nl> <nl> if ( 0 ! = handler ) <nl> { <nl> - _stack - > pushObject ( ( Ref * ) basicScriptData - > nativeObject , " cc . Object " ) ; <nl> + _stack - > pushObject ( ( Ref * ) basicScriptData - > nativeObject , " cc . Ref " ) ; <nl> _stack - > pushInt ( controlEvents ) ; <nl> ret = _stack - > executeFunctionByHandler ( handler , 2 ) ; <nl> _stack - > clean ( ) ; <nl> int LuaEngine : : handleStudioEventListener ( ScriptHandlerMgr : : HandlerType type , void <nl> if ( 0 = = handler ) <nl> return 0 ; <nl> <nl> - _stack - > pushObject ( listenerData - > objTarget , " cc . Object " ) ; <nl> + _stack - > pushObject ( listenerData - > objTarget , " cc . Ref " ) ; <nl> _stack - > pushInt ( listenerData - > eventType ) ; <nl> <nl> _stack - > executeFunctionByHandler ( handler , 2 ) ; <nl> mmm a / cocos / scripting / lua / bindings / LuaBasicConversions . cpp <nl> ppp b / cocos / scripting / lua / bindings / LuaBasicConversions . cpp <nl> bool luavals_variadic_to_array ( lua_State * L , int argc , Array * * ret ) <nl> else if ( lua_isuserdata ( L , i + 2 ) ) <nl> { <nl> tolua_Error err ; <nl> - if ( ! tolua_isusertype ( L , i + 2 , " cc . Object " , 0 , & err ) ) <nl> + if ( ! tolua_isusertype ( L , i + 2 , " cc . Ref " , 0 , & err ) ) <nl> { <nl> # if COCOS2D_DEBUG > = 1 <nl> luaval_to_native_err ( L , " # ferror : " , & err ) ; <nl> mmm a / cocos / scripting / lua / bindings / LuaBasicConversions . h <nl> ppp b / cocos / scripting / lua / bindings / LuaBasicConversions . h <nl> bool luavals_variadic_to_ccvector ( lua_State * L , int argc , cocos2d : : Vector < T > * r <nl> if ( lua_isuserdata ( L , i + 2 ) ) <nl> { <nl> tolua_Error err ; <nl> - / / Undo check <nl> - if ( ! tolua_isusertype ( L , i + 2 , " cc . Object " , 0 , & err ) ) <nl> + <nl> + if ( ! tolua_isusertype ( L , i + 2 , " cc . Ref " , 0 , & err ) ) <nl> { <nl> ok = false ; <nl> break ; <nl> mmm a / cocos / scripting / lua / bindings / LuaScriptHandlerMgr . cpp <nl> ppp b / cocos / scripting / lua / bindings / LuaScriptHandlerMgr . cpp <nl> static int tolua_Cocos2d_ScriptHandlerMgr_registerScriptHandler00 ( lua_State * tol <nl> # ifndef TOLUA_RELEASE <nl> tolua_Error tolua_err ; <nl> if ( ! tolua_isusertype ( tolua_S , 1 , " ScriptHandlerMgr " , 0 , & tolua_err ) | | <nl> - ! tolua_isusertype ( tolua_S , 2 , " cc . Object " , 0 , & tolua_err ) | | <nl> + ! tolua_isusertype ( tolua_S , 2 , " cc . Ref " , 0 , & tolua_err ) | | <nl> ! toluafix_isfunction ( tolua_S , 3 , " LUA_FUNCTION " , 0 , & tolua_err ) | | <nl> ! tolua_isnumber ( tolua_S , 4 , 0 , & tolua_err ) | | <nl> ! tolua_isnoobj ( tolua_S , 5 , & tolua_err ) ) <nl> static int tolua_Cocos2d_ScriptHandlerMgr_unregisterScriptHandler00 ( lua_State * t <nl> # ifndef TOLUA_RELEASE <nl> tolua_Error tolua_err ; <nl> if ( ! tolua_isusertype ( tolua_S , 1 , " ScriptHandlerMgr " , 0 , & tolua_err ) | | <nl> - ! tolua_isusertype ( tolua_S , 2 , " cc . Object " , 0 , & tolua_err ) | | <nl> + ! tolua_isusertype ( tolua_S , 2 , " cc . Ref " , 0 , & tolua_err ) | | <nl> ! tolua_isnumber ( tolua_S , 3 , 0 , & tolua_err ) | | <nl> ! tolua_isnoobj ( tolua_S , 4 , & tolua_err ) ) <nl> goto tolua_lerror ; <nl> static int tolua_Cocos2d_ScriptHandlerMgr_removeObjectAllHandlers00 ( lua_State * t <nl> # ifndef TOLUA_RELEASE <nl> tolua_Error tolua_err ; <nl> if ( ! tolua_isusertype ( tolua_S , 1 , " ScriptHandlerMgr " , 0 , & tolua_err ) | | <nl> - ! tolua_isusertype ( tolua_S , 2 , " cc . Object " , 0 , & tolua_err ) | | <nl> + ! tolua_isusertype ( tolua_S , 2 , " cc . Ref " , 0 , & tolua_err ) | | <nl> ! tolua_isnoobj ( tolua_S , 3 , & tolua_err ) ) <nl> goto tolua_lerror ; <nl> else <nl> mmm a / cocos / scripting / lua / bindings / lua_cocos2dx_extension_manual . cpp <nl> ppp b / cocos / scripting / lua / bindings / lua_cocos2dx_extension_manual . cpp <nl> static int tolua_cocos2d_CCBReader_load ( lua_State * tolua_S ) <nl> } <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> - if ( ! tolua_isusertype ( tolua_S , 3 , " cc . Object " , 0 , & tolua_err ) ) <nl> + if ( ! tolua_isusertype ( tolua_S , 3 , " cc . Ref " , 0 , & tolua_err ) ) <nl> goto tolua_lerror ; <nl> # endif <nl> Ref * owner = static_cast < Ref * > ( tolua_tousertype ( tolua_S , 3 , 0 ) ) ; <nl> mmm a / cocos / scripting / lua / bindings / lua_xml_http_request . cpp <nl> ppp b / cocos / scripting / lua / bindings / lua_xml_http_request . cpp <nl> TOLUA_API int register_xml_http_request ( lua_State * L ) <nl> lua_reg_xml_http_request ( L ) ; <nl> tolua_module ( L , " cc " , 0 ) ; <nl> tolua_beginmodule ( L , " cc " ) ; <nl> - tolua_cclass ( L , " XMLHttpRequest " , " cc . XMLHttpRequest " , " cc . Object " , lua_collect_xml_http_request ) ; <nl> + tolua_cclass ( L , " XMLHttpRequest " , " cc . XMLHttpRequest " , " cc . Ref " , lua_collect_xml_http_request ) ; <nl> tolua_beginmodule ( L , " XMLHttpRequest " ) ; <nl> tolua_variable ( L , " responseType " , lua_get_XMLHttpRequest_responseType , lua_set_XMLHttpRequest_responseType ) ; <nl> tolua_variable ( L , " withCredentials " , lua_get_XMLHttpRequest_withCredentials , lua_set_XMLHttpRequest_withCredentials ) ; <nl> mmm a / cocos / scripting / lua / script / DeprecatedClass . lua <nl> ppp b / cocos / scripting / lua / script / DeprecatedClass . lua <nl> end <nl> _G [ " CCJumpBy " ] = DeprecatedClass . CCJumpBy ( ) <nl> - - CCJumpBy class will be Deprecated , end <nl> <nl> mmmCCObject class will be Deprecated , begin <nl> - function DeprecatedClass . CCObject ( ) <nl> - deprecatedTip ( " CCObject " , " cc . Object " ) <nl> - return cc . Object <nl> - end <nl> - _G [ " CCObject " ] = DeprecatedClass . CCObject ( ) <nl> mmmCCObject class will be Deprecated , end <nl> - <nl> - - CCTransitionRotoZoom class will be Deprecated , begin <nl> function DeprecatedClass . CCTransitionRotoZoom ( ) <nl> deprecatedTip ( " CCTransitionRotoZoom " , " cc . TransitionRotoZoom " ) <nl>
Replace β€œ cc . object ” with β€œ cc . ref ” for lua binding
cocos2d/cocos2d-x
5f28e6bd72f42dd80336f65c084c18b577d5438e
2014-02-23T12:56:49Z
mmm a / tests / testflows / helpers / cluster . py <nl> ppp b / tests / testflows / helpers / cluster . py <nl> def __init__ ( self , local = False , <nl> self . docker_compose + = f " - - project - directory \ " { docker_compose_project_dir } \ " - - file \ " { docker_compose_file_path } \ " " <nl> self . lock = threading . Lock ( ) <nl> <nl> - def shell ( self , node ) : <nl> + def shell ( self , node , timeout = 120 ) : <nl> " " " Returns unique shell terminal to be used . <nl> " " " <nl> if node is None : <nl> return Shell ( ) <nl> <nl> - return Shell ( command = [ <nl> + shell = Shell ( command = [ <nl> " / bin / bash " , " - - noediting " , " - c " , f " { self . docker_compose } exec { node } bash - - noediting " <nl> ] , name = node ) <nl> <nl> - def bash ( self , node , timeout = 60 ) : <nl> + shell . timeout = timeout <nl> + return shell <nl> + <nl> + def bash ( self , node , timeout = 120 ) : <nl> " " " Returns thread - local bash terminal <nl> to a specific node . <nl> <nl>
Fixing timeouts , courtesy of @ vzakaznikov
ClickHouse/ClickHouse
bda2eeef17bbf4c1750484b133bf562dccf05efb
2020-07-24T15:38:33Z
mmm a / modules / mono / csharp_script . cpp <nl> ppp b / modules / mono / csharp_script . cpp <nl> void CSharpLanguage : : init ( ) { <nl> print_line ( " Run this binary with ' - - generate - mono - glue path / to / modules / mono / glue ' " ) ; <nl> # endif <nl> <nl> - gdmono - > initialize_load_assemblies ( ) ; <nl> + if ( gdmono - > is_runtime_initialized ( ) ) <nl> + gdmono - > initialize_load_assemblies ( ) ; <nl> <nl> # ifdef TOOLS_ENABLED <nl> EditorNode : : add_init_callback ( & _editor_init_callback ) ; <nl>
Mono / C # : Fix crash on exported games that don ' t use C #
godotengine/godot
85d8c427639554e67597daca577aa0509097263e
2019-11-29T00:35:46Z
mmm a / doc / tutorials / introduction / documenting_opencv / documentation_tutorial . markdown <nl> ppp b / doc / tutorials / introduction / documenting_opencv / documentation_tutorial . markdown <nl> Generate documentation { # tutorial_documentation_generate } <nl> @ code { . sh } <nl> make check_pylint <nl> @ endcode <nl> + @ note [ Pylint ] ( https : / / www . pylint . org / # install ) must be installed before running cmake to be <nl> + able to test Python code . You can install using your system ' s package manager , or with pip : <nl> + @ code { . sh } pip install pylint @ endcode <nl> <nl> Quick start { # tutorial_documentation_quick_start } <nl> = = = = = = = = = = = <nl>
add pylint install note
opencv/opencv
b624da27bd7a516cd8780192d326a353f2ed3fe8
2020-05-21T11:55:11Z
mmm a / java / Makefile <nl> ppp b / java / Makefile <nl> test : java <nl> java - ea - Djava . library . path = . : . . / - cp " $ ( ROCKSDB_JAR ) : . : . / * " org . rocksdb . test . ReadOnlyTest <nl> java - ea - Djava . library . path = . : . . / - cp " $ ( ROCKSDB_JAR ) : . : . / * " org . rocksdb . test . ReadOptionsTest <nl> java - ea - Djava . library . path = . : . . / - cp " $ ( ROCKSDB_JAR ) : . : . / * " org . rocksdb . test . StatisticsCollectorTest <nl> - @ rm - rf / tmp / rocksdbjni_ * <nl> + java - ea - Djava . library . path = . : . . / - cp " $ ( ROCKSDB_JAR ) : . : . / * " org . rocksdb . test . ComparatorOptionsTest <nl> + java - ea - Djava . library . path = . : . . / - cp " $ ( ROCKSDB_JAR ) : . : . / * " org . rocksdb . test . ComparatorTest <nl> + java - ea - Djava . library . path = . : . . / - cp " $ ( ROCKSDB_JAR ) : . : . / * " org . rocksdb . test . DirectComparatorTest <nl> <nl> db_bench : java <nl> javac org / rocksdb / benchmark / * . java <nl> mmm a / java / org / rocksdb / AbstractComparator . java <nl> ppp b / java / org / rocksdb / AbstractComparator . java <nl> <nl> * @ see org . rocksdb . Comparator <nl> * @ see org . rocksdb . DirectComparator <nl> * / <nl> - abstract class AbstractComparator < T extends AbstractSlice > extends RocksObject { <nl> + public abstract class AbstractComparator < T extends AbstractSlice > extends RocksObject { <nl> <nl> public abstract String name ( ) ; <nl> <nl> new file mode 100644 <nl> index 0000000000 . . e3cc6bb77b <nl> mmm / dev / null <nl> ppp b / java / org / rocksdb / test / AbstractComparatorTest . java <nl> <nl> + / / Copyright ( c ) 2014 , Facebook , Inc . All rights reserved . <nl> + / / This source code is licensed under the BSD - style license found in the <nl> + / / LICENSE file in the root directory of this source tree . An additional grant <nl> + / / of patent rights can be found in the PATENTS file in the same directory . <nl> + <nl> + package org . rocksdb . test ; <nl> + <nl> + import org . rocksdb . * ; <nl> + <nl> + import java . io . IOException ; <nl> + import java . nio . file . * ; <nl> + import java . nio . file . attribute . BasicFileAttributes ; <nl> + import java . util . Random ; <nl> + <nl> + import static org . rocksdb . test . Types . byteToInt ; <nl> + import static org . rocksdb . test . Types . intToByte ; <nl> + <nl> + / * * <nl> + * Abstract tests for both Comparator and DirectComparator <nl> + * / <nl> + public abstract class AbstractComparatorTest { <nl> + <nl> + / * * <nl> + * Get a comparator which will expect Integer keys <nl> + * and determine an ascending order <nl> + * <nl> + * @ return An integer ascending order key comparator <nl> + * / <nl> + public abstract AbstractComparator getAscendingIntKeyComparator ( ) ; <nl> + <nl> + / * * <nl> + * Test which stores random keys into the database <nl> + * using an @ see getAscendingIntKeyComparator <nl> + * it then checks that these keys are read back in <nl> + * ascending order <nl> + * <nl> + * @ param db_path A path where we can store database <nl> + * files temporarily <nl> + * / <nl> + public void testRoundtrip ( final Path db_path ) throws IOException { <nl> + <nl> + Options opt = null ; <nl> + RocksDB db = null ; <nl> + <nl> + try { <nl> + opt = new Options ( ) ; <nl> + opt . setCreateIfMissing ( true ) ; <nl> + opt . setComparator ( getAscendingIntKeyComparator ( ) ) ; <nl> + <nl> + / / store 10 , 000 random integer keys <nl> + final int ITERATIONS = 10000 ; <nl> + <nl> + db = RocksDB . open ( opt , db_path . toString ( ) ) ; <nl> + final Random random = new Random ( ) ; <nl> + for ( int i = 0 ; i < ITERATIONS ; i + + ) { <nl> + final byte key [ ] = intToByte ( random . nextInt ( ) ) ; <nl> + if ( i > 0 & & db . get ( key ) ! = null ) { / / does key already exist ( avoid duplicates ) <nl> + i - - ; / / generate a different key <nl> + } else { <nl> + db . put ( key , " value " . getBytes ( ) ) ; <nl> + } <nl> + } <nl> + db . close ( ) ; <nl> + <nl> + <nl> + / / re - open db and read from start to end <nl> + / / integer keys should be in ascending <nl> + / / order as defined by SimpleIntComparator <nl> + db = RocksDB . open ( opt , db_path . toString ( ) ) ; <nl> + final RocksIterator it = db . newIterator ( ) ; <nl> + it . seekToFirst ( ) ; <nl> + int lastKey = Integer . MIN_VALUE ; <nl> + int count = 0 ; <nl> + for ( it . seekToFirst ( ) ; it . isValid ( ) ; it . next ( ) ) { <nl> + final int thisKey = byteToInt ( it . key ( ) ) ; <nl> + assert ( thisKey > lastKey ) ; <nl> + lastKey = thisKey ; <nl> + count + + ; <nl> + } <nl> + db . close ( ) ; <nl> + <nl> + assert ( count = = ITERATIONS ) ; <nl> + <nl> + } catch ( final RocksDBException e ) { <nl> + System . err . format ( " [ ERROR ] : % s % n " , e ) ; <nl> + e . printStackTrace ( ) ; <nl> + } finally { <nl> + if ( db ! = null ) { <nl> + db . close ( ) ; <nl> + } <nl> + <nl> + if ( opt ! = null ) { <nl> + opt . dispose ( ) ; <nl> + } <nl> + <nl> + removeDb ( db_path ) ; / / cleanup after ourselves ! <nl> + } <nl> + } <nl> + <nl> + / * * <nl> + * Compares integer keys <nl> + * so that they are in ascending order <nl> + * <nl> + * @ param a 4 - bytes representing an integer key <nl> + * @ param b 4 - bytes representing an integer key <nl> + * <nl> + * @ return negative if a < b , 0 if a = = b , positive otherwise <nl> + * / <nl> + protected final int compareIntKeys ( final byte [ ] a , final byte [ ] b ) { <nl> + <nl> + final int iA = byteToInt ( a ) ; <nl> + final int iB = byteToInt ( b ) ; <nl> + <nl> + / / protect against int key calculation overflow <nl> + final double diff = ( double ) iA - iB ; <nl> + final int result ; <nl> + if ( diff < Integer . MIN_VALUE ) { <nl> + result = Integer . MIN_VALUE ; <nl> + } else if ( diff > Integer . MAX_VALUE ) { <nl> + result = Integer . MAX_VALUE ; <nl> + } else { <nl> + result = ( int ) diff ; <nl> + } <nl> + <nl> + return result ; <nl> + } <nl> + <nl> + / * * <nl> + * Utility method for deleting database files <nl> + * <nl> + * @ param db_path The path to the database to remove <nl> + * from the filesystem <nl> + * / <nl> + private static void removeDb ( final Path db_path ) throws IOException { <nl> + Files . walkFileTree ( db_path , new SimpleFileVisitor < Path > ( ) { <nl> + @ Override <nl> + public FileVisitResult visitFile ( final Path file , final BasicFileAttributes attrs ) <nl> + throws IOException { <nl> + Files . delete ( file ) ; <nl> + return FileVisitResult . CONTINUE ; <nl> + } <nl> + <nl> + @ Override <nl> + public FileVisitResult visitFileFailed ( final Path file , IOException exc ) <nl> + throws IOException { <nl> + / / try to delete the file anyway , even if its attributes <nl> + / / could not be read , since delete - only access is <nl> + / / theoretically possible <nl> + Files . delete ( file ) ; <nl> + return FileVisitResult . CONTINUE ; <nl> + } <nl> + <nl> + @ Override <nl> + public FileVisitResult postVisitDirectory ( final Path dir , IOException exc ) <nl> + throws IOException { <nl> + if ( exc = = null ) { <nl> + Files . delete ( dir ) ; <nl> + return FileVisitResult . CONTINUE ; <nl> + } else { <nl> + / / directory iteration failed ; propagate exception <nl> + throw exc ; <nl> + } <nl> + } <nl> + } ) ; <nl> + } <nl> + } <nl> new file mode 100644 <nl> index 0000000000 . . e25209392f <nl> mmm / dev / null <nl> ppp b / java / org / rocksdb / test / ComparatorOptionsTest . java <nl> <nl> + / / Copyright ( c ) 2014 , Facebook , Inc . All rights reserved . <nl> + / / This source code is licensed under the BSD - style license found in the <nl> + / / LICENSE file in the root directory of this source tree . An additional grant <nl> + / / of patent rights can be found in the PATENTS file in the same directory . <nl> + <nl> + package org . rocksdb . test ; <nl> + <nl> + import org . rocksdb . ComparatorOptions ; <nl> + import org . rocksdb . RocksDB ; <nl> + <nl> + import java . util . Random ; <nl> + <nl> + public class ComparatorOptionsTest { <nl> + <nl> + static { <nl> + RocksDB . loadLibrary ( ) ; <nl> + } <nl> + <nl> + public static void main ( String [ ] args ) { <nl> + final ComparatorOptions copt = new ComparatorOptions ( ) ; <nl> + Random rand = new Random ( ) ; <nl> + <nl> + { / / UseAdaptiveMutex test <nl> + copt . setUseAdaptiveMutex ( true ) ; <nl> + assert ( copt . useAdaptiveMutex ( ) = = true ) ; <nl> + <nl> + copt . setUseAdaptiveMutex ( false ) ; <nl> + assert ( copt . useAdaptiveMutex ( ) = = false ) ; <nl> + } <nl> + <nl> + copt . dispose ( ) ; <nl> + System . out . println ( " Passed ComparatorOptionsTest " ) ; <nl> + } <nl> + } <nl> new file mode 100644 <nl> index 0000000000 . . 34d7c78dfe <nl> mmm / dev / null <nl> ppp b / java / org / rocksdb / test / ComparatorTest . java <nl> <nl> + / / Copyright ( c ) 2014 , Facebook , Inc . All rights reserved . <nl> + / / This source code is licensed under the BSD - style license found in the <nl> + / / LICENSE file in the root directory of this source tree . An additional grant <nl> + / / of patent rights can be found in the PATENTS file in the same directory . <nl> + <nl> + package org . rocksdb . test ; <nl> + <nl> + import org . rocksdb . * ; <nl> + <nl> + import java . io . IOException ; <nl> + import java . nio . file . FileSystems ; <nl> + <nl> + public class ComparatorTest { <nl> + private static final String db_path = " / tmp / comparator_db " ; <nl> + <nl> + static { <nl> + RocksDB . loadLibrary ( ) ; <nl> + } <nl> + <nl> + public static void main ( String [ ] args ) throws IOException { <nl> + <nl> + final AbstractComparatorTest comparatorTest = new AbstractComparatorTest ( ) { <nl> + @ Override <nl> + public AbstractComparator getAscendingIntKeyComparator ( ) { <nl> + return new Comparator ( new ComparatorOptions ( ) ) { <nl> + <nl> + @ Override <nl> + public String name ( ) { <nl> + return " test . AscendingIntKeyComparator " ; <nl> + } <nl> + <nl> + @ Override <nl> + public int compare ( final Slice a , final Slice b ) { <nl> + return compareIntKeys ( a . data ( ) , b . data ( ) ) ; <nl> + } <nl> + } ; <nl> + } <nl> + } ; <nl> + <nl> + / / test the round - tripability of keys written and read with the Comparator <nl> + comparatorTest . testRoundtrip ( FileSystems . getDefault ( ) . getPath ( db_path ) ) ; <nl> + <nl> + System . out . println ( " Passed ComparatorTest " ) ; <nl> + } <nl> + } <nl> new file mode 100644 <nl> index 0000000000 . . 9df06eb73a <nl> mmm / dev / null <nl> ppp b / java / org / rocksdb / test / DirectComparatorTest . java <nl> <nl> + / / Copyright ( c ) 2014 , Facebook , Inc . All rights reserved . <nl> + / / This source code is licensed under the BSD - style license found in the <nl> + / / LICENSE file in the root directory of this source tree . An additional grant <nl> + / / of patent rights can be found in the PATENTS file in the same directory . <nl> + <nl> + package org . rocksdb . test ; <nl> + <nl> + import org . rocksdb . * ; <nl> + <nl> + import java . io . IOException ; <nl> + import java . nio . file . FileSystems ; <nl> + <nl> + public class DirectComparatorTest { <nl> + private static final String db_path = " / tmp / direct_comparator_db " ; <nl> + <nl> + static { <nl> + RocksDB . loadLibrary ( ) ; <nl> + } <nl> + <nl> + public static void main ( String [ ] args ) throws IOException { <nl> + <nl> + final AbstractComparatorTest comparatorTest = new AbstractComparatorTest ( ) { <nl> + @ Override <nl> + public AbstractComparator getAscendingIntKeyComparator ( ) { <nl> + return new DirectComparator ( new ComparatorOptions ( ) ) { <nl> + <nl> + @ Override <nl> + public String name ( ) { <nl> + return " test . AscendingIntKeyDirectComparator " ; <nl> + } <nl> + <nl> + @ Override <nl> + public int compare ( final DirectSlice a , final DirectSlice b ) { <nl> + final byte ax [ ] = new byte [ 4 ] , bx [ ] = new byte [ 4 ] ; <nl> + a . data ( ) . get ( ax ) ; <nl> + b . data ( ) . get ( bx ) ; <nl> + return compareIntKeys ( ax , bx ) ; <nl> + } <nl> + } ; <nl> + } <nl> + } ; <nl> + <nl> + / / test the round - tripability of keys written and read with the DirectComparator <nl> + comparatorTest . testRoundtrip ( FileSystems . getDefault ( ) . getPath ( db_path ) ) ; <nl> + <nl> + System . out . println ( " Passed DirectComparatorTest " ) ; <nl> + } <nl> + } <nl> new file mode 100644 <nl> index 0000000000 . . 22fcd35376 <nl> mmm / dev / null <nl> ppp b / java / org / rocksdb / test / Types . java <nl> <nl> + / / Copyright ( c ) 2014 , Facebook , Inc . All rights reserved . <nl> + / / This source code is licensed under the BSD - style license found in the <nl> + / / LICENSE file in the root directory of this source tree . An additional grant <nl> + / / of patent rights can be found in the PATENTS file in the same directory . <nl> + <nl> + package org . rocksdb . test ; <nl> + <nl> + / * * <nl> + * Simple type conversion methods <nl> + * for use in tests <nl> + * / <nl> + public class Types { <nl> + <nl> + / * * <nl> + * Convert first 4 bytes of a byte array to an int <nl> + * <nl> + * @ param data The byte array <nl> + * <nl> + * @ return An integer <nl> + * / <nl> + public static int byteToInt ( final byte data [ ] ) { <nl> + return ( data [ 0 ] & 0xff ) | <nl> + ( ( data [ 1 ] & 0xff ) < < 8 ) | <nl> + ( ( data [ 2 ] & 0xff ) < < 16 ) | <nl> + ( ( data [ 3 ] & 0xff ) < < 24 ) ; <nl> + } <nl> + <nl> + / * * <nl> + * Convert an int to 4 bytes <nl> + * <nl> + * @ param v The int <nl> + * <nl> + * @ return A byte array containing 4 bytes <nl> + * / <nl> + public static byte [ ] intToByte ( final int v ) { <nl> + return new byte [ ] { <nl> + ( byte ) ( ( v > > > 0 ) & 0xff ) , <nl> + ( byte ) ( ( v > > > 8 ) & 0xff ) , <nl> + ( byte ) ( ( v > > > 16 ) & 0xff ) , <nl> + ( byte ) ( ( v > > > 24 ) & 0xff ) <nl> + } ; <nl> + } <nl> + } <nl>
Tests for ComparatorOptions , Comparator and DirectComparator , and by
facebook/rocksdb
c63494fb61488b2c9380f17424fe277a2c094e9d
2014-10-21T14:52:27Z
mmm a / editor / import / resource_importer_obj . cpp <nl> ppp b / editor / import / resource_importer_obj . cpp <nl> static Error _parse_material_library ( const String & p_path , Map < String , Ref < Spati <nl> ERR_FAIL_COND_V ( current . is_null ( ) , ERR_FILE_CORRUPT ) ; <nl> <nl> String p = l . replace ( " map_Kd " , " " ) . replace ( " \ \ " , " / " ) . strip_edges ( ) ; <nl> - String path = base_path . plus_file ( p ) ; <nl> + String path ; <nl> + if ( p . is_abs_path ( ) ) { <nl> + path = p ; <nl> + } else { <nl> + path = base_path . plus_file ( p ) ; <nl> + } <nl> <nl> Ref < Texture > texture = ResourceLoader : : load ( path ) ; <nl> <nl> static Error _parse_material_library ( const String & p_path , Map < String , Ref < Spati <nl> ERR_FAIL_COND_V ( current . is_null ( ) , ERR_FILE_CORRUPT ) ; <nl> <nl> String p = l . replace ( " map_Ks " , " " ) . replace ( " \ \ " , " / " ) . strip_edges ( ) ; <nl> - String path = base_path . plus_file ( p ) ; <nl> + String path ; <nl> + if ( p . is_abs_path ( ) ) { <nl> + path = p ; <nl> + } else { <nl> + path = base_path . plus_file ( p ) ; <nl> + } <nl> <nl> Ref < Texture > texture = ResourceLoader : : load ( path ) ; <nl> <nl> static Error _parse_material_library ( const String & p_path , Map < String , Ref < Spati <nl> ERR_FAIL_COND_V ( current . is_null ( ) , ERR_FILE_CORRUPT ) ; <nl> <nl> String p = l . replace ( " map_Ns " , " " ) . replace ( " \ \ " , " / " ) . strip_edges ( ) ; <nl> - String path = base_path . plus_file ( p ) ; <nl> + String path ; <nl> + if ( p . is_abs_path ( ) ) { <nl> + path = p ; <nl> + } else { <nl> + path = base_path . plus_file ( p ) ; <nl> + } <nl> <nl> Ref < Texture > texture = ResourceLoader : : load ( path ) ; <nl> <nl>
Check for absolute paths in OBJ loader
godotengine/godot
45ba58c12376ab503230e5a4650648486042d936
2018-09-17T02:23:40Z
mmm a / platform / javascript / engine . js <nl> ppp b / platform / javascript / engine . js <nl> <nl> } ) ; <nl> } <nl> <nl> - this . preloadFile = function ( pathOrBuffer , bufferFilename ) { <nl> + this . preloadFile = function ( pathOrBuffer , destPath ) { <nl> <nl> if ( pathOrBuffer instanceof ArrayBuffer ) { <nl> pathOrBuffer = new Uint8Array ( pathOrBuffer ) ; <nl> <nl> } <nl> if ( pathOrBuffer instanceof Uint8Array ) { <nl> preloadedFiles . push ( { <nl> - path : bufferFilename , <nl> + path : destPath , <nl> buffer : pathOrBuffer <nl> } ) ; <nl> return Promise . resolve ( ) ; <nl> } else if ( typeof pathOrBuffer = = = ' string ' ) { <nl> return loadPromise ( pathOrBuffer , preloadProgressTracker ) . then ( function ( xhr ) { <nl> preloadedFiles . push ( { <nl> - path : pathOrBuffer , <nl> + path : destPath | | pathOrBuffer , <nl> buffer : xhr . response <nl> } ) ; <nl> } ) ; <nl>
Allow custom path when using engine . js preloadFile ( ) with URL
godotengine/godot
d373029382208226a55ddfc028a3261e0dc8279b
2018-03-27T09:26:29Z
mmm a / lib / AST / CMakeLists . txt <nl> ppp b / lib / AST / CMakeLists . txt <nl> add_swift_host_library ( swiftAST STATIC <nl> Evaluator . cpp <nl> Expr . cpp <nl> FineGrainedDependencies . cpp <nl> - FineGrainedDependenciesSourceFileDepGraphConstructor . cpp <nl> GenericEnvironment . cpp <nl> GenericSignature . cpp <nl> GenericSignatureBuilder . cpp <nl> add_swift_host_library ( swiftAST STATIC <nl> RequirementEnvironment . cpp <nl> SyntaxASTMap . cpp <nl> SILLayout . cpp <nl> + SourceFileDepGraphConstructor . cpp <nl> Stmt . cpp <nl> SubstitutionMap . cpp <nl> SwiftNameTranslation . cpp <nl> similarity index 100 % <nl> rename from lib / AST / FineGrainedDependenciesSourceFileDepGraphConstructor . cpp <nl> rename to lib / AST / SourceFileDepGraphConstructor . cpp <nl>
Merge remote - tracking branch ' origin / master ' into master - next
apple/swift
55de3e7aa95cf0f44cfe07336be9d3d120eb992c
2020-02-09T00:57:36Z
mmm a / src / base / rss / rss_autodownloadrule . cpp <nl> ppp b / src / base / rss / rss_autodownloadrule . cpp <nl> namespace RSS <nl> bool smartFilter = false ; <nl> QStringList previouslyMatchedEpisodes ; <nl> <nl> - mutable QString lastComputedEpisode ; <nl> + mutable QStringList lastComputedEpisodes ; <nl> mutable QHash < QString , QRegularExpression > cachedRegexes ; <nl> <nl> bool operator = = ( const AutoDownloadRuleData & other ) const <nl> bool AutoDownloadRule : : matchesMustNotContainExpression ( const QString & articleTit <nl> bool AutoDownloadRule : : matchesEpisodeFilterExpression ( const QString & articleTitle ) const <nl> { <nl> / / Reset the lastComputedEpisode , we don ' t want to leak it between matches <nl> - m_dataPtr - > lastComputedEpisode . clear ( ) ; <nl> + m_dataPtr - > lastComputedEpisodes . clear ( ) ; <nl> <nl> if ( m_dataPtr - > episodeFilter . isEmpty ( ) ) <nl> return true ; <nl> bool AutoDownloadRule : : matchesSmartEpisodeFilter ( const QString & articleTitle ) co <nl> <nl> / / See if this episode has been downloaded before <nl> const bool previouslyMatched = m_dataPtr - > previouslyMatchedEpisodes . contains ( episodeStr ) ; <nl> - const bool isRepack = articleTitle . contains ( " REPACK " , Qt : : CaseInsensitive ) | | articleTitle . contains ( " PROPER " , Qt : : CaseInsensitive ) ; <nl> - if ( previouslyMatched & & ( ! isRepack | | ! AutoDownloader : : instance ( ) - > downloadRepacks ( ) ) ) <nl> - return false ; <nl> + if ( previouslyMatched ) { <nl> + if ( ! AutoDownloader : : instance ( ) - > downloadRepacks ( ) ) <nl> + return false ; <nl> + <nl> + / / Now see if we ' ve downloaded this particular repack / proper combination <nl> + const bool isRepack = articleTitle . contains ( " REPACK " , Qt : : CaseInsensitive ) ; <nl> + const bool isProper = articleTitle . contains ( " PROPER " , Qt : : CaseInsensitive ) ; <nl> + <nl> + if ( ! isRepack & & ! isProper ) <nl> + return false ; <nl> + <nl> + const QString fullEpisodeStr = QString ( " % 1 % 2 % 3 " ) . arg ( episodeStr , <nl> + isRepack ? " - REPACK " : " " , <nl> + isProper ? " - PROPER " : " " ) ; <nl> + const bool previouslyMatchedFull = m_dataPtr - > previouslyMatchedEpisodes . contains ( fullEpisodeStr ) ; <nl> + if ( previouslyMatchedFull ) <nl> + return false ; <nl> + <nl> + m_dataPtr - > lastComputedEpisodes . append ( fullEpisodeStr ) ; <nl> + <nl> + / / If this is a REPACK and PROPER download , add the individual entries to the list <nl> + / / so we don ' t download those <nl> + if ( isRepack & & isProper ) { <nl> + m_dataPtr - > lastComputedEpisodes . append ( QString ( " % 1 - REPACK " ) . arg ( episodeStr ) ) ; <nl> + m_dataPtr - > lastComputedEpisodes . append ( QString ( " % 1 - PROPER " ) . arg ( episodeStr ) ) ; <nl> + } <nl> + } <nl> <nl> - m_dataPtr - > lastComputedEpisode = episodeStr ; <nl> + m_dataPtr - > lastComputedEpisodes . append ( episodeStr ) ; <nl> return true ; <nl> } <nl> <nl> bool AutoDownloadRule : : accepts ( const QVariantHash & articleData ) <nl> <nl> setLastMatch ( articleData [ Article : : KeyDate ] . toDateTime ( ) ) ; <nl> <nl> - if ( ! m_dataPtr - > lastComputedEpisode . isEmpty ( ) ) { <nl> - / / TODO : probably need to add a marker for PROPER / REPACK to avoid duplicate downloads <nl> - m_dataPtr - > previouslyMatchedEpisodes . append ( m_dataPtr - > lastComputedEpisode ) ; <nl> - m_dataPtr - > lastComputedEpisode . clear ( ) ; <nl> + / / If there ' s a matched episode string , add that to the previously matched list <nl> + if ( ! m_dataPtr - > lastComputedEpisodes . isEmpty ( ) ) { <nl> + m_dataPtr - > previouslyMatchedEpisodes . append ( m_dataPtr - > lastComputedEpisodes ) ; <nl> + m_dataPtr - > lastComputedEpisodes . clear ( ) ; <nl> } <nl> <nl> return true ; <nl>
Merge pull request from elFarto / master
qbittorrent/qBittorrent
38f4bea6f18668dd1e4463f9640bfae57245f871
2018-12-18T05:58:25Z
mmm a / test / test_nn . py <nl> ppp b / test / test_nn . py <nl> <nl> import itertools <nl> import warnings <nl> import pickle <nl> - import contextlib <nl> from copy import deepcopy <nl> from itertools import repeat , product <nl> from functools import reduce <nl> <nl> from torch . nn import Parameter <nl> from torch . nn . parallel . _functions import Broadcast <nl> from torch . testing . _internal . common_utils import freeze_rng_state , run_tests , TestCase , skipIfNoLapack , skipIfRocm , \ <nl> - TEST_NUMPY , TEST_SCIPY , TEST_WITH_ROCM , download_file , PY3 , \ <nl> + TEST_NUMPY , TEST_SCIPY , TEST_WITH_ROCM , download_file , \ <nl> get_function_arglist , load_tests , repeat_test_for_types , ALL_TENSORTYPES , \ <nl> ALL_TENSORTYPES2 , TemporaryFileName , TEST_WITH_UBSAN , IS_PPC <nl> from torch . testing . _internal . common_cuda import TEST_CUDA , TEST_MULTIGPU , TEST_CUDNN , TEST_CUDNN_VERSION <nl> def __init__ ( self ) : <nl> <nl> return l , n , s <nl> <nl> - @ contextlib . contextmanager <nl> - def _compatible_subtest ( self , * * kwargs ) : <nl> - # Added for subtest compatibility with Python 2 <nl> - if PY3 : <nl> - with self . subTest ( * * kwargs ) : <nl> - yield <nl> - else : <nl> - yield <nl> - <nl> def test_requires_grad_ ( self ) : <nl> m = self . _create_basic_net ( ) [ - 1 ] <nl> assert len ( list ( m . buffers ( ) ) ) > 0 , ' invalid test ' <nl> def test_random_pruning_sizes ( self ) : <nl> <nl> for m in modules : <nl> for name in names : <nl> - with self . _compatible_subtest ( m = m , name = name ) : <nl> + with self . subTest ( m = m , name = name ) : <nl> original_tensor = getattr ( m , name ) <nl> <nl> prune . random_unstructured ( m , name = name , amount = 0 . 1 ) <nl> def test_random_pruning_orig ( self ) : <nl> <nl> for m in modules : <nl> for name in names : <nl> - with self . _compatible_subtest ( m = m , name = name ) : <nl> + with self . subTest ( m = m , name = name ) : <nl> <nl> # tensor prior to pruning <nl> original_tensor = getattr ( m , name ) <nl> def test_random_pruning_new_weight ( self ) : <nl> <nl> for m in modules : <nl> for name in names : <nl> - with self . _compatible_subtest ( m = m , name = name ) : <nl> + with self . subTest ( m = m , name = name ) : <nl> # tensor prior to pruning <nl> original_tensor = getattr ( m , name ) <nl> prune . random_unstructured ( m , name = name , amount = 0 . 1 ) <nl> def test_random_pruning_pickle ( self ) : <nl> <nl> for m in modules : <nl> for name in names : <nl> - with self . _compatible_subtest ( m = m , name = name ) : <nl> + with self . subTest ( m = m , name = name ) : <nl> prune . random_unstructured ( m , name = name , amount = 0 . 1 ) <nl> m_new = pickle . loads ( pickle . dumps ( m ) ) <nl> self . assertIsInstance ( m_new , type ( m ) ) <nl> def test_remove_pruning ( self ) : <nl> <nl> for m in modules : <nl> for name in names : <nl> - with self . _compatible_subtest ( m = m , name = name ) : <nl> + with self . subTest ( m = m , name = name ) : <nl> # first prune <nl> prune . random_unstructured ( m , name , amount = 0 . 5 ) <nl> self . assertIn ( name + " _orig " , dict ( m . named_parameters ( ) ) ) <nl> def test_remove_pruning_exception ( self ) : <nl> <nl> for m in modules : <nl> for name in names : <nl> - with self . _compatible_subtest ( m = m , name = name ) : <nl> + with self . subTest ( m = m , name = name ) : <nl> # check that the module isn ' t pruned <nl> self . assertFalse ( prune . is_pruned ( m ) ) <nl> # since it isn ' t pruned , pruning can ' t be removed from it <nl> def test_pruning_rollback ( self ) : <nl> <nl> for m in modules : <nl> for name in names : <nl> - with self . _compatible_subtest ( m = m , name = name ) : <nl> + with self . subTest ( m = m , name = name ) : <nl> <nl> with mock . patch ( <nl> " torch . nn . utils . prune . L1Unstructured . compute_mask " <nl>
Remove _compatible_subtest ( )
pytorch/pytorch
d060deb5bb62fdd6e7b7624d7673455630aac1eb
2020-05-14T17:07:48Z
mmm a / src / mongo / db / query / query_planner . cpp <nl> ppp b / src / mongo / db / query / query_planner . cpp <nl> Status QueryPlanner : : plan ( const CanonicalQuery & query , <nl> continue ; <nl> } <nl> <nl> + / / If the index collation differs from the query collation , the index should not be <nl> + / / used to provide a sort , because strings will be ordered incorrectly . <nl> + if ( ! CollatorInterface : : collatorsMatch ( index . collator , query . getCollator ( ) ) ) { <nl> + continue ; <nl> + } <nl> + <nl> / / Partial indexes can only be used to provide a sort only if the query predicate is <nl> / / compatible . <nl> if ( index . filterExpr & & ! expression : : isSubsetOf ( query . root ( ) , index . filterExpr ) ) { <nl>
SERVER - 23618 Fix bad rebase in 0d2f72f5471f7c0f283ceea314c48d2e25d7d556
mongodb/mongo
656480dfdb308884868a23ac41f9708b1b376431
2016-06-02T18:37:16Z
mmm a / utils / build - windows . bat <nl> ppp b / utils / build - windows . bat <nl> call : build_lldb % exitOnError % <nl> <nl> call : build_libdispatch % exitOnError % <nl> <nl> - path % source_root % \ icu - % icu_version % \ bin64 ; % install_directory % \ bin ; % build_root % \ swift \ bin ; % build_root % \ swift \ libdispatch - prefix \ bin ; % PATH % ; % ProgramFiles % \ Git \ usr \ bin <nl> + path % source_root % \ icu - % icu_version % \ bin64 ; % install_directory % \ bin ; % build_root % \ swift \ bin ; % build_root % \ swift \ libdispatch - prefix \ bin ; % PATH % ; C : \ Program Files \ Git \ usr \ bin <nl> call : test_swift % exitOnError % <nl> call : test_libdispatch % exitOnError % <nl> <nl> set file_name = icu4c - % icu_version % - Win64 - MSVC2017 . zip <nl> curl - L - O " https : / / github . com / unicode - org / icu / releases / download / release - % icu_version_dashed % / % file_name % " % exitOnError % <nl> : : unzip warns about the paths in the zip using slashes , which raises the <nl> : : errorLevel to 1 . We cannot use exitOnError , and have to ignore errors . <nl> - " % ProgramFiles % \ Git \ usr \ bin \ unzip . exe " - o % file_name % - d " % source_root % \ icu - % icu_version % " <nl> + " C : \ Program Files \ Git \ usr \ bin \ unzip . exe " - o % file_name % - d " % source_root % \ icu - % icu_version % " <nl> exit / b 0 <nl> <nl> goto : eof <nl> setlocal enableextensions enabledelayedexpansion <nl> <nl> set file_name = sqlite - amalgamation - 3270200 . zip <nl> curl - L - O " https : / / www . sqlite . org / 2019 / % file_name % " % exitOnError % <nl> - " % ProgramFiles % \ Git \ usr \ bin \ unzip . exe " - o % file_name % % exitOnError % <nl> + " C : \ Program Files \ Git \ usr \ bin \ unzip . exe " - o % file_name % % exitOnError % <nl> <nl> goto : eof <nl> endlocal <nl>
Merge remote - tracking branch ' origin / master ' into master - rebranch
apple/swift
6c8388f474405cdcf7f584f982ea45c78243487e
2020-02-08T09:23:28Z
mmm a / arangod / SkipLists / compare . h <nl> ppp b / arangod / SkipLists / compare . h <nl> static int attributeWeightCompareFunction ( const void * leftItem , const void * righ <nl> static int CompareShapeTypes ( const TRI_shaped_json_t * left , const TRI_shaped_json_t * right , TRI_shaper_t * leftShaper , TRI_shaper_t * rightShaper ) { <nl> <nl> int result ; <nl> + int i ; <nl> size_t j ; <nl> TRI_shape_type_t leftType ; <nl> TRI_shape_type_t rightType ; <nl> static int CompareShapeTypes ( const TRI_shaped_json_t * left , const TRI_shaped_js <nl> <nl> numWeightedList = ( leftNumWeightedList < rightNumWeightedList ? leftNumWeightedList : rightNumWeightedList ) ; <nl> <nl> - for ( j = 0 ; j < numWeightedList ; + + j ) { <nl> + for ( i = 0 ; i < numWeightedList ; + + i ) { <nl> <nl> - if ( leftWeightedList [ j ] . _weight ! = rightWeightedList [ j ] . _weight ) { <nl> - result = ( leftWeightedList [ j ] . _weight < rightWeightedList [ j ] . _weight ? - 1 : 1 ) ; <nl> + if ( leftWeightedList [ i ] . _weight ! = rightWeightedList [ i ] . _weight ) { <nl> + result = ( leftWeightedList [ i ] . _weight < rightWeightedList [ i ] . _weight ? - 1 : 1 ) ; <nl> break ; <nl> } <nl> <nl> - result = CompareShapeTypes ( & ( leftWeightedList [ j ] . _value ) , & ( rightWeightedList [ j ] . _value ) , leftShaper , rightShaper ) ; <nl> + result = CompareShapeTypes ( & ( leftWeightedList [ i ] . _value ) , & ( rightWeightedList [ i ] . _value ) , leftShaper , rightShaper ) ; <nl> if ( result ! = 0 ) { <nl> break ; <nl> } <nl> <nl> / / the attributes are equal now check for the values <nl> / * start oreste debug <nl> - const char * name = leftShaper - > lookupAttributeId ( leftShaper , leftWeightedList [ j ] . _aid ) ; <nl> - printf ( " % s : % u : w = % ld : % s \ n " , __FILE__ , __LINE__ , leftWeightedList [ j ] . _weight , name ) ; <nl> - const char * name = rightShaper - > lookupAttributeId ( rightShaper , rightWeightedList [ j ] . _aid ) ; <nl> - printf ( " % s : % u : w = % ld : % s \ n " , __FILE__ , __LINE__ , rightWeightedList [ j ] . _weight , name ) ; <nl> + const char * name = leftShaper - > lookupAttributeId ( leftShaper , leftWeightedList [ i ] . _aid ) ; <nl> + printf ( " % s : % u : w = % ld : % s \ n " , __FILE__ , __LINE__ , leftWeightedList [ i ] . _weight , name ) ; <nl> + const char * name = rightShaper - > lookupAttributeId ( rightShaper , rightWeightedList [ i ] . _aid ) ; <nl> + printf ( " % s : % u : w = % ld : % s \ n " , __FILE__ , __LINE__ , rightWeightedList [ i ] . _weight , name ) ; <nl> end oreste debug * / <nl> } <nl> <nl> mmm a / arangod / VocBase / index . c <nl> ppp b / arangod / VocBase / index . c <nl> static int FillLookupSLOperator ( TRI_index_operator_t * slOperator , TRI_primary_co <nl> } <nl> <nl> / / check and see that entries are non - increasing <nl> - if ( jsonObject - > _value . _objects . _length > maxEntries ) { <nl> + if ( ( int ) jsonObject - > _value . _objects . _length > maxEntries ) { <nl> if ( maxEntries > 0 ) { <nl> result = - 3 ; <nl> break ; <nl> mmm a / lib / BasicsC / csv . c <nl> ppp b / lib / BasicsC / csv . c <nl> int TRI_ParseCsvString2 ( TRI_csv_parser_t * parser , char const * line , size_t leng <nl> <nl> / / check for separator <nl> checkLength = parser - > _separatorLength ; <nl> - if ( parser - > _stop - ptr > = checkLength ) { <nl> + if ( ( size_t ) ( parser - > _stop - ptr ) > = checkLength ) { <nl> / / must have at least as much chars as length of separator <nl> if ( 0 = = memcmp ( ptr , parser - > _separator , checkLength ) ) { <nl> / / found separator <nl> int TRI_ParseCsvString2 ( TRI_csv_parser_t * parser , char const * line , size_t leng <nl> <nl> / / check for eol <nl> checkLength = parser - > _eolLength ; <nl> - if ( parser - > _stop - ptr > = checkLength ) { <nl> + if ( ( size_t ) ( parser - > _stop - ptr ) > = checkLength ) { <nl> / / must have at least as much chars as length of eol <nl> if ( 0 = = memcmp ( ptr , parser - > _eol , checkLength ) ) { <nl> / / found eol <nl> int TRI_ParseCsvString2 ( TRI_csv_parser_t * parser , char const * line , size_t leng <nl> <nl> / / check for separator <nl> checkLength = parser - > _separatorLength ; <nl> - if ( parser - > _stop - ptr > = checkLength ) { <nl> + if ( ( size_t ) ( parser - > _stop - ptr ) > = checkLength ) { <nl> / / must have at least as much chars as length of separator <nl> if ( 0 = = memcmp ( ptr , parser - > _separator , checkLength ) ) { <nl> / / found separator <nl> int TRI_ParseCsvString2 ( TRI_csv_parser_t * parser , char const * line , size_t leng <nl> <nl> / / check for eol <nl> checkLength = parser - > _eolLength ; <nl> - if ( parser - > _stop - ptr > = checkLength ) { <nl> + if ( ( size_t ) ( parser - > _stop - ptr ) > = checkLength ) { <nl> / / must have at least as much chars as length of eol <nl> if ( 0 = = memcmp ( ptr , parser - > _eol , checkLength ) ) { <nl> / / found eol <nl> mmm a / lib / BasicsC / string - buffer . c <nl> ppp b / lib / BasicsC / string - buffer . c <nl> static void AppendChar ( TRI_string_buffer_t * self , char chr ) { <nl> / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> <nl> static size_t Remaining ( TRI_string_buffer_t * self ) { <nl> - return ( size_t ) ( self - > _len - ( self - > _current - self - > _buffer ) ) ; <nl> + return ( size_t ) ( self - > _len - ( size_t ) ( self - > _current - self - > _buffer ) ) ; <nl> } <nl> <nl> / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> char const * TRI_EndStringBuffer ( TRI_string_buffer_t const * self ) { <nl> / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> <nl> size_t TRI_LengthStringBuffer ( TRI_string_buffer_t const * self ) { <nl> - return self - > _current - self - > _buffer ; <nl> + return ( size_t ) ( self - > _current - self - > _buffer ) ; <nl> } <nl> <nl> / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl>
cppcheck
arangodb/arangodb
669fe4275a6fa28c54935d319f9a1bdb36a8e97d
2012-12-18T15:44:06Z
mmm a / stdlib / public / core / StaticString . swift <nl> ppp b / stdlib / public / core / StaticString . swift <nl> <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> - / / Copyright ( c ) 2014 - 2017 Apple Inc . and the Swift project authors <nl> + / / Copyright ( c ) 2014 - 2020 Apple Inc . and the Swift project authors <nl> / / Licensed under Apache License v2 . 0 with Runtime Library Exception <nl> / / <nl> / / See https : / / swift . org / LICENSE . txt for license information <nl> <nl> <nl> / / / A string type designed to represent text that is known at compile time . <nl> / / / <nl> - / / / Instances of the ` StaticString ` type are immutable . ` StaticString ` provides <nl> - / / / limited , pointer - based access to its contents , unlike Swift ' s more <nl> - / / / commonly used ` String ` type . A static string can store its value as a <nl> - / / / pointer to an ASCII code unit sequence , as a pointer to a UTF - 8 code unit <nl> - / / / sequence , or as a single Unicode scalar value . <nl> + / / / Instances of the ` StaticString ` type are immutable . <nl> + / / / <nl> + / / / ` StaticString ` provides only low - level access to its contents , unlike <nl> + / / / Swift ' s more commonly used ` String ` type . A static string can use <nl> + / / / either of the following as its storage : <nl> + / / / <nl> + / / / * a pointer to a null - terminated sequence of UTF - 8 code units : <nl> + / / / <nl> + / / / let emoji : StaticString = " \ u { 1F600 } " <nl> + / / / emoji . hasPointerRepresentation / / - > true <nl> + / / / emoji . isASCII / / - > false <nl> + / / / emoji . unicodeScalar / / - > Fatal error ! <nl> + / / / emoji . utf8CodeUnitCount / / - > 4 <nl> + / / / emoji . utf8Start [ 0 ] / / - > 0xF0 <nl> + / / / emoji . utf8Start [ 1 ] / / - > 0x9F <nl> + / / / emoji . utf8Start [ 2 ] / / - > 0x98 <nl> + / / / emoji . utf8Start [ 3 ] / / - > 0x80 <nl> + / / / emoji . utf8Start [ 4 ] / / - > 0x00 <nl> + / / / <nl> + / / / * a single Unicode scalar value , under very limited circumstances : <nl> + / / / <nl> + / / / struct MyStaticScalar : ExpressibleByUnicodeScalarLiteral { <nl> + / / / typealias UnicodeScalarLiteralType = StaticString <nl> + / / / let value : StaticString <nl> + / / / init ( unicodeScalarLiteral value : StaticString ) { <nl> + / / / self . value = value <nl> + / / / } <nl> + / / / } <nl> + / / / <nl> + / / / let emoji : StaticString = MyStaticScalar ( " \ u { 1F600 } " ) . value <nl> + / / / emoji . hasPointerRepresentation / / - > false <nl> + / / / emoji . isASCII / / - > false <nl> + / / / emoji . unicodeScalar . value / / - > 0x1F600 <nl> + / / / emoji . utf8CodeUnitCount / / - > Fatal error ! <nl> + / / / emoji . utf8Start / / - > Fatal error ! <nl> + / / / <nl> + / / / You can use the ` withUTF8Buffer ( _ : ) ` method to access a static string ' s <nl> + / / / contents , regardless of which representation the static string uses . <nl> + / / / <nl> + / / / emoji . withUTF8Buffer { utf8 in <nl> + / / / utf8 . count / / - > 4 <nl> + / / / utf8 [ 0 ] / / - > 0xF0 <nl> + / / / utf8 [ 1 ] / / - > 0x9F <nl> + / / / utf8 [ 2 ] / / - > 0x98 <nl> + / / / utf8 [ 3 ] / / - > 0x80 <nl> + / / / utf8 [ 4 ] / / - > Fatal error ! <nl> + / / / } <nl> @ frozen <nl> public struct StaticString <nl> : _ExpressibleByBuiltinUnicodeScalarLiteral , <nl> public struct StaticString <nl> internal var _startPtrOrData : Builtin . Word <nl> <nl> / / / If ` _startPtrOrData ` is a pointer , contains the length of the UTF - 8 data <nl> - / / / in bytes . <nl> + / / / in bytes ( excluding the null terminator ) . <nl> @ usableFromInline <nl> internal var _utf8CodeUnitCount : Builtin . Word <nl> <nl> public struct StaticString <nl> / / / - bit 0 : set to 0 if ` _startPtrOrData ` is a pointer , or to 1 if it is a <nl> / / / Unicode scalar . <nl> / / / <nl> - / / / - bit 1 : set to 1 if ` _startPtrOrData ` is a pointer and string data is <nl> - / / / ASCII . <nl> + / / / - bit 1 : set to 1 if ` _startPtrOrData ` either points to an ASCII code unit <nl> + / / / sequence , or stores an ASCII scalar value . <nl> @ usableFromInline <nl> internal var _flags : Builtin . Int8 <nl> <nl> - / / / A pointer to the beginning of the string ' s UTF - 8 encoded representation . <nl> + / / / A pointer to a null - terminated sequence of UTF - 8 code units . <nl> / / / <nl> - / / / The static string must store a pointer to either ASCII or UTF - 8 code <nl> - / / / units . Accessing this property when ` hasPointerRepresentation ` is <nl> - / / / ` false ` triggers a runtime error . <nl> + / / / - Important : Accessing this property when ` hasPointerRepresentation ` is <nl> + / / / ` false ` triggers a runtime error . <nl> @ _transparent <nl> public var utf8Start : UnsafePointer < UInt8 > { <nl> _precondition ( <nl> public struct StaticString <nl> return UnsafePointer ( bitPattern : UInt ( _startPtrOrData ) ) ! <nl> } <nl> <nl> - / / / The stored Unicode scalar value . <nl> + / / / A single Unicode scalar value . <nl> / / / <nl> - / / / The static string must store a single Unicode scalar value . Accessing <nl> - / / / this property when ` hasPointerRepresentation ` is ` true ` triggers a <nl> - / / / runtime error . <nl> + / / / - Important : Accessing this property when ` hasPointerRepresentation ` is <nl> + / / / ` true ` triggers a runtime error . <nl> @ _transparent <nl> public var unicodeScalar : Unicode . Scalar { <nl> _precondition ( <nl> public struct StaticString <nl> return Unicode . Scalar ( UInt32 ( UInt ( _startPtrOrData ) ) ) ! <nl> } <nl> <nl> - / / / The length in bytes of the static string ' s ASCII or UTF - 8 representation . <nl> + / / / The number of UTF - 8 code units ( excluding the null terminator ) . <nl> / / / <nl> - / / / - Warning : If the static string stores a single Unicode scalar value , the <nl> - / / / value of ` utf8CodeUnitCount ` is unspecified . <nl> + / / / - Important : Accessing this property when ` hasPointerRepresentation ` is <nl> + / / / ` false ` triggers a runtime error . <nl> @ _transparent <nl> public var utf8CodeUnitCount : Int { <nl> _precondition ( <nl> public struct StaticString <nl> return Builtin . inttoptr_Word ( _startPtrOrData ) <nl> } <nl> <nl> - / / / A Boolean value indicating whether the static string stores a pointer to <nl> - / / / ASCII or UTF - 8 code units . <nl> + / / / A Boolean value that indicates whether the static string stores a <nl> + / / / pointer to a null - terminated sequence of UTF - 8 code units . <nl> + / / / <nl> + / / / If ` hasPointerRepresentation ` is ` false ` , the static string stores a <nl> + / / / single Unicode scalar value . <nl> @ _transparent <nl> public var hasPointerRepresentation : Bool { <nl> return ( UInt8 ( _flags ) & 0x1 ) = = 0 <nl> } <nl> <nl> - / / / A Boolean value that is ` true ` if the static string stores a pointer to <nl> - / / / ASCII code units . <nl> - / / / <nl> - / / / Use this property in conjunction with ` hasPointerRepresentation ` to <nl> - / / / determine whether a static string with pointer representation stores an <nl> - / / / ASCII or UTF - 8 code unit sequence . <nl> - / / / <nl> - / / / - Warning : If the static string stores a single Unicode scalar value , the <nl> - / / / value of ` isASCII ` is unspecified . <nl> + / / / A Boolean value that indicates whether the static string represents only <nl> + / / / ASCII code units ( or an ASCII scalar value ) . <nl> @ _transparent <nl> public var isASCII : Bool { <nl> return ( UInt8 ( _flags ) & 0x2 ) ! = 0 <nl> } <nl> <nl> / / / Invokes the given closure with a buffer containing the static string ' s <nl> - / / / UTF - 8 code unit sequence . <nl> + / / / UTF - 8 code unit sequence ( excluding the null terminator ) . <nl> / / / <nl> / / / This method works regardless of whether the static string stores a <nl> / / / pointer or a single Unicode scalar value . <nl> public struct StaticString <nl> / / / - Parameter body : A closure that takes a buffer pointer to the static <nl> / / / string ' s UTF - 8 code unit sequence as its sole argument . If the closure <nl> / / / has a return value , that value is also used as the return value of the <nl> - / / / ` withUTF8Buffer ( invoke : ) ` method . The pointer argument is valid only <nl> - / / / for the duration of the method ' s execution . <nl> + / / / ` withUTF8Buffer ( _ : ) ` method . The pointer argument is valid only for the <nl> + / / / duration of the method ' s execution . <nl> / / / - Returns : The return value , if any , of the ` body ` closure . <nl> @ _transparent <nl> public func withUTF8Buffer < R > ( <nl> - _ body : ( UnsafeBufferPointer < UInt8 > ) - > R ) - > R { <nl> + _ body : ( UnsafeBufferPointer < UInt8 > ) - > R <nl> + ) - > R { <nl> if hasPointerRepresentation { <nl> return body ( UnsafeBufferPointer ( <nl> start : utf8Start , count : utf8CodeUnitCount ) ) <nl> public struct StaticString <nl> self = value <nl> } <nl> <nl> - / / / A string representation of the static string . <nl> + / / / A textual representation of the static string . <nl> public var description : String { <nl> return withUTF8Buffer { String . _uncheckedFromUTF8 ( $ 0 ) } <nl> } <nl> mmm a / test / stdlib / StaticString . swift <nl> ppp b / test / stdlib / StaticString . swift <nl> var StaticStringTestSuite = TestSuite ( " StaticString " ) <nl> <nl> StaticStringTestSuite . test ( " PointerRepresentation / ASCII / Empty " ) { <nl> let str = StaticString ( ) <nl> + expectEqual ( 0x00 , str . utf8Start [ 0 ] ) <nl> expectEqual ( 0 , str . utf8CodeUnitCount ) <nl> expectTrue ( str . hasPointerRepresentation ) <nl> expectTrue ( str . isASCII ) <nl> StaticStringTestSuite . test ( " PointerRepresentation / ASCII " ) { <nl> expectEqual ( 0x61 , str . utf8Start [ 0 ] ) <nl> expectEqual ( 0x62 , str . utf8Start [ 1 ] ) <nl> expectEqual ( 0x63 , str . utf8Start [ 2 ] ) <nl> + expectEqual ( 0x00 , str . utf8Start [ 3 ] ) <nl> expectEqual ( 3 , str . utf8CodeUnitCount ) <nl> expectTrue ( str . hasPointerRepresentation ) <nl> expectTrue ( str . isASCII ) <nl> StaticStringTestSuite . test ( " PointerRepresentation / NonASCII " ) { <nl> expectEqual ( 0xb1 , str . utf8Start [ 3 ] ) <nl> expectEqual ( 0xd0 , str . utf8Start [ 4 ] ) <nl> expectEqual ( 0xb2 , str . utf8Start [ 5 ] ) <nl> + expectEqual ( 0x00 , str . utf8Start [ 6 ] ) <nl> expectEqual ( 6 , str . utf8CodeUnitCount ) <nl> expectTrue ( str . hasPointerRepresentation ) <nl> expectFalse ( str . isASCII ) <nl>
Merge pull request from benrimmington / static - string - documentation
apple/swift
e5110d795378cbf4c84d97176784ad959bf3341c
2020-03-27T23:36:13Z
mmm a / tools / depends / Makefile . include . in <nl> ppp b / tools / depends / Makefile . include . in <nl> CROSS_COMPILING = @ cross_compiling @ <nl> ARCH_DEFINES = @ ARCH_DEFINES @ <nl> NATIVE_ARCH_DEFINES = @ NATIVE_ARCH_DEFINES @ <nl> TARGET_PLATFORM = @ target_platform @ <nl> - XCODE_VERSION = @ use_xcode @ <nl> AAPT = @ AAPT @ <nl> DX = @ DX @ <nl> ZIPALIGN = @ ZIPALIGN @ <nl> mmm a / tools / depends / configure . ac <nl> ppp b / tools / depends / configure . ac <nl> case $ host in <nl> native_platform_min_version = - mmacosx - version - min = ` sw_vers | grep ProductVersion | sed - E " s / . * : . * ( 10 \ . . * ) \ . ? . * / \ 1 / " ` <nl> use_xcodepath = ` xcode - select - print - path ` <nl> use_xcodebuild = $ use_xcodepath / usr / bin / xcodebuild <nl> - use_xcode = [ ` $ use_xcodebuild - version | grep Xcode | awk ' { print $ 2 } ' ` ] <nl> AC_MSG_RESULT ( found xcodebuild at $ use_xcodebuild ) <nl> use_build_toolchain = $ use_xcodepath <nl> + use_toolchain = " $ { use_xcodepath } / Toolchains / XcodeDefault . xctoolchain " <nl> <nl> # darwin builds are always cross <nl> cross_compiling = " yes " <nl> <nl> - platform_cflags = " - std = gnu99 - no_compact_linkedit - no - cpp - precomp " <nl> - platform_ldflags = " - Wl , - search_paths_first - no_compact_linkedit " <nl> - platform_cxxflags = " - no_compact_linkedit - no - cpp - precomp " <nl> + platform_cc = clang <nl> + platform_cxx = clang + + <nl> + platform_cflags = " - fheinous - gnu - extensions - no - cpp - precomp " <nl> + platform_ldflags = " - Wl , - search_paths_first " <nl> + platform_cxxflags = " - no - cpp - precomp " <nl> <nl> - case $ use_xcode in <nl> - 4 . * | 4 . * . * ) <nl> - platform_cc = llvm - gcc - 4 . 2 <nl> - platform_cxx = llvm - g + + - 4 . 2 <nl> - ; ; <nl> - * ) <nl> - platform_cc = clang <nl> - platform_cxx = clang + + <nl> - platform_cflags = " - fheinous - gnu - extensions - no - cpp - precomp " <nl> - platform_ldflags = " - Wl , - search_paths_first " <nl> - platform_cxxflags = " - no - cpp - precomp " <nl> - ; ; <nl> - esac <nl> case $ host in <nl> * 86 * - apple - darwin ) <nl> MC_CHECK_NOT_CPU ( [ $ use_cpu ] , " arm " ) <nl> case $ host in <nl> <nl> use_sdk_path = [ ` $ use_xcodebuild - version - sdk $ sdk_name Path ` ] <nl> platform_os = " osx " <nl> - <nl> - # find the matching toolchain <nl> - case $ use_xcode in <nl> - 5 . * | 5 . * . * ) <nl> - use_toolchain = " $ { use_xcodepath } / Toolchains / XcodeDefault . xctoolchain " <nl> - ; ; <nl> - * ) <nl> - use_toolchain = " $ { use_toolchain : - $ use_xcodepath } " <nl> - ; ; <nl> - esac <nl> ; ; <nl> <nl> arm - apple - darwin * ) <nl> case $ host in <nl> ; ; <nl> esac <nl> <nl> - use_toolchain = " $ { use_xcodepath } / Toolchains / XcodeDefault . xctoolchain " <nl> - <nl> platform_os = " ios " <nl> <nl> if [ ! test " x $ use_cpu " = " xarm64 " ] ; then <nl> AC_SUBST ( has_zlib ) <nl> AC_SUBST ( link_iconv ) <nl> AC_SUBST ( need_libiconv ) <nl> AC_SUBST ( use_gplv3 ) <nl> - AC_SUBST ( use_xcode ) <nl> AC_SUBST ( use_ccache ) <nl> AC_SUBST ( native_platform_min_version ) <nl> AC_SUBST ( app_rendersystem ) <nl> mmm a / tools / depends / target / config - binaddons . site . in <nl> ppp b / tools / depends / target / config - binaddons . site . in <nl> if test " @ platform_os @ " = " ios " ; then <nl> ac_cv_func_clock_gettime = no <nl> ac_cv_func_getentropy = no <nl> <nl> - # tweaks for libffi ( ios must use llvm - gcc - 4 . 2 ) <nl> - if test " $ { PACKAGE_NAME } " = " libffi " ; then <nl> - case " @ use_xcode @ " in <nl> - 4 . * | 4 . * . * ) <nl> - export CC = " @ use_toolchain @ / usr / bin / llvm - gcc - 4 . 2 " <nl> - export CPP = " @ use_toolchain @ / usr / bin / llvm - gcc - 4 . 2 - E " <nl> - ; ; <nl> - * ) <nl> - export CC = " @ use_toolchain @ / usr / bin / clang " <nl> - export CPP = " @ use_toolchain @ / usr / bin / clang - E " <nl> - ; ; <nl> - esac <nl> - unset AS <nl> - unset CCAS <nl> - fi <nl> - <nl> # tweaks for flac <nl> if test " $ { ac_unique_file } " = " src / flac / main . c " ; then <nl> # compiler barfs if we use - O3 / O2 for flac <nl> mmm a / tools / depends / target / config . site . in <nl> ppp b / tools / depends / target / config . site . in <nl> if test " @ platform_os @ " = " ios " ; then <nl> ac_cv_func_clock_gettime = no <nl> ac_cv_func_getentropy = no <nl> <nl> - # tweaks for libffi ( ios must use llvm - gcc - 4 . 2 ) <nl> + # tweaks for libffi <nl> if test " $ { PACKAGE_NAME } " = " libffi " ; then <nl> - case " @ use_xcode @ " in <nl> - 4 . * | 4 . * . * ) <nl> - export CC = " @ use_toolchain @ / usr / bin / llvm - gcc - 4 . 2 " <nl> - export CPP = " @ use_toolchain @ / usr / bin / llvm - gcc - 4 . 2 - E " <nl> - ; ; <nl> - * ) <nl> - export CC = " @ use_toolchain @ / usr / bin / clang " <nl> - export CPP = " @ use_toolchain @ / usr / bin / clang - E " <nl> - ; ; <nl> - esac <nl> - <nl> if test " @ use_cpu @ " = " arm64 " ; then <nl> - host = aarch64 - apple - darwin <nl> host_alias = aarch64 - apple - darwin <nl> - fi <nl> - <nl> - unset AS <nl> - unset CCAS <nl> + fi <nl> fi <nl> <nl> # tweaks for flac <nl> mmm a / tools / depends / target / gmp / Makefile <nl> ppp b / tools / depends / target / gmp / Makefile <nl> ifeq ( $ ( OS ) , linux ) <nl> endif <nl> <nl> ifeq ( $ ( OS ) , ios ) <nl> - CONFIGURE_FLAGS = CC_FOR_BUILD = llvm - gcc CPP_FOR_BUILD = " llvm - gcc - E " - - disable - assembly <nl> + CONFIGURE_FLAGS = - - disable - assembly <nl> endif <nl> ifeq ( $ ( OS ) , osx ) <nl> CONFIGURE_FLAGS = - - with - pic <nl> endif <nl> ifeq ( $ ( OS ) , android ) <nl> CONFIGURE_FLAGS = - - with - pic <nl> endif <nl> + ifeq ( $ ( NATIVE_OS ) , osx ) <nl> + CONFIGURE_FLAGS + = CC_FOR_BUILD = " $ ( CC_FOR_BUILD ) " CPP_FOR_BUILD = " $ ( CC_FOR_BUILD ) - E " <nl> + endif <nl> <nl> # configuration settings <nl> CONFIGURE = cp - f $ ( CONFIG_SUB ) $ ( CONFIG_GUESS ) . ; \ <nl>
[ depends ] [ cleanup ] remove handling for unsupported Xcode versions
xbmc/xbmc
cdec2cbbdc5a8755e6eb2e7ac0d6913285a59cf5
2018-04-26T10:00:00Z
mmm a / buildscripts / resmokeconfig / suites / integration_tests_replset . yml <nl> ppp b / buildscripts / resmokeconfig / suites / integration_tests_replset . yml <nl> selector : <nl> exclude_files : <nl> - build / * * / mongo / client / client_dbclient_connection_integration_test * # Needs connection to single host . <nl> - build / install / bin / client_dbclient_connection_integration_test * # Needs connection to single host . <nl> + - build / * * / network_interface_ssl_test * # Requires SSL <nl> <nl> executor : <nl> archive : <nl> deleted file mode 100644 <nl> index fff837dee675 . . 000000000000 <nl> mmm a / buildscripts / resmokeconfig / suites / integration_tests_replset_ssl . yml <nl> ppp / dev / null <nl> <nl> - # This suite is a clone of buildscripts / resmokeconfig / suites / integration_tests_replset . yml <nl> - # with TLS options added . The inclusion and exclusion lists are expected to be similar . <nl> - test_kind : cpp_integration_test <nl> - <nl> - selector : <nl> - root : build / integration_tests . txt <nl> - exclude_files : <nl> - - build / * * / mongo / client / client_dbclient_connection_integration_test * # Needs connection to single host . <nl> - - build / install / bin / client_dbclient_connection_integration_test * # Needs connection to single host . <nl> - <nl> - executor : <nl> - archive : <nl> - hooks : <nl> - - CheckReplDBHash <nl> - - CheckReplOplogs <nl> - - ValidateCollections <nl> - config : { } <nl> - hooks : <nl> - # The CheckReplDBHash hook waits until all operations have replicated to and have been applied <nl> - # on the secondaries , so we run the ValidateCollections hook after it to ensure we ' re <nl> - # validating the entire contents of the collection . <nl> - - class : CheckReplOplogs <nl> - - class : CheckReplDBHash <nl> - - class : ValidateCollections <nl> - fixture : <nl> - class : ReplicaSetFixture <nl> - mongod_options : <nl> - set_parameters : <nl> - logComponentVerbosity : <nl> - command : 2 <nl> - enableTestCommands : 1 <nl> - tlsMode : preferTLS <nl> - tlsCAFile : jstests / libs / ca . pem <nl> - tlsCertificateKeyFile : jstests / libs / server . pem <nl> - num_nodes : 2 <nl> new file mode 100644 <nl> index 000000000000 . . c1f4e092f60c <nl> mmm / dev / null <nl> ppp b / buildscripts / resmokeconfig / suites / integration_tests_replset_ssl_auth . yml <nl> <nl> + # This is a suite for TLS only and auth <nl> + test_kind : cpp_integration_test <nl> + <nl> + selector : <nl> + root : build / integration_tests . txt <nl> + include_files : <nl> + - build / * * / network_interface_ssl_test <nl> + - build / install / bin / network_interface_ssl_test <nl> + <nl> + config_variables : <nl> + - & keyFile jstests / libs / authTestsKey <nl> + - & keyFileData Thiskeyisonlyforrunningthesuitewithauthenticationdontuseitinanytestsdirectly <nl> + - & authOptions <nl> + authenticationDatabase : admin <nl> + authenticationMechanism : SCRAM - SHA - 1 <nl> + password : * keyFileData <nl> + username : __system <nl> + - TestData : & TestData <nl> + auth : true <nl> + authMechanism : SCRAM - SHA - 1 <nl> + keyFile : * keyFile <nl> + keyFileData : * keyFileData <nl> + <nl> + executor : <nl> + archive : <nl> + hooks : <nl> + - ValidateCollections <nl> + config : { } <nl> + hooks : <nl> + # The CheckReplDBHash hook waits until all operations have replicated to and have been applied <nl> + # on the secondaries , so we run the ValidateCollections hook after it to ensure we ' re <nl> + # validating the entire contents of the collection . <nl> + - class : CheckReplOplogs <nl> + shell_options : <nl> + global_vars : <nl> + TestData : * TestData <nl> + eval : jsTest . authenticate ( db . getMongo ( ) ) <nl> + < < : * authOptions <nl> + - class : CheckReplDBHash <nl> + shell_options : <nl> + global_vars : <nl> + TestData : * TestData <nl> + eval : jsTest . authenticate ( db . getMongo ( ) ) <nl> + < < : * authOptions <nl> + - class : ValidateCollections <nl> + fixture : <nl> + class : ReplicaSetFixture <nl> + mongod_options : <nl> + set_parameters : <nl> + logComponentVerbosity : <nl> + command : 2 <nl> + enableTestCommands : 1 <nl> + tlsMode : preferTLS <nl> + tlsCAFile : jstests / libs / ca . pem <nl> + tlsCertificateKeyFile : jstests / libs / server . pem <nl> + keyFile : * keyFile <nl> + clusterAuthMode : sendX509 <nl> + auth : ' ' <nl> + num_nodes : 2 <nl> + auth_options : <nl> + < < : * authOptions <nl> mmm a / buildscripts / resmokeconfig / suites / integration_tests_sharded . yml <nl> ppp b / buildscripts / resmokeconfig / suites / integration_tests_sharded . yml <nl> selector : <nl> exclude_files : <nl> - build / * * / mongo / client / client_dbclient_connection_integration_test * # Needs sleep command <nl> - build / install / bin / client_dbclient_connection_integration_test * # Needs sleep command <nl> + - build / * * / network_interface_ssl_test * # Requires SSL <nl> <nl> executor : <nl> archive : <nl> mmm a / buildscripts / resmokeconfig / suites / integration_tests_standalone . yml <nl> ppp b / buildscripts / resmokeconfig / suites / integration_tests_standalone . yml <nl> selector : <nl> exclude_files : <nl> # Tests replica set monitor . <nl> - build / * * / replica_set_monitor_integration_test * <nl> + - build / * * / network_interface_ssl_test * # Requires SSL <nl> <nl> executor : <nl> archive : <nl> mmm a / buildscripts / resmokeconfig / suites / integration_tests_standalone_audit . yml <nl> ppp b / buildscripts / resmokeconfig / suites / integration_tests_standalone_audit . yml <nl> selector : <nl> exclude_files : <nl> # Tests replica set monitor . <nl> - build / * * / replica_set_monitor_integration_test * <nl> + - build / * * / network_interface_ssl_test * # Requires SSL <nl> <nl> executor : <nl> archive : <nl> mmm a / etc / evergreen . yml <nl> ppp b / etc / evergreen . yml <nl> tasks : <nl> vars : <nl> resmoke_args : - - suites = integration_tests_replset - - storageEngine = wiredTiger <nl> <nl> + - < < : * task_template <nl> + name : integration_tests_replset_ssl_auth <nl> + tags : [ " integration " ] <nl> + commands : <nl> + - command : manifest . load <nl> + - func : " git get project " <nl> + - func : " do setup " <nl> + - func : " set up win mount script " <nl> + - func : " generate compile expansions " # Generate compile expansions needs to be run to mount the shared scons cache . <nl> + - func : " apply compile expansions " <nl> + - func : " scons compile " <nl> + vars : <nl> + targets : install - integration - tests <nl> + compiling_for_test : true <nl> + bypass_compile : false <nl> + - func : " attach scons logs " <nl> + - func : " run tests " <nl> + vars : <nl> + resmoke_args : - - suites = integration_tests_replset_ssl_auth - - storageEngine = wiredTiger <nl> + <nl> - < < : * task_template <nl> name : integration_tests_sharded <nl> tags : [ " integration " , " sharded " ] <nl> mmm a / src / mongo / client / async_client . cpp <nl> ppp b / src / mongo / client / async_client . cpp <nl> Future < void > AsyncDBClient : : authenticate ( const BSONObj & params ) { <nl> return auth : : authenticateClient ( params , remote ( ) , clientName , _makeAuthRunCommandHook ( ) ) ; <nl> } <nl> <nl> - Future < void > AsyncDBClient : : authenticateInternal ( boost : : optional < std : : string > mechanismHint ) { <nl> + Future < void > AsyncDBClient : : authenticateInternal ( <nl> + boost : : optional < std : : string > mechanismHint , <nl> + std : : shared_ptr < auth : : InternalAuthParametersProvider > authProvider ) { <nl> / / If no internal auth information is set , don ' t bother trying to authenticate . <nl> if ( ! auth : : isInternalAuthSet ( ) ) { <nl> return Future < void > : : makeReady ( ) ; <nl> Future < void > AsyncDBClient : : authenticateInternal ( boost : : optional < std : : string > me <nl> return auth : : authenticateInternalClient ( clientName , <nl> mechanismHint , <nl> auth : : StepDownBehavior : : kKillConnection , <nl> - _makeAuthRunCommandHook ( ) ) ; <nl> + _makeAuthRunCommandHook ( ) , <nl> + std : : move ( authProvider ) ) ; <nl> } <nl> <nl> Future < bool > AsyncDBClient : : completeSpeculativeAuth ( std : : shared_ptr < SaslClientSession > session , <nl> mmm a / src / mongo / client / async_client . h <nl> ppp b / src / mongo / client / async_client . h <nl> class AsyncDBClient : public std : : enable_shared_from_this < AsyncDBClient > { <nl> <nl> Future < void > authenticate ( const BSONObj & params ) ; <nl> <nl> - Future < void > authenticateInternal ( boost : : optional < std : : string > mechanismHint ) ; <nl> + Future < void > authenticateInternal ( <nl> + boost : : optional < std : : string > mechanismHint , <nl> + std : : shared_ptr < auth : : InternalAuthParametersProvider > authProvider ) ; <nl> <nl> Future < bool > completeSpeculativeAuth ( std : : shared_ptr < SaslClientSession > session , <nl> std : : string authDB , <nl> mmm a / src / mongo / client / authenticate . cpp <nl> ppp b / src / mongo / client / authenticate . cpp <nl> <nl> <nl> # include " mongo / base / status . h " <nl> # include " mongo / base / status_with . h " <nl> + # include " mongo / bson / bsonobj . h " <nl> # include " mongo / bson / json . h " <nl> # include " mongo / bson / util / bson_extract . h " <nl> + # include " mongo / client / internal_auth . h " <nl> # include " mongo / client / sasl_client_authenticate . h " <nl> # include " mongo / config . h " <nl> # include " mongo / db / auth / authorization_manager . h " <nl> Future < void > authX509 ( RunCommandHook runCommand , const BSONObj & params , StringDa <nl> return runCommand ( authRequest . getValue ( ) ) . ignoreValue ( ) ; <nl> } <nl> <nl> + class DefaultInternalAuthParametersProvider : public InternalAuthParametersProvider { <nl> + public : <nl> + ~ DefaultInternalAuthParametersProvider ( ) = default ; <nl> + <nl> + BSONObj get ( size_t index , StringData mechanism ) final { <nl> + return getInternalAuthParams ( index , mechanism ) ; <nl> + } <nl> + } ; <nl> + <nl> } / / namespace <nl> + <nl> + std : : shared_ptr < InternalAuthParametersProvider > createDefaultInternalAuthProvider ( ) { <nl> + return std : : make_shared < DefaultInternalAuthParametersProvider > ( ) ; <nl> + } <nl> + <nl> + <nl> / / <nl> / / General Auth <nl> / / <nl> Future < std : : string > negotiateSaslMechanism ( RunCommandHook runCommand , <nl> } ) ; <nl> } <nl> <nl> - Future < void > authenticateInternalClient ( const std : : string & clientSubjectName , <nl> - boost : : optional < std : : string > mechanismHint , <nl> - StepDownBehavior stepDownBehavior , <nl> - RunCommandHook runCommand ) { <nl> + Future < void > authenticateInternalClient ( <nl> + const std : : string & clientSubjectName , <nl> + boost : : optional < std : : string > mechanismHint , <nl> + StepDownBehavior stepDownBehavior , <nl> + RunCommandHook runCommand , <nl> + std : : shared_ptr < InternalAuthParametersProvider > internalParamsProvider ) { <nl> return negotiateSaslMechanism ( <nl> runCommand , internalSecurity . user - > getName ( ) , mechanismHint , stepDownBehavior ) <nl> - . then ( [ runCommand , clientSubjectName ] ( std : : string mechanism ) - > Future < void > { <nl> - auto params = getInternalAuthParams ( 0 , mechanism ) ; <nl> + . then ( [ runCommand , clientSubjectName , internalParamsProvider ] ( <nl> + std : : string mechanism ) - > Future < void > { <nl> + auto params = internalParamsProvider - > get ( 0 , mechanism ) ; <nl> if ( params . isEmpty ( ) ) { <nl> return Status ( ErrorCodes : : BadValue , <nl> " Missing authentication parameters for internal user auth " ) ; <nl> } <nl> return authenticateClient ( params , HostAndPort ( ) , clientSubjectName , runCommand ) <nl> . onError < ErrorCodes : : AuthenticationFailed > ( <nl> - [ runCommand , clientSubjectName , mechanism ] ( Status status ) - > Future < void > { <nl> - auto altCreds = getInternalAuthParams ( 1 , mechanism ) ; <nl> + [ runCommand , clientSubjectName , mechanism , internalParamsProvider ] ( <nl> + Status status ) - > Future < void > { <nl> + auto altCreds = internalParamsProvider - > get ( 1 , mechanism ) ; <nl> if ( ! altCreds . isEmpty ( ) ) { <nl> return authenticateClient ( <nl> altCreds , HostAndPort ( ) , clientSubjectName , runCommand ) ; <nl> mmm a / src / mongo / client / authenticate . h <nl> ppp b / src / mongo / client / authenticate . h <nl> constexpr auto kAuthenticateCommand = " authenticate " _sd ; <nl> * / <nl> enum class StepDownBehavior { kKillConnection , kKeepConnectionOpen } ; <nl> <nl> + / * * <nl> + * Provider of SASL credentials for internal authentication purposes . <nl> + * / <nl> + class InternalAuthParametersProvider { <nl> + public : <nl> + virtual ~ InternalAuthParametersProvider ( ) = default ; <nl> + <nl> + / * * <nl> + * Get the information for a given SASL mechanism . <nl> + * <nl> + * If there are multiple entries for a mechanism , suppots retrieval by index . Used when rotating <nl> + * the security key . <nl> + * / <nl> + virtual BSONObj get ( size_t index , StringData mechanism ) = 0 ; <nl> + } ; <nl> + <nl> + std : : shared_ptr < InternalAuthParametersProvider > createDefaultInternalAuthProvider ( ) ; <nl> + <nl> / * * <nl> * Authenticate a user . <nl> * <nl> Future < void > authenticateClient ( const BSONObj & params , <nl> * Because this may retry during cluster keyfile rollover , this may call the RunCommandHook more <nl> * than once , but will only call the AuthCompletionHandler once . <nl> * / <nl> - Future < void > authenticateInternalClient ( const std : : string & clientSubjectName , <nl> - boost : : optional < std : : string > mechanismHint , <nl> - StepDownBehavior stepDownBehavior , <nl> - RunCommandHook runCommand ) ; <nl> + Future < void > authenticateInternalClient ( <nl> + const std : : string & clientSubjectName , <nl> + boost : : optional < std : : string > mechanismHint , <nl> + StepDownBehavior stepDownBehavior , <nl> + RunCommandHook runCommand , <nl> + std : : shared_ptr < InternalAuthParametersProvider > internalParamsProvider ) ; <nl> <nl> / * * <nl> * Build a BSONObject representing parameters to be passed to authenticateClient ( ) . Takes <nl> mmm a / src / mongo / client / dbclient_base . cpp <nl> ppp b / src / mongo / client / dbclient_base . cpp <nl> Status DBClientBase : : authenticateInternalUser ( auth : : StepDownBehavior stepDownBeh <nl> } <nl> # endif <nl> <nl> - auto status = auth : : authenticateInternalClient ( <nl> - clientName , boost : : none , stepDownBehavior , _makeAuthRunCommandHook ( ) ) <nl> - . getNoThrow ( ) ; <nl> + auto authProvider = auth : : createDefaultInternalAuthProvider ( ) ; <nl> + auto status = <nl> + auth : : authenticateInternalClient ( <nl> + clientName , boost : : none , stepDownBehavior , _makeAuthRunCommandHook ( ) , authProvider ) <nl> + . getNoThrow ( ) ; <nl> if ( status . isOK ( ) ) { <nl> return status ; <nl> } <nl> mmm a / src / mongo / client / internal_auth . cpp <nl> ppp b / src / mongo / client / internal_auth . cpp <nl> bool isInternalAuthSet ( ) { <nl> return internalAuthSet ; <nl> } <nl> <nl> - BSONObj getInternalAuthParams ( size_t idx , const std : : string & mechanism ) { <nl> + BSONObj createInternalX509AuthDocument ( boost : : optional < StringData > userName ) { <nl> + BSONObjBuilder builder ; <nl> + builder . append ( saslCommandMechanismFieldName , " MONGODB - X509 " ) ; <nl> + builder . append ( saslCommandUserDBFieldName , " $ external " ) ; <nl> + <nl> + if ( userName ) { <nl> + builder . append ( saslCommandUserFieldName , userName . get ( ) ) ; <nl> + } <nl> + <nl> + return builder . obj ( ) ; <nl> + } <nl> + <nl> + BSONObj getInternalAuthParams ( size_t idx , StringData mechanism ) { <nl> stdx : : lock_guard < Latch > lk ( internalAuthKeysMutex ) ; <nl> if ( ! internalAuthSet ) { <nl> return BSONObj ( ) ; <nl> mmm a / src / mongo / client / internal_auth . h <nl> ppp b / src / mongo / client / internal_auth . h <nl> bool isInternalAuthSet ( ) ; <nl> * / <nl> std : : string getInternalAuthDB ( ) ; <nl> <nl> - BSONObj getInternalAuthParams ( size_t idx , const std : : string & mechanism ) ; <nl> + / * * <nl> + * Returns the internal auth sasl parameters . <nl> + * / <nl> + BSONObj getInternalAuthParams ( size_t idx , StringData mechanism ) ; <nl> + <nl> + / * * <nl> + * Create a BSON document for internal authentication . <nl> + * / <nl> + BSONObj createInternalX509AuthDocument ( boost : : optional < StringData > userName = boost : : none ) ; <nl> <nl> } / / namespace auth <nl> } / / namespace mongo <nl> mmm a / src / mongo / db / initialize_server_security_state . cpp <nl> ppp b / src / mongo / db / initialize_server_security_state . cpp <nl> bool initializeServerSecurityGlobalState ( ServiceContext * service ) { <nl> # ifdef MONGO_CONFIG_SSL <nl> if ( clusterAuthMode = = ServerGlobalParams : : ClusterAuthMode_x509 | | <nl> clusterAuthMode = = ServerGlobalParams : : ClusterAuthMode_sendX509 ) { <nl> - auth : : setInternalUserAuthParams ( BSON ( saslCommandMechanismFieldName <nl> - < < " MONGODB - X509 " < < saslCommandUserDBFieldName <nl> - < < " $ external " < < saslCommandUserFieldName <nl> - < < SSLManagerCoordinator : : get ( ) <nl> - - > getSSLManager ( ) <nl> - - > getSSLConfiguration ( ) <nl> - . clientSubjectName . toString ( ) ) ) ; <nl> + auth : : setInternalUserAuthParams ( auth : : createInternalX509AuthDocument ( <nl> + boost : : optional < StringData > { SSLManagerCoordinator : : get ( ) <nl> + - > getSSLManager ( ) <nl> + - > getSSLConfiguration ( ) <nl> + . clientSubjectName . toString ( ) } ) ) ; <nl> } <nl> # endif <nl> <nl> mmm a / src / mongo / db / mongod_options . cpp <nl> ppp b / src / mongo / db / mongod_options . cpp <nl> Status storeMongodOptions ( const moe : : Environment & params ) { <nl> if ( ! replSettings . getReplSetString ( ) . empty ( ) & & <nl> ( params . count ( " security . authorization " ) & & <nl> params [ " security . authorization " ] . as < std : : string > ( ) = = " enabled " ) & & <nl> + serverGlobalParams . clusterAuthMode . load ( ) ! = ServerGlobalParams : : ClusterAuthMode_x509 & & <nl> ! params . count ( " security . keyFile " ) ) { <nl> return Status ( <nl> ErrorCodes : : BadValue , <nl> mmm a / src / mongo / executor / connection_pool_tl . cpp <nl> ppp b / src / mongo / executor / connection_pool_tl . cpp <nl> <nl> # include " mongo / executor / connection_pool_tl . h " <nl> <nl> # include " mongo / client / authenticate . h " <nl> + # include " mongo / config . h " <nl> # include " mongo / db / auth / authorization_manager . h " <nl> # include " mongo / logv2 / log . h " <nl> <nl> void TLConnection : : cancelTimeout ( ) { <nl> _timer - > cancelTimeout ( ) ; <nl> } <nl> <nl> + namespace { <nl> + <nl> class TLConnectionSetupHook : public executor : : NetworkConnectionHook { <nl> public : <nl> - explicit TLConnectionSetupHook ( executor : : NetworkConnectionHook * hookToWrap ) <nl> - : _wrappedHook ( hookToWrap ) { } <nl> + explicit TLConnectionSetupHook ( executor : : NetworkConnectionHook * hookToWrap , bool x509AuthOnly ) <nl> + : _wrappedHook ( hookToWrap ) , _x509AuthOnly ( x509AuthOnly ) { } <nl> <nl> BSONObj augmentIsMasterRequest ( BSONObj cmdObj ) override { <nl> BSONObjBuilder bob ( std : : move ( cmdObj ) ) ; <nl> class TLConnectionSetupHook : public executor : : NetworkConnectionHook { <nl> if ( internalSecurity . user ) { <nl> bob . append ( " saslSupportedMechs " , internalSecurity . user - > getName ( ) . getUnambiguousName ( ) ) ; <nl> } <nl> - _speculativeAuthType = auth : : speculateInternalAuth ( & bob , & _session ) ; <nl> + <nl> + if ( _x509AuthOnly ) { <nl> + _speculativeAuthType = auth : : SpeculativeAuthType : : kAuthenticate ; <nl> + } else { <nl> + _speculativeAuthType = auth : : speculateInternalAuth ( & bob , & _session ) ; <nl> + } <nl> <nl> return bob . obj ( ) ; <nl> } <nl> class TLConnectionSetupHook : public executor : : NetworkConnectionHook { <nl> const RemoteCommandResponse & isMasterReply ) override try { <nl> const auto & reply = isMasterReply . data ; <nl> <nl> - const auto saslMechsElem = reply . getField ( " saslSupportedMechs " ) ; <nl> - if ( saslMechsElem . type ( ) = = Array ) { <nl> - auto array = saslMechsElem . Array ( ) ; <nl> - for ( const auto & elem : array ) { <nl> - _saslMechsForInternalAuth . push_back ( elem . checkAndGetStringData ( ) . toString ( ) ) ; <nl> + / / X . 509 auth only means we only want to use a single mechanism regards of what hello says <nl> + if ( _x509AuthOnly ) { <nl> + _saslMechsForInternalAuth . clear ( ) ; <nl> + _saslMechsForInternalAuth . push_back ( " MONGODB - X509 " ) ; <nl> + } else { <nl> + const auto saslMechsElem = reply . getField ( " saslSupportedMechs " ) ; <nl> + if ( saslMechsElem . type ( ) = = Array ) { <nl> + auto array = saslMechsElem . Array ( ) ; <nl> + for ( const auto & elem : array ) { <nl> + _saslMechsForInternalAuth . push_back ( elem . checkAndGetStringData ( ) . toString ( ) ) ; <nl> + } <nl> } <nl> } <nl> <nl> class TLConnectionSetupHook : public executor : : NetworkConnectionHook { <nl> auth : : SpeculativeAuthType _speculativeAuthType ; <nl> BSONObj _speculativeAuthenticate ; <nl> executor : : NetworkConnectionHook * const _wrappedHook = nullptr ; <nl> + bool _x509AuthOnly ; <nl> } ; <nl> <nl> + # ifdef MONGO_CONFIG_SSL <nl> + class TransientInternalAuthParametersProvider : public auth : : InternalAuthParametersProvider { <nl> + public : <nl> + TransientInternalAuthParametersProvider ( <nl> + const std : : shared_ptr < const transport : : SSLConnectionContext > transientSSLContext ) <nl> + : _transientSSLContext ( transientSSLContext ) { } <nl> + <nl> + ~ TransientInternalAuthParametersProvider ( ) = default ; <nl> + <nl> + BSONObj get ( size_t index , StringData mechanism ) final { <nl> + if ( _transientSSLContext ) { <nl> + if ( index = = 0 ) { <nl> + return auth : : createInternalX509AuthDocument ( <nl> + boost : : optional < StringData > { _transientSSLContext - > manager - > getSSLConfiguration ( ) <nl> + . clientSubjectName . toString ( ) } ) ; <nl> + } else { <nl> + return BSONObj ( ) ; <nl> + } <nl> + } <nl> + <nl> + return auth : : getInternalAuthParams ( index , mechanism ) ; <nl> + } <nl> + <nl> + private : <nl> + const std : : shared_ptr < const transport : : SSLConnectionContext > _transientSSLContext ; <nl> + } ; <nl> + # endif <nl> + <nl> + } / / namespace <nl> + <nl> void TLConnection : : setup ( Milliseconds timeout , SetupCallback cb ) { <nl> auto anchor = shared_from_this ( ) ; <nl> <nl> void TLConnection : : setup ( Milliseconds timeout , SetupCallback cb ) { <nl> } <nl> } ) ; <nl> <nl> - auto isMasterHook = std : : make_shared < TLConnectionSetupHook > ( _onConnectHook ) ; <nl> + # ifdef MONGO_CONFIG_SSL <nl> + bool x509AuthOnly = <nl> + _transientSSLContext . get ( ) & & _transientSSLContext - > targetClusterURI . has_value ( ) ; <nl> + auto authParametersProvider = <nl> + std : : make_shared < TransientInternalAuthParametersProvider > ( _transientSSLContext ) ; <nl> + # else <nl> + bool x509AuthOnly = false ; <nl> + auto authParametersProvider = auth : : createDefaultInternalAuthProvider ( ) ; <nl> + # endif <nl> + <nl> + / / For transient connections , only use X . 509 auth . <nl> + auto isMasterHook = std : : make_shared < TLConnectionSetupHook > ( _onConnectHook , x509AuthOnly ) ; <nl> <nl> AsyncDBClient : : connect ( <nl> _peer , _sslMode , _serviceContext , _reactor , timeout , _transientSSLContext ) <nl> void TLConnection : : setup ( Milliseconds timeout , SetupCallback cb ) { <nl> isMasterHook - > getSpeculativeAuthenticateReply ( ) , <nl> isMasterHook - > getSpeculativeAuthType ( ) ) ; <nl> } ) <nl> - . then ( [ this , isMasterHook ] ( bool authenticatedDuringConnect ) { <nl> + . then ( [ this , isMasterHook , authParametersProvider ] ( bool authenticatedDuringConnect ) { <nl> if ( _skipAuth | | authenticatedDuringConnect ) { <nl> return Future < void > : : makeReady ( ) ; <nl> } <nl> void TLConnection : : setup ( Milliseconds timeout , SetupCallback cb ) { <nl> boost : : optional < std : : string > mechanism ; <nl> if ( ! isMasterHook - > saslMechsForInternalAuth ( ) . empty ( ) ) <nl> mechanism = isMasterHook - > saslMechsForInternalAuth ( ) . front ( ) ; <nl> - return _client - > authenticateInternal ( std : : move ( mechanism ) ) ; <nl> + return _client - > authenticateInternal ( std : : move ( mechanism ) , authParametersProvider ) ; <nl> } ) <nl> . then ( [ this ] { <nl> if ( ! _onConnectHook ) { <nl> mmm a / src / mongo / util / net / SConscript <nl> ppp b / src / mongo / util / net / SConscript <nl> if get_option ( ' ssl ' ) = = ' on ' : <nl> ] , <nl> LIBDEPS = [ <nl> ' $ BUILD_DIR / mongo / client / connection_string ' , <nl> + ' $ BUILD_DIR / mongo / db / auth / builtin_roles ' , <nl> + ' $ BUILD_DIR / mongo / db / auth / user ' , <nl> ' $ BUILD_DIR / mongo / executor / network_interface ' , <nl> ' $ BUILD_DIR / mongo / executor / network_interface_factory ' , <nl> ' $ BUILD_DIR / mongo / executor / network_interface_fixture ' , <nl> mmm a / src / mongo / util / net / network_interface_ssl_test . cpp <nl> ppp b / src / mongo / util / net / network_interface_ssl_test . cpp <nl> <nl> <nl> # define MONGO_LOGV2_DEFAULT_COMPONENT : : mongo : : logv2 : : LogComponent : : kTest <nl> <nl> - # include < fstream > <nl> - <nl> # include " mongo / platform / basic . h " <nl> <nl> + # include < fstream > <nl> + <nl> + # include " mongo / client / authenticate . h " <nl> + # include " mongo / db / auth / authorization_session_impl . h " <nl> # include " mongo / executor / network_interface_integration_fixture . h " <nl> # include " mongo / logv2 / log . h " <nl> # include " mongo / unittest / integration_test . h " <nl> # include " mongo / unittest / unittest . h " <nl> - # include " mongo / util / assert_util . h " <nl> + # include " mongo / util / net / ssl_options . h " <nl> <nl> namespace mongo { <nl> namespace executor { <nl> namespace { <nl> <nl> - std : : string LoadFile ( const std : : string & name ) { <nl> + std : : string loadFile ( const std : : string & name ) { <nl> std : : ifstream input ( name ) ; <nl> std : : string str ( ( std : : istreambuf_iterator < char > ( input ) ) , std : : istreambuf_iterator < char > ( ) ) ; <nl> return str ; <nl> std : : string LoadFile ( const std : : string & name ) { <nl> class NetworkInterfaceSSLFixture : public NetworkInterfaceIntegrationFixture { <nl> public : <nl> void setUp ( ) final { <nl> + <nl> + / / Setup an internal user so that we can use it for external auth <nl> + UserHandle user ( User ( UserName ( " __system " , " local " ) ) ) ; <nl> + <nl> + internalSecurity . user = user ; <nl> + <nl> + / / Force all connections to use SSL for outgoing <nl> + sslGlobalParams . sslMode . store ( static_cast < int > ( SSLParams : : SSLModes : : SSLMode_requireSSL ) ) ; <nl> + sslGlobalParams . sslCAFile = " jstests / libs / ca . pem " ; <nl> + / / Set a client cert that should be ignored if we use the transient cert correctly . <nl> + sslGlobalParams . sslPEMKeyFile = " jstests / libs / client . pem " ; <nl> + <nl> + / / Set the internal user auth parameters so we auth with X . 509 externally <nl> + auth : : setInternalUserAuthParams ( <nl> + auth : : createInternalX509AuthDocument ( boost : : optional < StringData > ( " Ignored " ) ) ) ; <nl> + <nl> ConnectionPool : : Options options ; <nl> options . transientSSLParams . emplace ( [ ] { <nl> TransientSSLParams params ; <nl> - params . sslClusterPEMPayload = LoadFile ( " jstests / libs / client . pem " ) ; <nl> + params . sslClusterPEMPayload = loadFile ( " jstests / libs / server . pem " ) ; <nl> params . targetedClusterConnectionString = ConnectionString : : forLocal ( ) ; <nl> return params ; <nl> } ( ) ) ; <nl> mmm a / src / mongo / util / net / ssl_manager . cpp <nl> ppp b / src / mongo / util / net / ssl_manager . cpp <nl> void SSLManagerCoordinator : : rotate ( ) { <nl> int clusterAuthMode = serverGlobalParams . clusterAuthMode . load ( ) ; <nl> if ( clusterAuthMode = = ServerGlobalParams : : ClusterAuthMode_x509 | | <nl> clusterAuthMode = = ServerGlobalParams : : ClusterAuthMode_sendX509 ) { <nl> - auth : : setInternalUserAuthParams ( <nl> - BSON ( saslCommandMechanismFieldName <nl> - < < " MONGODB - X509 " < < saslCommandUserDBFieldName < < " $ external " <nl> - < < saslCommandUserFieldName <nl> - < < manager - > getSSLConfiguration ( ) . clientSubjectName . toString ( ) ) ) ; <nl> + auth : : setInternalUserAuthParams ( auth : : createInternalX509AuthDocument ( <nl> + StringData ( manager - > getSSLConfiguration ( ) . clientSubjectName . toString ( ) ) ) ) ; <nl> } <nl> <nl> auto tl = getGlobalServiceContext ( ) - > getTransportLayer ( ) ; <nl> mmm a / src / mongo / util / net / ssl_manager_openssl . cpp <nl> ppp b / src / mongo / util / net / ssl_manager_openssl . cpp <nl> int SSL_CTX_set_ciphersuites ( SSL_CTX * , const char * ) { <nl> } <nl> # endif <nl> <nl> + using namespace fmt : : literals ; <nl> + <nl> namespace mongo { <nl> <nl> namespace { <nl> class SSLManagerOpenSSL : public SSLManagerInterface , <nl> public std : : enable_shared_from_this < SSLManagerOpenSSL > { <nl> public : <nl> explicit SSLManagerOpenSSL ( const SSLParams & params , bool isServer ) ; <nl> - ~ SSLManagerOpenSSL ( ) final { <nl> + ~ SSLManagerOpenSSL ( ) { <nl> stopJobs ( ) ; <nl> } <nl> <nl> class SSLManagerOpenSSL : public SSLManagerInterface , <nl> * @ param subjectName as a pointer to the subject name variable being set . <nl> * @ param serverNotAfter a Date_t object pointer that is valued if the <nl> * date is to be checked ( as for a server certificate ) and null otherwise . <nl> - * @ return bool showing if the function was successful . <nl> + * @ return Status : : Ok showing if the function was successful . <nl> * / <nl> - bool _parseAndValidateCertificate ( const std : : string & keyFile , <nl> - PasswordFetcher * keyPassword , <nl> - SSLX509Name * subjectName , <nl> - Date_t * serverNotAfter ) ; <nl> - <nl> + Status _parseAndValidateCertificate ( const std : : string & keyFile , <nl> + PasswordFetcher * keyPassword , <nl> + SSLX509Name * subjectName , <nl> + Date_t * serverNotAfter ) ; <nl> + <nl> + Status _parseAndValidateCertificateFromBIO ( UniqueBIO inBio , <nl> + PasswordFetcher * keyPassword , <nl> + StringData fileNameForLogging , <nl> + SSLX509Name * subjectName , <nl> + Date_t * serverNotAfter ) ; <nl> + <nl> + Status _parseAndValidateCertificateFromMemory ( StringData buffer , <nl> + PasswordFetcher * keyPassword , <nl> + SSLX509Name * subjectName , <nl> + Date_t * serverNotAfter ) ; <nl> / * <nl> * Parse and return x509 object from the provided keyfile . <nl> * @ param keyFile referencing the PEM file to be read . <nl> SSLManagerOpenSSL : : SSLManagerOpenSSL ( const SSLParams & params , bool isServer ) <nl> } <nl> <nl> if ( ! clientPEM . empty ( ) ) { <nl> - if ( ! _parseAndValidateCertificate ( <nl> - clientPEM , clientPassword , & _sslConfiguration . clientSubjectName , nullptr ) ) { <nl> - uasserted ( 16941 , " ssl initialization problem " ) ; <nl> - } <nl> + auto status = _parseAndValidateCertificate ( <nl> + clientPEM , clientPassword , & _sslConfiguration . clientSubjectName , nullptr ) ; <nl> + uassertStatusOKWithContext ( <nl> + status , <nl> + str : : stream ( ) < < " ssl client initialization problem for certificate : " < < clientPEM ) ; <nl> } <nl> + <nl> / / SSL server specific initialization <nl> if ( isServer ) { <nl> if ( ! _initSynchronousSSLContext ( & _serverContext , params , ConnectionDirection : : kIncoming ) ) { <nl> SSLManagerOpenSSL : : SSLManagerOpenSSL ( const SSLParams & params , bool isServer ) <nl> } <nl> <nl> SSLX509Name serverSubjectName ; <nl> - if ( ! _parseAndValidateCertificate ( params . sslPEMKeyFile , <nl> - & _serverPEMPassword , <nl> - & serverSubjectName , <nl> - & _sslConfiguration . serverCertificateExpirationDate ) ) { <nl> - uasserted ( 16942 , " ssl initialization problem " ) ; <nl> - } <nl> + auto status = <nl> + _parseAndValidateCertificate ( params . sslPEMKeyFile , <nl> + & _serverPEMPassword , <nl> + & serverSubjectName , <nl> + & _sslConfiguration . serverCertificateExpirationDate ) ; <nl> + uassertStatusOKWithContext ( status , <nl> + str : : stream ( ) <nl> + < < " ssl server initialization problem for certificate : " <nl> + < < params . sslPEMKeyFile ) ; <nl> <nl> uassertStatusOK ( _sslConfiguration . setServerSubjectName ( std : : move ( serverSubjectName ) ) ) ; <nl> <nl> Status SSLManagerOpenSSL : : initSSLContext ( SSL_CTX * context , <nl> str : : stream ( ) < < " Can not set up transient ssl cluster certificate for " <nl> < < transientParams . targetedClusterConnectionString ) ; <nl> } <nl> + <nl> + auto status = _parseAndValidateCertificateFromMemory ( transientParams . sslClusterPEMPayload , <nl> + & _clusterPEMPassword , <nl> + & _sslConfiguration . clientSubjectName , <nl> + nullptr ) ; <nl> + if ( ! status . isOK ( ) ) { <nl> + return status . withContext ( " Could not validate transient certificate " ) ; <nl> + } <nl> + <nl> } else if ( direction = = ConnectionDirection : : kOutgoing & & params . tlsWithholdClientCertificate ) { <nl> / / Do not send a client certificate if they have been suppressed . <nl> <nl> bool SSLManagerOpenSSL : : _initSynchronousSSLContext ( UniqueSSLContext * contextPtr , <nl> return true ; <nl> } <nl> <nl> - bool SSLManagerOpenSSL : : _parseAndValidateCertificate ( const std : : string & keyFile , <nl> - PasswordFetcher * keyPassword , <nl> - SSLX509Name * subjectName , <nl> - Date_t * serverCertificateExpirationDate ) { <nl> - BIO * inBIO = BIO_new ( BIO_s_file ( ) ) ; <nl> - if ( inBIO = = nullptr ) { <nl> - LOGV2_ERROR ( 23243 , <nl> - " Failed to allocate BIO object " , <nl> - " error " _attr = getSSLErrorMessage ( ERR_get_error ( ) ) ) ; <nl> - return false ; <nl> + Status SSLManagerOpenSSL : : _parseAndValidateCertificate ( const std : : string & keyFile , <nl> + PasswordFetcher * keyPassword , <nl> + SSLX509Name * subjectName , <nl> + Date_t * serverCertificateExpirationDate ) { <nl> + UniqueBIO inBio ( BIO_new ( BIO_s_file ( ) ) ) ; <nl> + if ( ! inBio ) { <nl> + return Status ( <nl> + ErrorCodes : : InvalidSSLConfiguration , <nl> + " Failed to allocate BIO object . error : { } " _format ( getSSLErrorMessage ( ERR_get_error ( ) ) ) ) ; <nl> } <nl> <nl> - ON_BLOCK_EXIT ( [ & ] { BIO_free ( inBIO ) ; } ) ; <nl> - if ( BIO_read_filename ( inBIO , keyFile . c_str ( ) ) < = 0 ) { <nl> - LOGV2_ERROR ( 23244 , <nl> - " Cannot read key file when setting subject name " , <nl> - " keyFile " _attr = keyFile , <nl> - " error " _attr = getSSLErrorMessage ( ERR_get_error ( ) ) ) ; <nl> - return false ; <nl> + if ( BIO_read_filename ( inBio . get ( ) , keyFile . c_str ( ) ) < = 0 ) { <nl> + return Status ( ErrorCodes : : InvalidSSLConfiguration , <nl> + " Cannot read key file ' { } ' when setting subject name . error : { } " _format ( <nl> + keyFile , getSSLErrorMessage ( ERR_get_error ( ) ) ) ) ; <nl> + } <nl> + <nl> + return _parseAndValidateCertificateFromBIO ( <nl> + std : : move ( inBio ) , keyPassword , keyFile , subjectName , serverCertificateExpirationDate ) ; <nl> + } <nl> + <nl> + Status SSLManagerOpenSSL : : _parseAndValidateCertificateFromMemory ( <nl> + StringData buffer , <nl> + PasswordFetcher * keyPassword , <nl> + SSLX509Name * subjectName , <nl> + Date_t * serverCertificateExpirationDate ) { <nl> + logv2 : : DynamicAttributes errorAttrs ; <nl> + <nl> + # if OPENSSL_VERSION_NUMBER < = 0x1000114fL <nl> + UniqueBIO inBio ( BIO_new_mem_buf ( const_cast < char * > ( buffer . rawData ( ) ) , buffer . size ( ) ) ) ; <nl> + # else <nl> + UniqueBIO inBio ( BIO_new_mem_buf ( buffer . rawData ( ) , buffer . size ( ) ) ) ; <nl> + # endif <nl> + <nl> + if ( ! inBio ) { <nl> + CaptureSSLErrorInAttrs capture ( errorAttrs ) ; <nl> + return Status ( ErrorCodes : : InvalidSSLConfiguration , <nl> + " Failed to allocate BIO object from in - memory payload . error : { } " _format ( <nl> + getSSLErrorMessage ( ERR_get_error ( ) ) ) ) ; <nl> } <nl> <nl> + return _parseAndValidateCertificateFromBIO ( std : : move ( inBio ) , <nl> + keyPassword , <nl> + " transient " _sd , <nl> + subjectName , <nl> + serverCertificateExpirationDate ) ; <nl> + } <nl> + <nl> + Status SSLManagerOpenSSL : : _parseAndValidateCertificateFromBIO ( <nl> + UniqueBIO inBio , <nl> + PasswordFetcher * keyPassword , <nl> + StringData fileNameForLogging , <nl> + SSLX509Name * subjectName , <nl> + Date_t * serverCertificateExpirationDate ) { <nl> X509 * x509 = PEM_read_bio_X509 ( <nl> - inBIO , nullptr , & SSLManagerOpenSSL : : password_cb , static_cast < void * > ( & keyPassword ) ) ; <nl> + inBio . get ( ) , nullptr , & SSLManagerOpenSSL : : password_cb , static_cast < void * > ( & keyPassword ) ) ; <nl> if ( x509 = = nullptr ) { <nl> - LOGV2_ERROR ( 23245 , <nl> - " Cannot retrieve certificate from keyfile " , <nl> - " keyFile " _attr = keyFile , <nl> - " error " _attr = getSSLErrorMessage ( ERR_get_error ( ) ) ) ; <nl> - return false ; <nl> + return Status ( <nl> + ErrorCodes : : InvalidSSLConfiguration , <nl> + " Cannot retrieve certificate from keyfile ' { } ' when setting subject name . error : { } " _format ( <nl> + fileNameForLogging , getSSLErrorMessage ( ERR_get_error ( ) ) ) ) ; <nl> } <nl> ON_BLOCK_EXIT ( [ & ] { X509_free ( x509 ) ; } ) ; <nl> <nl> * subjectName = getCertificateSubjectX509Name ( x509 ) ; <nl> - if ( serverCertificateExpirationDate ! = nullptr ) { <nl> - auto notBeforeMillis = convertASN1ToMillis ( X509_get_notBefore ( x509 ) ) ; <nl> - if ( notBeforeMillis = = Date_t ( ) ) { <nl> - LOGV2_ERROR ( 23873 , " date conversion failed " ) ; <nl> - return false ; <nl> - } <nl> <nl> - auto notAfterMillis = convertASN1ToMillis ( X509_get_notAfter ( x509 ) ) ; <nl> - if ( notAfterMillis = = Date_t ( ) ) { <nl> - LOGV2_ERROR ( 23874 , " date conversion failed " ) ; <nl> - return false ; <nl> - } <nl> + auto notBeforeMillis = convertASN1ToMillis ( X509_get_notBefore ( x509 ) ) ; <nl> + if ( notBeforeMillis = = Date_t ( ) ) { <nl> + return Status ( ErrorCodes : : InvalidSSLConfiguration , <nl> + " notBefore certificate date conversion failed " ) ; <nl> + } <nl> <nl> - if ( ( notBeforeMillis > Date_t : : now ( ) ) | | ( Date_t : : now ( ) > notAfterMillis ) ) { <nl> - LOGV2_FATAL_NOTRACE ( 28652 , " The provided SSL certificate is expired or not yet valid . " ) ; <nl> - } <nl> + auto notAfterMillis = convertASN1ToMillis ( X509_get_notAfter ( x509 ) ) ; <nl> + if ( notAfterMillis = = Date_t ( ) ) { <nl> + return Status ( ErrorCodes : : InvalidSSLConfiguration , <nl> + " notAfter certificate date conversion failed " ) ; <nl> + } <nl> <nl> + auto now = Date_t : : now ( ) ; <nl> + if ( ( notBeforeMillis > now ) | | ( now > notAfterMillis ) ) { <nl> + return Status ( <nl> + ErrorCodes : : InvalidSSLConfiguration , <nl> + " The provided SSL certificate is expired or not yet valid . notBefore { } , notAfter { } " _format ( <nl> + notBeforeMillis . toString ( ) , notAfterMillis . toString ( ) ) ) ; <nl> + } <nl> + <nl> + if ( serverCertificateExpirationDate ! = nullptr ) { <nl> * serverCertificateExpirationDate = notAfterMillis ; <nl> } <nl> <nl> - return true ; <nl> + return Status : : OK ( ) ; <nl> } <nl> <nl> / / static <nl> mmm a / src / mongo / util / net / ssl_manager_test . cpp <nl> ppp b / src / mongo / util / net / ssl_manager_test . cpp <nl> class ServiceEntryPointUtil : public ServiceEntryPoint { <nl> transport : : TransportLayer * _transport = nullptr ; <nl> } ; <nl> <nl> - std : : string LoadFile ( const std : : string & name ) { <nl> + std : : string loadFile ( const std : : string & name ) { <nl> std : : ifstream input ( name ) ; <nl> std : : string str ( ( std : : istreambuf_iterator < char > ( input ) ) , std : : istreambuf_iterator < char > ( ) ) ; <nl> return str ; <nl> TEST ( SSLManager , InitContextFromFileShouldFail ) { <nl> / / TODO SERVER - 52858 : there is no exception on Mac & Windows . <nl> ASSERT_THROWS_CODE ( [ & params ] { SSLManagerInterface : : create ( params , true / * isSSLServer * / ) ; } ( ) , <nl> DBException , <nl> - 16942 ) ; <nl> + ErrorCodes : : InvalidSSLConfiguration ) ; <nl> # endif <nl> } <nl> <nl> TEST ( SSLManager , InitContextFromMemory ) { <nl> params . sslCAFile = " jstests / libs / ca . pem " ; <nl> <nl> TransientSSLParams transientParams ; <nl> - transientParams . sslClusterPEMPayload = LoadFile ( " jstests / libs / client . pem " ) ; <nl> + transientParams . sslClusterPEMPayload = loadFile ( " jstests / libs / client . pem " ) ; <nl> <nl> std : : shared_ptr < SSLManagerInterface > manager = <nl> SSLManagerInterface : : create ( params , false / * isSSLServer * / ) ; <nl> TEST ( SSLManager , InitServerSideContextFromMemory ) { <nl> params . sslCAFile = " jstests / libs / ca . pem " ; <nl> <nl> TransientSSLParams transientParams ; <nl> - transientParams . sslClusterPEMPayload = LoadFile ( " jstests / libs / client . pem " ) ; <nl> + transientParams . sslClusterPEMPayload = loadFile ( " jstests / libs / client . pem " ) ; <nl> <nl> std : : shared_ptr < SSLManagerInterface > manager = <nl> SSLManagerInterface : : create ( params , true / * isSSLServer * / ) ; <nl> TEST ( SSLManager , TransientSSLParams ) { <nl> transport : : TransportLayerASIO tla ( options , & sepu ) ; <nl> <nl> TransientSSLParams transientSSLParams ; <nl> - transientSSLParams . sslClusterPEMPayload = LoadFile ( " jstests / libs / client . pem " ) ; <nl> + transientSSLParams . sslClusterPEMPayload = loadFile ( " jstests / libs / client . pem " ) ; <nl> transientSSLParams . targetedClusterConnectionString = ConnectionString : : forLocal ( ) ; <nl> <nl> auto result = tla . createTransientSSLContext ( transientSSLParams , manager . get ( ) ) ; <nl> mmm a / src / mongo / util / net / ssl_parameters_auth . cpp <nl> ppp b / src / mongo / util / net / ssl_parameters_auth . cpp <nl> Status ClusterAuthModeServerParameter : : setFromString ( const std : : string & strMode ) <nl> " connections " } ; <nl> } <nl> serverGlobalParams . clusterAuthMode . store ( mode ) ; <nl> - auth : : setInternalUserAuthParams ( BSON ( saslCommandMechanismFieldName <nl> - < < " MONGODB - X509 " < < saslCommandUserDBFieldName <nl> - < < " $ external " ) ) ; <nl> + auth : : setInternalUserAuthParams ( auth : : createInternalX509AuthDocument ( ) ) ; <nl> } else if ( ( mode = = ServerGlobalParams : : ClusterAuthMode_x509 ) & & <nl> ( oldMode = = ServerGlobalParams : : ClusterAuthMode_sendX509 ) ) { <nl> serverGlobalParams . clusterAuthMode . store ( mode ) ; <nl>
SERVER - 52945 Make mongod use x509 auth on egress connections if NetworkInterface has SSLConnectionContext override even if other egress connections use keyFile auth
mongodb/mongo
19ed9c958b369bd7e1776a57bd406ebe84cf2bec
2020-12-11T03:25:30Z
mmm a / stdlib / public / core / ArrayCast . swift <nl> ppp b / stdlib / public / core / ArrayCast . swift <nl> internal func _arrayConditionalDownCastElements < SourceElement , TargetElement > ( <nl> / / / - Precondition : SourceElement is a class type . <nl> / / / - Precondition : TargetElement is bridged non - verbatim to Objective - C . <nl> / / / O ( n ) , because each element must be bridged separately . <nl> - internal func _arrayConditionalBridgeElements < SourceElement , TargetElement > ( <nl> - _ source : Array < SourceElement > <nl> - ) - > Array < TargetElement > ? { <nl> + internal func _arrayConditionalBridgeElements < <nl> + SourceElement , <nl> + TargetElement <nl> + > ( _ source : Array < SourceElement > ) - > Array < TargetElement > ? { <nl> + <nl> _sanityCheck ( _isBridgedVerbatimToObjectiveC ( SourceElement . self ) ) <nl> _sanityCheck ( ! _isBridgedVerbatimToObjectiveC ( TargetElement . self ) ) <nl> <nl> internal func _arrayConditionalBridgeElements < SourceElement , TargetElement > ( <nl> <nl> var p = buf . firstElementAddress <nl> <nl> - ElementwiseBridging : <nl> - repeat { <nl> - for object : SourceElement in source { <nl> - let value = Swift . _conditionallyBridgeFromObjectiveC ( <nl> - unsafeBitCast ( object , to : AnyObject . self ) , TargetElement . self ) <nl> - if _slowPath ( value = = nil ) { <nl> - break ElementwiseBridging <nl> - } <nl> - p . initialize ( with : value ! ) <nl> - p + = 1 <nl> + / / Make sure the resulting array owns anything that is successfully stored <nl> + / / there . <nl> + defer { buf . count = p - buf . firstElementAddress } <nl> + <nl> + for object : SourceElement in source { <nl> + guard let value = object as ? TargetElement else { <nl> + return nil <nl> } <nl> - return Array ( _buffer : _ArrayBuffer ( buf , shiftedToStartIndex : 0 ) ) <nl> + p . initialize ( with : value ) <nl> + p + = 1 <nl> } <nl> - while false <nl> - <nl> - / / Don ' t destroy anything we never created . <nl> - buf . count = p - buf . firstElementAddress <nl> - <nl> - / / Report failure <nl> - return nil <nl> + return Array ( _buffer : _ArrayBuffer ( buf , shiftedToStartIndex : 0 ) ) <nl> } <nl> <nl> / / / Implements ` source as ? [ TargetElement ] ` : convert each element of <nl>
[ stdlib ] Code clean up
apple/swift
f4b3149b035ff256aacba2f567d241767f3b7acb
2016-07-16T05:05:53Z
mmm a / src / snapshot / snapshot - common . cc <nl> ppp b / src / snapshot / snapshot - common . cc <nl> void CalculateFirstPageSizes ( bool is_default_snapshot , <nl> 2 * context_reservations [ context_index ] . chunk_size ( ) ) + <nl> Page : : kObjectStartOffset ; <nl> / / Add a small allowance to the code space for small scripts . <nl> - if ( space = = CODE_SPACE ) required + = 64 * KB ; <nl> + if ( space = = CODE_SPACE ) required + = 32 * KB ; <nl> } else { <nl> / / We expect the vanilla snapshot to only require on page per space . <nl> DCHECK ( ! is_default_snapshot ) ; <nl>
Reduce allowance in the first code page at start up .
v8/v8
c9ed8f9751af1eda98c61a625c5a6740c6bce43b
2015-07-30T09:11:24Z
mmm a / core / io / resource_loader . h <nl> ppp b / core / io / resource_loader . h <nl> class ResourceLoader { <nl> static int get_import_order ( const String & p_path ) ; <nl> <nl> static void set_timestamp_on_load ( bool p_timestamp ) { timestamp_on_load = p_timestamp ; } <nl> + static bool get_timestamp_on_load ( ) { return timestamp_on_load ; } <nl> <nl> static void notify_load_error ( const String & p_err ) { <nl> if ( err_notify ) err_notify ( err_notify_ud , p_err ) ; <nl> mmm a / core / io / resource_saver . h <nl> ppp b / core / io / resource_saver . h <nl> class ResourceSaver { <nl> static void add_resource_format_saver ( ResourceFormatSaver * p_format_saver , bool p_at_front = false ) ; <nl> <nl> static void set_timestamp_on_save ( bool p_timestamp ) { timestamp_on_save = p_timestamp ; } <nl> + static bool get_timestamp_on_save ( ) { return timestamp_on_save ; } <nl> + <nl> static void set_save_callback ( ResourceSavedCallback p_callback ) ; <nl> } ; <nl> <nl> mmm a / editor / plugins / script_editor_plugin . cpp <nl> ppp b / editor / plugins / script_editor_plugin . cpp <nl> Ref < TextFile > ScriptEditor : : _load_text_file ( const String & p_path , Error * r_error <nl> text_file - > set_file_path ( local_path ) ; <nl> text_file - > set_path ( local_path , true ) ; <nl> <nl> + if ( ResourceLoader : : get_timestamp_on_load ( ) ) { <nl> + text_file - > set_last_modified_time ( FileAccess : : get_modified_time ( path ) ) ; <nl> + } <nl> + <nl> if ( r_error ) { <nl> * r_error = OK ; <nl> } <nl> Error ScriptEditor : : _save_text_file ( Ref < TextFile > p_text_file , const String & p_p <nl> file - > close ( ) ; <nl> memdelete ( file ) ; <nl> <nl> + if ( ResourceSaver : : get_timestamp_on_save ( ) ) { <nl> + p_text_file - > set_last_modified_time ( FileAccess : : get_modified_time ( p_path ) ) ; <nl> + } <nl> + <nl> _res_saved_callback ( sqscr ) ; <nl> return OK ; <nl> } <nl>
Merge pull request from Paulb23 / txt_file_last_modified_time
godotengine/godot
8dd00ed1762c4956b3231d709ce0d01ee9b306c8
2018-12-02T20:45:24Z
mmm a / modules / mono / editor / GodotSharpTools / Project / ProjectGenerator . cs <nl> ppp b / modules / mono / editor / GodotSharpTools / Project / ProjectGenerator . cs <nl> namespace GodotSharpTools . Project <nl> { <nl> public static class ProjectGenerator <nl> { <nl> + const string CoreApiProjectGuid = " { AEBF0036 - DA76 - 4341 - B651 - A3F2856AB2FA } " ; <nl> + const string EditorApiProjectGuid = " { 8FBEC238 - D944 - 4074 - 8548 - B3B524305905 } " ; <nl> + <nl> public static string GenCoreApiProject ( string dir , string [ ] compileItems ) <nl> { <nl> string path = Path . Combine ( dir , CoreApiProject + " . csproj " ) ; <nl> public static string GenCoreApiProject ( string dir , string [ ] compileItems ) <nl> <nl> mainGroup . AddProperty ( " DocumentationFile " , Path . Combine ( " $ ( OutputPath ) " , " $ ( AssemblyName ) . xml " ) ) ; <nl> mainGroup . SetProperty ( " RootNamespace " , " Godot " ) ; <nl> + mainGroup . SetProperty ( " ProjectGuid " , CoreApiProjectGuid ) ; <nl> <nl> GenAssemblyInfoFile ( root , dir , CoreApiProject , <nl> new string [ ] { " [ assembly : InternalsVisibleTo ( \ " " + EditorApiProject + " \ " ) ] " } , <nl> public static string GenEditorApiProject ( string dir , string coreApiHintPath , str <nl> <nl> mainGroup . AddProperty ( " DocumentationFile " , Path . Combine ( " $ ( OutputPath ) " , " $ ( AssemblyName ) . xml " ) ) ; <nl> mainGroup . SetProperty ( " RootNamespace " , " Godot " ) ; <nl> + mainGroup . SetProperty ( " ProjectGuid " , EditorApiProjectGuid ) ; <nl> <nl> GenAssemblyInfoFile ( root , dir , EditorApiProject ) ; <nl> <nl>
Do not generate API project GUIDs randomly
godotengine/godot
92af2e620bebeb579caf14e7f184e51d02fa74eb
2018-10-25T16:00:24Z
mmm a / tensorflow / compiler / xla / python / BUILD <nl> ppp b / tensorflow / compiler / xla / python / BUILD <nl> cc_library ( <nl> name = " pytree " , <nl> srcs = [ " pytree . cc " ] , <nl> hdrs = [ " pytree . h " ] , <nl> + compatible_with = [ ] , <nl> copts = [ <nl> " - fexceptions " , <nl> " - fno - strict - aliasing " , <nl> ] , <nl> features = [ " - use_header_modules " ] , <nl> deps = [ <nl> + " : types " , <nl> " @ com_google_absl / / absl / algorithm : container " , <nl> " @ com_google_absl / / absl / container : flat_hash_map " , <nl> " @ com_google_absl / / absl / hash " , <nl> mmm a / tensorflow / compiler / xla / python / pytree . cc <nl> ppp b / tensorflow / compiler / xla / python / pytree . cc <nl> limitations under the License . <nl> # include " pybind11 / pybind11 . h " <nl> # include " pybind11 / pytypes . h " <nl> # include " pybind11 / stl . h " <nl> + # include " tensorflow / compiler / xla / python / types . h " <nl> <nl> namespace xla { <nl> <nl>
[ XLA : Python ] Add missing type caster registration for absl : : optional < > to JAX pytree module .
tensorflow/tensorflow
6b599c349909e69f6e24e202ffdbf448baf72b74
2020-12-09T03:05:05Z
mmm a / Marlin / Marlin_main . cpp <nl> ppp b / Marlin / Marlin_main . cpp <nl> int EtoPPressure = 0 ; <nl> # endif <nl> <nl> # ifdef FWRETRACT <nl> - bool autoretract_enabled = true ; <nl> + bool autoretract_enabled = false ; <nl> bool retracted = false ; <nl> float retract_length = RETRACT_LENGTH ; <nl> float retract_feedrate = RETRACT_FEEDRATE ; <nl>
disable auto retract by default
MarlinFirmware/Marlin
c43838bb1ee4f787c637f4fc0b91aa4b78e4f56a
2014-02-17T03:04:54Z
new file mode 100644 <nl> index 000000000 . . f248a2293 <nl> mmm / dev / null <nl> ppp b / src / translations / sqlb_fa . ts <nl> <nl> + < ? xml version = " 1 . 0 " encoding = " utf - 8 " ? > <nl> + < ! DOCTYPE TS > <nl> + < TS version = " 2 . 1 " language = " fa_IR " > <nl> + < context > <nl> + < name > AboutDialog < / name > <nl> + < message > <nl> + < location filename = " . . / AboutDialog . ui " line = " 14 " / > <nl> + < source > About DB Browser for SQLite < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / AboutDialog . ui " line = " 47 " / > <nl> + < source > Version < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / AboutDialog . ui " line = " 102 " / > <nl> + < source > & lt ; html & gt ; & lt ; head / & gt ; & lt ; body & gt ; & lt ; p & gt ; DB Browser for SQLite is an open source , freeware visual tool used to create , design and edit SQLite database files . & lt ; / p & gt ; & lt ; p & gt ; It is bi - licensed under the Mozilla Public License Version 2 , as well as the GNU General Public License Version 3 or later . You can modify or redistribute it under the conditions of these licenses . & lt ; / p & gt ; & lt ; p & gt ; See & lt ; a href = & quot ; http : / / www . gnu . org / licenses / gpl . html & quot ; & gt ; http : / / www . gnu . org / licenses / gpl . html & lt ; / a & gt ; and & lt ; a href = & quot ; https : / / www . mozilla . org / MPL / 2 . 0 / index . txt & quot ; & gt ; https : / / www . mozilla . org / MPL / 2 . 0 / index . txt & lt ; / a & gt ; for details . & lt ; / p & gt ; & lt ; p & gt ; For more information on this program please visit our website at : & lt ; a href = & quot ; http : / / sqlitebrowser . org & quot ; & gt ; http : / / sqlitebrowser . org & lt ; / a & gt ; & lt ; / p & gt ; & lt ; p & gt ; & lt ; span style = & quot ; font - size : small ; & quot ; & gt ; This software uses the GPL / LGPL Qt Toolkit from & lt ; / span & gt ; & lt ; a href = & quot ; http : / / qt - project . org / & quot ; & gt ; & lt ; span style = & quot ; font - size : small ; & quot ; & gt ; http : / / qt - project . org / & lt ; / span & gt ; & lt ; / a & gt ; & lt ; span style = & quot ; font - size : small ; & quot ; & gt ; & lt ; br / & gt ; See & lt ; / span & gt ; & lt ; a href = & quot ; http : / / qt - project . org / doc / qt - 5 / licensing . html & quot ; & gt ; & lt ; span style = & quot ; font - size : small ; & quot ; & gt ; http : / / qt - project . org / doc / qt - 5 / licensing . html & lt ; / span & gt ; & lt ; / a & gt ; & lt ; span style = & quot ; font - size : small ; & quot ; & gt ; for licensing terms and information . & lt ; / span & gt ; & lt ; / p & gt ; & lt ; p & gt ; & lt ; span style = & quot ; font - size : small ; & quot ; & gt ; It also uses the Silk icon set by Mark James licensed under a Creative Commons Attribution 2 . 5 and 3 . 0 license . & lt ; br / & gt ; See & lt ; / span & gt ; & lt ; a href = & quot ; http : / / www . famfamfam . com / lab / icons / silk / & quot ; & gt ; & lt ; span style = & quot ; font - size : small ; & quot ; & gt ; http : / / www . famfamfam . com / lab / icons / silk / & lt ; / span & gt ; & lt ; / a & gt ; & lt ; span style = & quot ; font - size : small ; & quot ; & gt ; for details . & lt ; / span & gt ; & lt ; / p & gt ; & lt ; / body & gt ; & lt ; / html & gt ; < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / AboutDialog . cpp " line = " 17 " / > <nl> + < source > SQLite Version < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / AboutDialog . cpp " line = " 19 " / > <nl> + < source > SQLCipher Version < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / AboutDialog . cpp " line = " 19 " / > <nl> + < source > ( based on SQLite % 1 ) < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / AboutDialog . cpp " line = " 21 " / > <nl> + < source > Version < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / AboutDialog . cpp " line = " 22 " / > <nl> + < source > Qt Version < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < / context > <nl> + < context > <nl> + < name > AddRecordDialog < / name > <nl> + < message > <nl> + < location filename = " . . / AddRecordDialog . ui " line = " 14 " / > <nl> + < source > Add New Record < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / AddRecordDialog . ui " line = " 27 " / > <nl> + < source > Enter values for the new record considering constraints . Fields in bold are mandatory . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / AddRecordDialog . ui " line = " 67 " / > <nl> + < source > In the Value column you can specify the value for the field identified in the Name column . The Type column indicates the type of the field . Default values are displayed in the same style as NULL values . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / AddRecordDialog . ui " line = " 74 " / > <nl> + < source > Name < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / AddRecordDialog . ui " line = " 79 " / > <nl> + < source > Type < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / AddRecordDialog . ui " line = " 84 " / > <nl> + < source > Value < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / AddRecordDialog . ui " line = " 87 " / > <nl> + < source > Values to insert . Pre - filled default values are inserted automatically unless they are changed . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / AddRecordDialog . ui " line = " 93 " / > <nl> + < source > When you edit the values in the upper frame , the SQL query for inserting this new record is shown here . You can edit manually the query before saving . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / AddRecordDialog . ui " line = " 110 " / > <nl> + < source > & lt ; html & gt ; & lt ; head / & gt ; & lt ; body & gt ; & lt ; p & gt ; & lt ; span style = & quot ; font - weight : 600 ; & quot ; & gt ; Save & lt ; / span & gt ; will submit the shown SQL statement to the database for inserting the new record . & lt ; / p & gt ; & lt ; p & gt ; & lt ; span style = & quot ; font - weight : 600 ; & quot ; & gt ; Restore Defaults & lt ; / span & gt ; will restore the initial values in the & lt ; span style = & quot ; font - weight : 600 ; & quot ; & gt ; Value & lt ; / span & gt ; column . & lt ; / p & gt ; & lt ; p & gt ; & lt ; span style = & quot ; font - weight : 600 ; & quot ; & gt ; Cancel & lt ; / span & gt ; will close this dialog without executing the query . & lt ; / p & gt ; & lt ; / body & gt ; & lt ; / html & gt ; < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / AddRecordDialog . cpp " line = " 208 " / > <nl> + < source > Auto - increment <nl> + < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / AddRecordDialog . cpp " line = " 211 " / > <nl> + < source > Unique constraint <nl> + < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / AddRecordDialog . cpp " line = " 214 " / > <nl> + < source > Check constraint : % 1 <nl> + < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / AddRecordDialog . cpp " line = " 218 " / > <nl> + < source > Foreign key : % 1 <nl> + < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / AddRecordDialog . cpp " line = " 226 " / > <nl> + < source > Default value : % 1 <nl> + < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / AddRecordDialog . cpp " line = " 252 " / > <nl> + < source > Error adding record . Message from database engine : <nl> + <nl> + % 1 < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / AddRecordDialog . cpp " line = " 333 " / > <nl> + < source > Are you sure you want to restore all the entered values to their defaults ? < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < / context > <nl> + < context > <nl> + < name > Application < / name > <nl> + < message > <nl> + < location filename = " . . / Application . cpp " line = " 86 " / > <nl> + < source > Usage : % 1 [ options ] [ db ] <nl> + < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / Application . cpp " line = " 87 " / > <nl> + < source > Possible command line arguments : < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / Application . cpp " line = " 88 " / > <nl> + < source > - h , - - help Show command line options < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / Application . cpp " line = " 89 " / > <nl> + < source > - q , - - quit Exit application after running scripts < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / Application . cpp " line = " 90 " / > <nl> + < source > - s , - - sql [ file ] Execute this SQL file after opening the DB < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / Application . cpp " line = " 91 " / > <nl> + < source > - t , - - table [ table ] Browse this table after opening the DB < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / Application . cpp " line = " 92 " / > <nl> + < source > - R , - - read - only Open database in read - only mode < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / Application . cpp " line = " 93 " / > <nl> + < source > - o , - - option [ group / setting = value ] Run application with this setting temporarily set to value < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / Application . cpp " line = " 94 " / > <nl> + < source > - v , - - version Display the current version < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / Application . cpp " line = " 95 " / > <nl> + < source > [ file ] Open this SQLite database < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / Application . cpp " line = " 98 " / > <nl> + < source > This is DB Browser for SQLite version % 1 . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / Application . cpp " line = " 103 " / > <nl> + < source > The - s / - - sql option requires an argument < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / Application . cpp " line = " 105 " / > <nl> + < source > The file % 1 does not exist < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / Application . cpp " line = " 110 " / > <nl> + < source > The - t / - - table option requires an argument < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / Application . cpp " line = " 118 " / > <nl> + < source > The - o / - - option option requires an argument in the form group / setting = value < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / Application . cpp " line = " 138 " / > <nl> + < source > Invalid option / non - existant file : % 1 < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < / context > <nl> + < context > <nl> + < name > CipherDialog < / name > <nl> + < message > <nl> + < location filename = " . . / CipherDialog . ui " line = " 14 " / > <nl> + < source > SQLCipher encryption < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / CipherDialog . ui " line = " 27 " / > <nl> + < source > & amp ; Password < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / CipherDialog . ui " line = " 44 " / > <nl> + < source > & amp ; Reenter password < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / CipherDialog . ui " line = " 66 " / > <nl> + < source > Passphrase < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / CipherDialog . ui " line = " 71 " / > <nl> + < source > Raw key < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / CipherDialog . ui " line = " 98 " / > <nl> + < source > Encr & amp ; yption settings < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / CipherDialog . ui " line = " 110 " / > <nl> + < source > SQLCipher & amp ; 3 defaults < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / CipherDialog . ui " line = " 117 " / > <nl> + < source > SQLCipher & amp ; 4 defaults < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / CipherDialog . ui " line = " 124 " / > <nl> + < source > Custo & amp ; m < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / CipherDialog . ui " line = " 133 " / > <nl> + < source > Page si & amp ; ze < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / CipherDialog . ui " line = " 146 " / > <nl> + < source > & amp ; KDF iterations < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / CipherDialog . ui " line = " 166 " / > <nl> + < source > HMAC algorithm < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / CipherDialog . ui " line = " 195 " / > <nl> + < source > KDF algorithm < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / CipherDialog . cpp " line = " 35 " / > <nl> + < source > Please set a key to encrypt the database . <nl> + Note that if you change any of the other , optional , settings you & apos ; ll need to re - enter them as well every time you open the database file . <nl> + Leave the password fields empty to disable the encryption . <nl> + The encryption process might take some time and you should have a backup copy of your database ! Unsaved changes are applied before modifying the encryption . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / CipherDialog . cpp " line = " 40 " / > <nl> + < source > Please enter the key used to encrypt the database . <nl> + If any of the other settings were altered for this database file you need to provide this information as well . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < / context > <nl> + < context > <nl> + < name > ColumnDisplayFormatDialog < / name > <nl> + < message > <nl> + < location filename = " . . / ColumnDisplayFormatDialog . ui " line = " 14 " / > <nl> + < source > Choose display format < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / ColumnDisplayFormatDialog . ui " line = " 20 " / > <nl> + < source > Display format < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / ColumnDisplayFormatDialog . ui " line = " 26 " / > <nl> + < source > Choose a display format for the column & apos ; % 1 & apos ; which is applied to each value prior to showing it . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / ColumnDisplayFormatDialog . cpp " line = " 12 " / > <nl> + < source > Default < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / ColumnDisplayFormatDialog . cpp " line = " 14 " / > <nl> + < source > Decimal number < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / ColumnDisplayFormatDialog . cpp " line = " 15 " / > <nl> + < source > Exponent notation < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / ColumnDisplayFormatDialog . cpp " line = " 16 " / > <nl> + < source > Hex blob < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / ColumnDisplayFormatDialog . cpp " line = " 17 " / > <nl> + < source > Hex number < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / ColumnDisplayFormatDialog . cpp " line = " 18 " / > <nl> + < source > Octal number < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / ColumnDisplayFormatDialog . cpp " line = " 19 " / > <nl> + < source > Round number < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / ColumnDisplayFormatDialog . cpp " line = " 21 " / > <nl> + < source > Apple NSDate to date < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / ColumnDisplayFormatDialog . cpp " line = " 22 " / > <nl> + < source > Java epoch ( milliseconds ) to date < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / ColumnDisplayFormatDialog . cpp " line = " 23 " / > <nl> + < source > Julian day to date < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / ColumnDisplayFormatDialog . cpp " line = " 24 " / > <nl> + < source > Unix epoch to date < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / ColumnDisplayFormatDialog . cpp " line = " 25 " / > <nl> + < source > Unix epoch to local time < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / ColumnDisplayFormatDialog . cpp " line = " 26 " / > <nl> + < source > Windows DATE to date < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / ColumnDisplayFormatDialog . cpp " line = " 27 " / > <nl> + < source > Date as dd / mm / yyyy < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / ColumnDisplayFormatDialog . cpp " line = " 29 " / > <nl> + < source > Lower case < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / ColumnDisplayFormatDialog . cpp " line = " 30 " / > <nl> + < source > Upper case < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / ColumnDisplayFormatDialog . cpp " line = " 66 " / > <nl> + < source > Custom < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < / context > <nl> + < context > <nl> + < name > DBBrowserDB < / name > <nl> + < message > <nl> + < location filename = " . . / sqlitedb . cpp " line = " 204 " / > <nl> + < source > This database has already been attached . Its schema name is & apos ; % 1 & apos ; . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / sqlitedb . cpp " line = " 215 " / > <nl> + < source > Please specify the database name under which you want to access the attached database < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / sqlitedb . cpp " line = " 276 " / > <nl> + < source > Invalid file format < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / sqlitedb . cpp " line = " 613 " / > <nl> + < source > Do you really want to close this temporary database ? All data will be lost . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / sqlitedb . cpp " line = " 618 " / > <nl> + < source > Do you want to save the changes made to the database file % 1 ? < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / sqlitedb . cpp " line = " 678 " / > <nl> + < source > The database is currently busy : < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / sqlitedb . cpp " line = " 679 " / > <nl> + < source > Do you want to abort that other operation ? < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / sqlitedb . cpp " line = " 729 " / > <nl> + < source > Exporting database to SQL file . . . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / sqlitedb . cpp " line = " 730 " / > <nl> + < location filename = " . . / sqlitedb . cpp " line = " 959 " / > <nl> + < source > Cancel < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / sqlitedb . cpp " line = " 896 " / > <nl> + < location filename = " . . / sqlitedb . cpp " line = " 929 " / > <nl> + < source > No database file opened < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / sqlitedb . cpp " line = " 958 " / > <nl> + < source > Executing SQL . . . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / sqlitedb . cpp " line = " 980 " / > <nl> + < source > Action cancelled . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / sqlitedb . cpp " line = " 1009 " / > <nl> + < location filename = " . . / sqlitedb . cpp " line = " 1022 " / > <nl> + < source > Error in statement # % 1 : % 2 . <nl> + Aborting execution % 3 . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / sqlitedb . cpp " line = " 1012 " / > <nl> + < location filename = " . . / sqlitedb . cpp " line = " 1025 " / > <nl> + < source > and rolling back < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / sqlitedb . cpp " line = " 1069 " / > <nl> + < source > didn & apos ; t receive any output from % 1 < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / sqlitedb . cpp " line = " 1073 " / > <nl> + < source > could not execute command : % 1 < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / sqlitedb . cpp " line = " 1241 " / > <nl> + < source > Cannot delete this object < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / sqlitedb . cpp " line = " 1272 " / > <nl> + < source > Cannot set data on this object < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / sqlitedb . cpp " line = " 1376 " / > <nl> + < location filename = " . . / sqlitedb . cpp " line = " 1383 " / > <nl> + < source > A table with the name & apos ; % 1 & apos ; already exists in schema & apos ; % 2 & apos ; . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / sqlitedb . cpp " line = " 1392 " / > <nl> + < source > No table with name & apos ; % 1 & apos ; exists in schema & apos ; % 2 & apos ; . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / sqlitedb . cpp " line = " 1402 " / > <nl> + < location filename = " . . / sqlitedb . cpp " line = " 1423 " / > <nl> + < source > Cannot find column % 1 . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / sqlitedb . cpp " line = " 1432 " / > <nl> + < source > Creating savepoint failed . DB says : % 1 < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / sqlitedb . cpp " line = " 1494 " / > <nl> + < source > Renaming the column failed . DB says : <nl> + % 1 < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / sqlitedb . cpp " line = " 1522 " / > <nl> + < location filename = " . . / sqlitedb . cpp " line = " 1671 " / > <nl> + < source > Releasing savepoint failed . DB says : % 1 < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / sqlitedb . cpp " line = " 1541 " / > <nl> + < source > Creating new table failed . DB says : % 1 < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / sqlitedb . cpp " line = " 1573 " / > <nl> + < source > Copying data to new table failed . DB says : <nl> + % 1 < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / sqlitedb . cpp " line = " 1637 " / > <nl> + < source > Deleting old table failed . DB says : % 1 < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / sqlitedb . cpp " line = " 1662 " / > <nl> + < source > Restoring some of the objects associated with this table failed . This is most likely because some column names changed . Here & apos ; s the SQL statement which you might want to fix and execute manually : <nl> + <nl> + < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / sqlitedb . cpp " line = " 1710 " / > <nl> + < source > Error renaming table & apos ; % 1 & apos ; to & apos ; % 2 & apos ; . Message from database engine : <nl> + % 3 < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / sqlitedb . cpp " line = " 1745 " / > <nl> + < source > . . . & lt ; string can not be logged , contains binary data & gt ; . . . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / sqlitedb . cpp " line = " 1848 " / > <nl> + < source > could not get list of db objects : % 1 , % 2 < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / sqlitedb . cpp " line = " 1854 " / > <nl> + < source > could not get list of databases : % 1 < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / sqlitedb . cpp " line = " 1884 " / > <nl> + < source > Error setting pragma % 1 to % 2 : % 3 < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / sqlitedb . cpp " line = " 1930 " / > <nl> + < source > File not found . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / sqlitedb . cpp " line = " 1968 " / > <nl> + < source > Error loading extension : % 1 < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / sqlitedb . cpp " line = " 1993 " / > <nl> + < source > could not get column information < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < / context > <nl> + < context > <nl> + < name > DbStructureModel < / name > <nl> + < message > <nl> + < location filename = " . . / DbStructureModel . cpp " line = " 19 " / > <nl> + < source > Name < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / DbStructureModel . cpp " line = " 19 " / > <nl> + < source > Object < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / DbStructureModel . cpp " line = " 19 " / > <nl> + < source > Type < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / DbStructureModel . cpp " line = " 19 " / > <nl> + < source > Schema < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / DbStructureModel . cpp " line = " 19 " / > <nl> + < source > Database < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / DbStructureModel . cpp " line = " 162 " / > <nl> + < source > Browsables < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / DbStructureModel . cpp " line = " 167 " / > <nl> + < source > All < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / DbStructureModel . cpp " line = " 176 " / > <nl> + < source > Temporary < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / DbStructureModel . cpp " line = " 314 " / > <nl> + < source > Tables ( % 1 ) < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / DbStructureModel . cpp " line = " 319 " / > <nl> + < source > Indices ( % 1 ) < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / DbStructureModel . cpp " line = " 324 " / > <nl> + < source > Views ( % 1 ) < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / DbStructureModel . cpp " line = " 329 " / > <nl> + < source > Triggers ( % 1 ) < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < / context > <nl> + < context > <nl> + < name > EditDialog < / name > <nl> + < message > <nl> + < location filename = " . . / EditDialog . ui " line = " 14 " / > <nl> + < source > Edit database cell < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / EditDialog . ui " line = " 28 " / > <nl> + < source > Mode : < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / EditDialog . ui " line = " 41 " / > <nl> + < source > This is the list of supported modes for the cell editor . Choose a mode for viewing or editing the data of the current cell . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / EditDialog . ui " line = " 45 " / > <nl> + < source > Text < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / EditDialog . ui " line = " 50 " / > <nl> + < source > Binary < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / EditDialog . ui " line = " 55 " / > <nl> + < source > Image < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / EditDialog . ui " line = " 60 " / > <nl> + < source > JSON < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / EditDialog . ui " line = " 65 " / > <nl> + < source > XML < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / EditDialog . ui " line = " 73 " / > <nl> + < location filename = " . . / EditDialog . ui " line = " 76 " / > <nl> + < source > Automatically adjust the editor mode to the loaded data type < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / EditDialog . ui " line = " 79 " / > <nl> + < source > This checkable button enables or disables the automatic switching of the editor mode . When a new cell is selected or new data is imported and the automatic switching is enabled , the mode adjusts to the detected data type . You can then change the editor mode manually . If you want to keep this manually switched mode while moving through the cells , switch the button off . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / EditDialog . ui " line = " 82 " / > <nl> + < source > Auto - switch < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / EditDialog . ui " line = " 116 " / > <nl> + < location filename = " . . / EditDialog . ui " line = " 119 " / > <nl> + < source > Auto - format : pretty print on loading , compact on saving . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / EditDialog . ui " line = " 122 " / > <nl> + < source > When enabled , the auto - format feature formats the data on loading , breaking the text in lines and indenting it for maximum readability . On data saving , the auto - format feature compacts the data removing end of lines , and unnecessary whitespace . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / EditDialog . ui " line = " 125 " / > <nl> + < source > Autoformat < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / EditDialog . ui " line = " 145 " / > <nl> + < source > Import from file < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / EditDialog . ui " line = " 148 " / > <nl> + < source > Opens a file dialog used to import any kind of data to this database cell . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / EditDialog . ui " line = " 151 " / > <nl> + < source > & amp ; Import < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / EditDialog . ui " line = " 164 " / > <nl> + < source > Export to file < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / EditDialog . ui " line = " 167 " / > <nl> + < source > Opens a file dialog used to export the contents of this database cell to a file . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / EditDialog . ui " line = " 170 " / > <nl> + < source > & amp ; Export < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / EditDialog . ui " line = " 183 " / > <nl> + < source > Set this cell to NULL < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / EditDialog . ui " line = " 186 " / > <nl> + < source > Erases the contents of the cell < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / EditDialog . ui " line = " 189 " / > <nl> + < source > Set as & amp ; NULL < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / EditDialog . ui " line = " 210 " / > <nl> + < source > This area displays information about the data present in this database cell < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / EditDialog . ui " line = " 253 " / > <nl> + < source > This editor mode lets you edit JSON or XML data with syntax highlighting , automatic formatting and validation before saving . <nl> + <nl> + Errors are indicated with a red squiggle underline . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / EditDialog . ui " line = " 267 " / > <nl> + < source > Type of data currently in cell < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / EditDialog . ui " line = " 274 " / > <nl> + < source > Size of data currently in table < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / EditDialog . ui " line = " 296 " / > <nl> + < source > Apply data to cell < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / EditDialog . ui " line = " 299 " / > <nl> + < source > This button saves the changes performed in the cell editor to the database cell . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / EditDialog . ui " line = " 302 " / > <nl> + < source > Apply < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / EditDialog . ui " line = " 318 " / > <nl> + < location filename = " . . / EditDialog . ui " line = " 333 " / > <nl> + < source > Print . . . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / EditDialog . ui " line = " 321 " / > <nl> + < source > Open preview dialog for printing displayed image < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / EditDialog . ui " line = " 324 " / > <nl> + < location filename = " . . / EditDialog . ui " line = " 339 " / > <nl> + < source > Ctrl + P < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / EditDialog . ui " line = " 336 " / > <nl> + < source > Open preview dialog for printing displayed text < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / EditDialog . ui " line = " 348 " / > <nl> + < source > Copy Hex and ASCII < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / EditDialog . ui " line = " 351 " / > <nl> + < source > Copy selected hexadecimal and ASCII columns to the clipboard < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / EditDialog . ui " line = " 354 " / > <nl> + < source > Ctrl + Shift + C < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / EditDialog . cpp " line = " 214 " / > <nl> + < location filename = " . . / EditDialog . cpp " line = " 223 " / > <nl> + < source > Image data can & apos ; t be viewed in this mode . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / EditDialog . cpp " line = " 215 " / > <nl> + < location filename = " . . / EditDialog . cpp " line = " 224 " / > <nl> + < source > Try switching to Image or Binary mode . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / EditDialog . cpp " line = " 280 " / > <nl> + < location filename = " . . / EditDialog . cpp " line = " 289 " / > <nl> + < source > Binary data can & apos ; t be viewed in this mode . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / EditDialog . cpp " line = " 281 " / > <nl> + < location filename = " . . / EditDialog . cpp " line = " 290 " / > <nl> + < source > Try switching to Binary mode . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / EditDialog . cpp " line = " 313 " / > <nl> + < location filename = " . . / EditDialog . cpp " line = " 327 " / > <nl> + < location filename = " . . / EditDialog . cpp " line = " 387 " / > <nl> + < location filename = " . . / EditDialog . cpp " line = " 389 " / > <nl> + < source > Text files ( * . txt ) < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / EditDialog . cpp " line = " 314 " / > <nl> + < location filename = " . . / EditDialog . cpp " line = " 336 " / > <nl> + < location filename = " . . / EditDialog . cpp " line = " 392 " / > <nl> + < source > JSON files ( * . json ) < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / EditDialog . cpp " line = " 315 " / > <nl> + < location filename = " . . / EditDialog . cpp " line = " 339 " / > <nl> + < location filename = " . . / EditDialog . cpp " line = " 387 " / > <nl> + < location filename = " . . / EditDialog . cpp " line = " 389 " / > <nl> + < source > XML files ( * . xml ) < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / EditDialog . cpp " line = " 316 " / > <nl> + < location filename = " . . / EditDialog . cpp " line = " 333 " / > <nl> + < source > Image files ( % 1 ) < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / EditDialog . cpp " line = " 317 " / > <nl> + < location filename = " . . / EditDialog . cpp " line = " 330 " / > <nl> + < location filename = " . . / EditDialog . cpp " line = " 382 " / > <nl> + < source > Binary files ( * . bin ) < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / EditDialog . cpp " line = " 317 " / > <nl> + < location filename = " . . / EditDialog . cpp " line = " 404 " / > <nl> + < source > All files ( * ) < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / EditDialog . cpp " line = " 345 " / > <nl> + < source > Choose a file to import < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / EditDialog . cpp " line = " 378 " / > <nl> + < source > % 1 Image < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / EditDialog . cpp " line = " 395 " / > <nl> + < source > SVG files ( * . svg ) < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / EditDialog . cpp " line = " 402 " / > <nl> + < location filename = " . . / EditDialog . cpp " line = " 423 " / > <nl> + < source > Hex dump files ( * . txt ) < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / EditDialog . cpp " line = " 410 " / > <nl> + < source > Choose a filename to export data < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / EditDialog . cpp " line = " 477 " / > <nl> + < source > Invalid data for this mode < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / EditDialog . cpp " line = " 478 " / > <nl> + < source > The cell contains invalid % 1 data . Reason : % 2 . Do you really want to apply it to the cell ? < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / EditDialog . cpp " line = " 768 " / > <nl> + < location filename = " . . / EditDialog . cpp " line = " 959 " / > <nl> + < source > Type of data currently in cell : Text / Numeric < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message numerus = " yes " > <nl> + < location filename = " . . / EditDialog . cpp " line = " 770 " / > <nl> + < location filename = " . . / EditDialog . cpp " line = " 960 " / > <nl> + < location filename = " . . / EditDialog . cpp " line = " 968 " / > <nl> + < source > % n char ( s ) < / source > <nl> + < translation type = " unfinished " > <nl> + < numerusform > < / numerusform > <nl> + < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / EditDialog . cpp " line = " 932 " / > <nl> + < source > Type of data currently in cell : % 1 Image < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / EditDialog . cpp " line = " 938 " / > <nl> + < source > % 1x % 2 pixel ( s ) < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / EditDialog . cpp " line = " 949 " / > <nl> + < source > Type of data currently in cell : NULL < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message numerus = " yes " > <nl> + < location filename = " . . / EditDialog . cpp " line = " 950 " / > <nl> + < location filename = " . . / EditDialog . cpp " line = " 977 " / > <nl> + < source > % n byte ( s ) < / source > <nl> + < translation type = " unfinished " > <nl> + < numerusform > < / numerusform > <nl> + < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / EditDialog . cpp " line = " 967 " / > <nl> + < source > Type of data currently in cell : Valid JSON < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / EditDialog . cpp " line = " 976 " / > <nl> + < source > Type of data currently in cell : Binary < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < / context > <nl> + < context > <nl> + < name > EditIndexDialog < / name > <nl> + < message > <nl> + < location filename = " . . / EditIndexDialog . ui " line = " 14 " / > <nl> + < source > Edit Index Schema < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / EditIndexDialog . ui " line = " 26 " / > <nl> + < source > & amp ; Name < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / EditIndexDialog . ui " line = " 39 " / > <nl> + < source > & amp ; Table < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / EditIndexDialog . ui " line = " 52 " / > <nl> + < source > & amp ; Unique < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / EditIndexDialog . ui " line = " 69 " / > <nl> + < source > For restricting the index to only a part of the table you can specify a WHERE clause here that selects the part of the table that should be indexed < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / EditIndexDialog . ui " line = " 72 " / > <nl> + < source > Partial inde & amp ; x clause < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / EditIndexDialog . ui " line = " 85 " / > <nl> + < source > Colu & amp ; mns < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / EditIndexDialog . ui " line = " 130 " / > <nl> + < source > Table column < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / EditIndexDialog . ui " line = " 135 " / > <nl> + < source > Type < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / EditIndexDialog . ui " line = " 172 " / > <nl> + < source > Add a new expression column to the index . Expression columns contain SQL expression rather than column names . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / EditIndexDialog . ui " line = " 232 " / > <nl> + < source > Index column < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / EditIndexDialog . ui " line = " 237 " / > <nl> + < source > Order < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / EditIndexDialog . cpp " line = " 268 " / > <nl> + < source > Deleting the old index failed : <nl> + % 1 < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / EditIndexDialog . cpp " line = " 277 " / > <nl> + < source > Creating the index failed : <nl> + % 1 < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < / context > <nl> + < context > <nl> + < name > EditTableDialog < / name > <nl> + < message > <nl> + < location filename = " . . / EditTableDialog . ui " line = " 14 " / > <nl> + < source > Edit table definition < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / EditTableDialog . ui " line = " 27 " / > <nl> + < source > Table < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / EditTableDialog . ui " line = " 43 " / > <nl> + < source > Advanced < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / EditTableDialog . ui " line = " 62 " / > <nl> + < source > Database schema < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / EditTableDialog . ui " line = " 75 " / > <nl> + < source > Without Rowid < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / EditTableDialog . ui " line = " 85 " / > <nl> + < source > Make this a & apos ; WITHOUT rowid & apos ; table . Setting this flag requires a field of type INTEGER with the primary key flag set and the auto increment flag unset . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / EditTableDialog . ui " line = " 98 " / > <nl> + < source > Fields < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / EditTableDialog . ui " line = " 106 " / > <nl> + < source > Add field < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / EditTableDialog . ui " line = " 126 " / > <nl> + < source > Remove field < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / EditTableDialog . ui " line = " 146 " / > <nl> + < source > Move field up < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / EditTableDialog . ui " line = " 166 " / > <nl> + < source > Move field down < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / EditTableDialog . ui " line = " 236 " / > <nl> + < source > Name < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / EditTableDialog . ui " line = " 241 " / > <nl> + < source > Type < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / EditTableDialog . ui " line = " 246 " / > <nl> + < source > NN < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / EditTableDialog . ui " line = " 249 " / > <nl> + < source > Not null < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / EditTableDialog . ui " line = " 254 " / > <nl> + < source > PK < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / EditTableDialog . ui " line = " 257 " / > <nl> + < source > Primary key < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / EditTableDialog . ui " line = " 262 " / > <nl> + < source > AI < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / EditTableDialog . ui " line = " 265 " / > <nl> + < source > Autoincrement < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / EditTableDialog . ui " line = " 270 " / > <nl> + < source > U < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / EditTableDialog . ui " line = " 273 " / > <nl> + < source > Unique < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / EditTableDialog . ui " line = " 278 " / > <nl> + < source > Default < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / EditTableDialog . ui " line = " 281 " / > <nl> + < source > Default value < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / EditTableDialog . ui " line = " 286 " / > <nl> + < source > Check < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / EditTableDialog . ui " line = " 289 " / > <nl> + < source > Check constraint < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / EditTableDialog . ui " line = " 294 " / > <nl> + < source > Foreign Key < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / EditTableDialog . ui " line = " 314 " / > <nl> + < source > & lt ; html & gt ; & lt ; head / & gt ; & lt ; body & gt ; & lt ; p & gt ; & lt ; span style = & quot ; font - weight : 600 ; color : # ff0000 ; & quot ; & gt ; Warning : & lt ; / span & gt ; There is something with this table definition that our parser doesn & apos ; t fully understand . Modifying and saving this table might result in problems . & lt ; / p & gt ; & lt ; / body & gt ; & lt ; / html & gt ; < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / EditTableDialog . cpp " line = " 168 " / > <nl> + < source > Error creating table . Message from database engine : <nl> + % 1 < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / EditTableDialog . cpp " line = " 282 " / > <nl> + < source > There already is a field with that name . Please rename it first or choose a different name for this field . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / EditTableDialog . cpp " line = " 305 " / > <nl> + < source > This column is referenced in a foreign key in table % 1 and thus its name cannot be changed . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / EditTableDialog . cpp " line = " 388 " / > <nl> + < source > There is at least one row with this field set to NULL . This makes it impossible to set this flag . Please change the table data first . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / EditTableDialog . cpp " line = " 419 " / > <nl> + < source > There is at least one row with a non - integer value in this field . This makes it impossible to set the AI flag . Please change the table data first . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / EditTableDialog . cpp " line = " 472 " / > <nl> + < source > Column & apos ; % 1 & apos ; has duplicate data . <nl> + < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / EditTableDialog . cpp " line = " 473 " / > <nl> + < source > This makes it impossible to enable the & apos ; Unique & apos ; flag . Please remove the duplicate data , which will allow the & apos ; Unique & apos ; flag to then be enabled . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / EditTableDialog . cpp " line = " 585 " / > <nl> + < source > Are you sure you want to delete the field & apos ; % 1 & apos ; ? <nl> + All data currently stored in this field will be lost . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / EditTableDialog . cpp " line = " 673 " / > <nl> + < source > Please add a field which meets the following criteria before setting the without rowid flag : <nl> + - Primary key flag set <nl> + - Auto increment disabled < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < / context > <nl> + < context > <nl> + < name > ExportDataDialog < / name > <nl> + < message > <nl> + < location filename = " . . / ExportDataDialog . ui " line = " 14 " / > <nl> + < source > Export data as CSV < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / ExportDataDialog . ui " line = " 22 " / > <nl> + < source > Tab & amp ; le ( s ) < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / ExportDataDialog . ui " line = " 57 " / > <nl> + < source > Colu & amp ; mn names in first line < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / ExportDataDialog . ui " line = " 77 " / > <nl> + < source > Fie & amp ; ld separator < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / ExportDataDialog . ui " line = " 102 " / > <nl> + < source > , < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / ExportDataDialog . ui " line = " 107 " / > <nl> + < source > ; < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / ExportDataDialog . ui " line = " 112 " / > <nl> + < source > Tab < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / ExportDataDialog . ui " line = " 117 " / > <nl> + < source > | < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / ExportDataDialog . ui " line = " 122 " / > <nl> + < location filename = " . . / ExportDataDialog . ui " line = " 192 " / > <nl> + < location filename = " . . / ExportDataDialog . ui " line = " 254 " / > <nl> + < source > Other < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / ExportDataDialog . ui " line = " 152 " / > <nl> + < source > & amp ; Quote character < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / ExportDataDialog . ui " line = " 177 " / > <nl> + < source > & quot ; < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / ExportDataDialog . ui " line = " 182 " / > <nl> + < source > & apos ; < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / ExportDataDialog . ui " line = " 222 " / > <nl> + < source > New line characters < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / ExportDataDialog . ui " line = " 244 " / > <nl> + < source > Windows : CR + LF ( \ r \ n ) < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / ExportDataDialog . ui " line = " 249 " / > <nl> + < source > Unix : LF ( \ n ) < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / ExportDataDialog . ui " line = " 288 " / > <nl> + < source > Pretty print < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / ExportDataDialog . cpp " line = " 29 " / > <nl> + < source > Export data as JSON < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / ExportDataDialog . cpp " line = " 120 " / > <nl> + < source > exporting CSV < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / ExportDataDialog . cpp " line = " 188 " / > <nl> + < location filename = " . . / ExportDataDialog . cpp " line = " 283 " / > <nl> + < source > Could not open output file : % 1 < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / ExportDataDialog . cpp " line = " 204 " / > <nl> + < source > exporting JSON < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / ExportDataDialog . cpp " line = " 297 " / > <nl> + < source > Text files ( * . csv * . txt ) < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / ExportDataDialog . cpp " line = " 301 " / > <nl> + < source > Text files ( * . json * . js * . txt ) < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / ExportDataDialog . cpp " line = " 312 " / > <nl> + < location filename = " . . / ExportDataDialog . cpp " line = " 339 " / > <nl> + < source > Choose a filename to export data < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / ExportDataDialog . cpp " line = " 328 " / > <nl> + < source > Please select at least 1 table . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / ExportDataDialog . cpp " line = " 354 " / > <nl> + < source > Choose a directory < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / ExportDataDialog . cpp " line = " 385 " / > <nl> + < source > Export completed . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < / context > <nl> + < context > <nl> + < name > ExportSqlDialog < / name > <nl> + < message > <nl> + < location filename = " . . / ExportSqlDialog . ui " line = " 14 " / > <nl> + < source > Export SQL . . . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / ExportSqlDialog . ui " line = " 35 " / > <nl> + < source > Tab & amp ; le ( s ) < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / ExportSqlDialog . ui " line = " 63 " / > <nl> + < source > Select All < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / ExportSqlDialog . ui " line = " 70 " / > <nl> + < source > Deselect All < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / ExportSqlDialog . ui " line = " 79 " / > <nl> + < source > & amp ; Options < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / ExportSqlDialog . ui " line = " 85 " / > <nl> + < source > Keep column names in INSERT INTO < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / ExportSqlDialog . ui " line = " 95 " / > <nl> + < source > Multiple rows ( VALUES ) per INSERT statement < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / ExportSqlDialog . ui " line = " 116 " / > <nl> + < source > Export everything < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / ExportSqlDialog . ui " line = " 121 " / > <nl> + < source > Export schema only < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / ExportSqlDialog . ui " line = " 126 " / > <nl> + < source > Export data only < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / ExportSqlDialog . ui " line = " 135 " / > <nl> + < source > Keep old schema ( CREATE TABLE IF NOT EXISTS ) < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / ExportSqlDialog . ui " line = " 140 " / > <nl> + < source > Overwrite old schema ( DROP TABLE , then CREATE TABLE ) < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / ExportSqlDialog . cpp " line = " 74 " / > <nl> + < source > Please select at least one table . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / ExportSqlDialog . cpp " line = " 88 " / > <nl> + < source > Choose a filename to export < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / ExportSqlDialog . cpp " line = " 89 " / > <nl> + < source > Text files ( * . sql * . txt ) < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / ExportSqlDialog . cpp " line = " 117 " / > <nl> + < source > Export completed . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / ExportSqlDialog . cpp " line = " 119 " / > <nl> + < source > Export cancelled or failed . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < / context > <nl> + < context > <nl> + < name > ExtendedScintilla < / name > <nl> + < message > <nl> + < location filename = " . . / ExtendedScintilla . cpp " line = " 58 " / > <nl> + < location filename = " . . / ExtendedScintilla . cpp " line = " 233 " / > <nl> + < source > Ctrl + H < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / ExtendedScintilla . cpp " line = " 61 " / > <nl> + < location filename = " . . / ExtendedScintilla . cpp " line = " 237 " / > <nl> + < source > Ctrl + P < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / ExtendedScintilla . cpp " line = " 232 " / > <nl> + < source > Find and Replace . . . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / ExtendedScintilla . cpp " line = " 236 " / > <nl> + < source > Print . . . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < / context > <nl> + < context > <nl> + < name > ExtendedTableWidget < / name > <nl> + < message > <nl> + < location filename = " . . / ExtendedTableWidget . cpp " line = " 246 " / > <nl> + < source > Use as Exact Filter < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / ExtendedTableWidget . cpp " line = " 247 " / > <nl> + < source > Containing < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / ExtendedTableWidget . cpp " line = " 248 " / > <nl> + < source > Not containing < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / ExtendedTableWidget . cpp " line = " 249 " / > <nl> + < source > Not equal to < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / ExtendedTableWidget . cpp " line = " 250 " / > <nl> + < source > Greater than < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / ExtendedTableWidget . cpp " line = " 251 " / > <nl> + < source > Less than < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / ExtendedTableWidget . cpp " line = " 252 " / > <nl> + < source > Greater or equal < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / ExtendedTableWidget . cpp " line = " 253 " / > <nl> + < source > Less or equal < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / ExtendedTableWidget . cpp " line = " 254 " / > <nl> + < source > Between this and . . . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / ExtendedTableWidget . cpp " line = " 255 " / > <nl> + < source > Regular expression < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / ExtendedTableWidget . cpp " line = " 257 " / > <nl> + < source > Set to NULL < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / ExtendedTableWidget . cpp " line = " 258 " / > <nl> + < source > Copy < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / ExtendedTableWidget . cpp " line = " 259 " / > <nl> + < source > Copy with Headers < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / ExtendedTableWidget . cpp " line = " 260 " / > <nl> + < source > Copy as SQL < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / ExtendedTableWidget . cpp " line = " 261 " / > <nl> + < source > Paste < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / ExtendedTableWidget . cpp " line = " 262 " / > <nl> + < source > Print . . . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / ExtendedTableWidget . cpp " line = " 265 " / > <nl> + < source > Use in Filter Expression < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / ExtendedTableWidget . cpp " line = " 293 " / > <nl> + < source > Alt + Del < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / ExtendedTableWidget . cpp " line = " 295 " / > <nl> + < source > Ctrl + Shift + C < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / ExtendedTableWidget . cpp " line = " 296 " / > <nl> + < source > Ctrl + Alt + C < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / ExtendedTableWidget . cpp " line = " 646 " / > <nl> + < source > The content of the clipboard is bigger than the range selected . <nl> + Do you want to insert it anyway ? < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < / context > <nl> + < context > <nl> + < name > FileExtensionManager < / name > <nl> + < message > <nl> + < location filename = " . . / FileExtensionManager . ui " line = " 14 " / > <nl> + < source > File Extension Manager < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / FileExtensionManager . ui " line = " 22 " / > <nl> + < source > & amp ; Up < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / FileExtensionManager . ui " line = " 33 " / > <nl> + < source > & amp ; Down < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / FileExtensionManager . ui " line = " 57 " / > <nl> + < source > & amp ; Add < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / FileExtensionManager . ui " line = " 68 " / > <nl> + < source > & amp ; Remove < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / FileExtensionManager . ui " line = " 94 " / > <nl> + < location filename = " . . / FileExtensionManager . cpp " line = " 41 " / > <nl> + < source > Description < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / FileExtensionManager . ui " line = " 99 " / > <nl> + < source > Extensions < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / FileExtensionManager . cpp " line = " 42 " / > <nl> + < source > * . extension < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < / context > <nl> + < context > <nl> + < name > FilterLineEdit < / name > <nl> + < message > <nl> + < location filename = " . . / FilterLineEdit . cpp " line = " 11 " / > <nl> + < source > Filter < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / FilterLineEdit . cpp " line = " 25 " / > <nl> + < source > These input fields allow you to perform quick filters in the currently selected table . <nl> + By default , the rows containing the input text are filtered out . <nl> + The following operators are also supported : <nl> + % Wildcard <nl> + & gt ; Greater than <nl> + & lt ; Less than <nl> + & gt ; = Equal to or greater <nl> + & lt ; = Equal to or less <nl> + = Equal to : exact match <nl> + & lt ; & gt ; Unequal : exact inverse match <nl> + x ~ y Range : values between x and y <nl> + / regexp / Values matching the regular expression < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / FilterLineEdit . cpp " line = " 111 " / > <nl> + < source > Clear All Conditional Formats < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / FilterLineEdit . cpp " line = " 111 " / > <nl> + < source > Use for Conditional Format < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / FilterLineEdit . cpp " line = " 121 " / > <nl> + < source > Set Filter Expression < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / FilterLineEdit . cpp " line = " 123 " / > <nl> + < source > What & apos ; s This ? < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / FilterLineEdit . cpp " line = " 128 " / > <nl> + < source > Is NULL < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / FilterLineEdit . cpp " line = " 133 " / > <nl> + < source > Is not NULL < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / FilterLineEdit . cpp " line = " 138 " / > <nl> + < source > Is empty < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / FilterLineEdit . cpp " line = " 143 " / > <nl> + < source > Is not empty < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / FilterLineEdit . cpp " line = " 148 " / > <nl> + < source > Not containing . . . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / FilterLineEdit . cpp " line = " 152 " / > <nl> + < source > Equal to . . . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / FilterLineEdit . cpp " line = " 156 " / > <nl> + < source > Not equal to . . . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / FilterLineEdit . cpp " line = " 160 " / > <nl> + < source > Greater than . . . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / FilterLineEdit . cpp " line = " 164 " / > <nl> + < source > Less than . . . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / FilterLineEdit . cpp " line = " 168 " / > <nl> + < source > Greater or equal . . . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / FilterLineEdit . cpp " line = " 172 " / > <nl> + < source > Less or equal . . . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / FilterLineEdit . cpp " line = " 176 " / > <nl> + < source > In range . . . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / FilterLineEdit . cpp " line = " 181 " / > <nl> + < source > Regular expression . . . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < / context > <nl> + < context > <nl> + < name > FindReplaceDialog < / name > <nl> + < message > <nl> + < location filename = " . . / FindReplaceDialog . ui " line = " 14 " / > <nl> + < source > Find and Replace < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / FindReplaceDialog . ui " line = " 43 " / > <nl> + < source > Fi & amp ; nd text : < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / FindReplaceDialog . ui " line = " 56 " / > <nl> + < source > Re & amp ; place with : < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / FindReplaceDialog . ui " line = " 69 " / > <nl> + < source > Match & amp ; exact case < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / FindReplaceDialog . ui " line = " 79 " / > <nl> + < source > Match & amp ; only whole words < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / FindReplaceDialog . ui " line = " 86 " / > <nl> + < source > When enabled , the search continues from the other end when it reaches one end of the page < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / FindReplaceDialog . ui " line = " 89 " / > <nl> + < source > & amp ; Wrap around < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / FindReplaceDialog . ui " line = " 96 " / > <nl> + < source > When set , the search goes backwards from cursor position , otherwise it goes forward < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / FindReplaceDialog . ui " line = " 99 " / > <nl> + < source > Search & amp ; backwards < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / FindReplaceDialog . ui " line = " 106 " / > <nl> + < source > & lt ; html & gt ; & lt ; head / & gt ; & lt ; body & gt ; & lt ; p & gt ; When checked , the pattern to find is searched only in the current selection . & lt ; / p & gt ; & lt ; / body & gt ; & lt ; / html & gt ; < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / FindReplaceDialog . ui " line = " 109 " / > <nl> + < source > & amp ; Selection only < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / FindReplaceDialog . ui " line = " 116 " / > <nl> + < source > & lt ; html & gt ; & lt ; head / & gt ; & lt ; body & gt ; & lt ; p & gt ; When checked , the pattern to find is interpreted as a UNIX regular expression . See & lt ; a href = & quot ; https : / / en . wikibooks . org / wiki / Regular_Expressions & quot ; & gt ; Regular Expression in Wikibooks & lt ; / a & gt ; . & lt ; / p & gt ; & lt ; / body & gt ; & lt ; / html & gt ; < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / FindReplaceDialog . ui " line = " 119 " / > <nl> + < source > Use regular e & amp ; xpressions < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / FindReplaceDialog . ui " line = " 139 " / > <nl> + < source > Find the next occurrence from the cursor position and in the direction set by & quot ; Search backwards & quot ; < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / FindReplaceDialog . ui " line = " 142 " / > <nl> + < source > & amp ; Find Next < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / FindReplaceDialog . ui " line = " 149 " / > <nl> + < source > & amp ; Replace < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / FindReplaceDialog . ui " line = " 156 " / > <nl> + < source > Highlight all the occurrences of the text in the page < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / FindReplaceDialog . ui " line = " 159 " / > <nl> + < source > F & amp ; ind All < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / FindReplaceDialog . ui " line = " 166 " / > <nl> + < source > Replace all the occurrences of the text in the page < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / FindReplaceDialog . ui " line = " 169 " / > <nl> + < source > Replace & amp ; All < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / FindReplaceDialog . cpp " line = " 83 " / > <nl> + < source > The searched text was not found < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / FindReplaceDialog . cpp " line = " 146 " / > <nl> + < source > The searched text was not found . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / FindReplaceDialog . cpp " line = " 150 " / > <nl> + < source > The searched text was replaced one time . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / FindReplaceDialog . cpp " line = " 152 " / > <nl> + < source > The searched text was found one time . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / FindReplaceDialog . cpp " line = " 156 " / > <nl> + < source > The searched text was replaced % 1 times . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / FindReplaceDialog . cpp " line = " 158 " / > <nl> + < source > The searched text was found % 1 times . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < / context > <nl> + < context > <nl> + < name > ForeignKeyEditor < / name > <nl> + < message > <nl> + < location filename = " . . / ForeignKeyEditorDelegate . cpp " line = " 19 " / > <nl> + < source > & amp ; Reset < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / ForeignKeyEditorDelegate . cpp " line = " 22 " / > <nl> + < source > Foreign key clauses ( ON UPDATE , ON DELETE etc . ) < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < / context > <nl> + < context > <nl> + < name > ImportCsvDialog < / name > <nl> + < message > <nl> + < location filename = " . . / ImportCsvDialog . ui " line = " 14 " / > <nl> + < source > Import CSV file < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / ImportCsvDialog . ui " line = " 25 " / > <nl> + < source > Table na & amp ; me < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / ImportCsvDialog . ui " line = " 38 " / > <nl> + < source > & amp ; Column names in first line < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / ImportCsvDialog . ui " line = " 55 " / > <nl> + < source > Field & amp ; separator < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / ImportCsvDialog . ui " line = " 68 " / > <nl> + < source > , < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / ImportCsvDialog . ui " line = " 73 " / > <nl> + < source > ; < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / ImportCsvDialog . ui " line = " 78 " / > <nl> + < location filename = " . . / ImportCsvDialog . cpp " line = " 755 " / > <nl> + < source > Tab < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / ImportCsvDialog . ui " line = " 83 " / > <nl> + < source > | < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / ImportCsvDialog . ui " line = " 88 " / > <nl> + < location filename = " . . / ImportCsvDialog . ui " line = " 146 " / > <nl> + < location filename = " . . / ImportCsvDialog . ui " line = " 204 " / > <nl> + < source > Other < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / ImportCsvDialog . ui " line = " 118 " / > <nl> + < source > & amp ; Quote character < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / ImportCsvDialog . ui " line = " 131 " / > <nl> + < source > & quot ; < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / ImportCsvDialog . ui " line = " 136 " / > <nl> + < source > & apos ; < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / ImportCsvDialog . ui " line = " 176 " / > <nl> + < source > & amp ; Encoding < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / ImportCsvDialog . ui " line = " 189 " / > <nl> + < source > UTF - 8 < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / ImportCsvDialog . ui " line = " 194 " / > <nl> + < source > UTF - 16 < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / ImportCsvDialog . ui " line = " 199 " / > <nl> + < source > ISO - 8859 - 1 < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / ImportCsvDialog . ui " line = " 230 " / > <nl> + < source > Trim fields ? < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / ImportCsvDialog . ui " line = " 250 " / > <nl> + < source > Separate tables < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / ImportCsvDialog . ui " line = " 267 " / > <nl> + < source > Advanced < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / ImportCsvDialog . ui " line = " 281 " / > <nl> + < source > When importing an empty value from the CSV file into an existing table with a default value for this column , that default value is inserted . Activate this option to insert an empty value instead . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / ImportCsvDialog . ui " line = " 288 " / > <nl> + < source > Ignore default & amp ; values < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / ImportCsvDialog . ui " line = " 298 " / > <nl> + < source > Activate this option to stop the import when trying to import an empty value into a NOT NULL column without a default value . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / ImportCsvDialog . ui " line = " 305 " / > <nl> + < source > Fail on missing values < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / ImportCsvDialog . ui " line = " 315 " / > <nl> + < source > Disable data type detection < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / ImportCsvDialog . ui " line = " 325 " / > <nl> + < source > Disable the automatic data type detection when creating a new table . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / ImportCsvDialog . ui " line = " 332 " / > <nl> + < source > When importing into an existing table with a primary key , unique constraints or a unique index there is a chance for a conflict . This option allows you to select a strategy for that case : By default the import is aborted and rolled back but you can also choose to ignore and not import conflicting rows or to replace the existing row in the table . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / ImportCsvDialog . ui " line = " 336 " / > <nl> + < source > Abort import < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / ImportCsvDialog . ui " line = " 341 " / > <nl> + < source > Ignore row < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / ImportCsvDialog . ui " line = " 346 " / > <nl> + < source > Replace existing row < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / ImportCsvDialog . ui " line = " 354 " / > <nl> + < source > Conflict strategy < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / ImportCsvDialog . ui " line = " 405 " / > <nl> + < location filename = " . . / ImportCsvDialog . cpp " line = " 337 " / > <nl> + < source > Deselect All < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / ImportCsvDialog . ui " line = " 421 " / > <nl> + < source > Match Similar < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / ImportCsvDialog . cpp " line = " 217 " / > <nl> + < source > Import completed < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / ImportCsvDialog . cpp " line = " 337 " / > <nl> + < source > Select All < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / ImportCsvDialog . cpp " line = " 506 " / > <nl> + < source > There is already a table named & apos ; % 1 & apos ; and an import into an existing table is only possible if the number of columns match . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / ImportCsvDialog . cpp " line = " 513 " / > <nl> + < source > There is already a table named & apos ; % 1 & apos ; . Do you want to import the data into it ? < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / ImportCsvDialog . cpp " line = " 540 " / > <nl> + < source > Creating restore point failed : % 1 < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / ImportCsvDialog . cpp " line = " 553 " / > <nl> + < source > Creating the table failed : % 1 < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / ImportCsvDialog . cpp " line = " 614 " / > <nl> + < source > importing CSV < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / ImportCsvDialog . cpp " line = " 687 " / > <nl> + < source > Inserting row failed : % 1 < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / ImportCsvDialog . cpp " line = " 697 " / > <nl> + < source > Importing the file & apos ; % 1 & apos ; took % 2ms . Of this % 3ms were spent in the row function . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < / context > <nl> + < context > <nl> + < name > MainWindow < / name > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 14 " / > <nl> + < source > DB Browser for SQLite < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 29 " / > <nl> + < source > Database Structure < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 69 " / > <nl> + < source > This is the structure of the opened database . <nl> + You can drag SQL statements from an object row and drop them into other applications or into another instance of & apos ; DB Browser for SQLite & apos ; . <nl> + < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 94 " / > <nl> + < source > Browse Data < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 102 " / > <nl> + < source > & amp ; Table : < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 130 " / > <nl> + < source > Select a table to browse data < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 133 " / > <nl> + < source > Use this list to select a table to be displayed in the database view < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 146 " / > <nl> + < source > Refresh the data in the selected table < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 149 " / > <nl> + < source > This button refreshes the data in the currently selected table . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 163 " / > <nl> + < source > Clear all filters < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 166 " / > <nl> + < source > This button clears all the filters set in the header input fields for the currently browsed table . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 180 " / > <nl> + < source > Save the table as currently displayed < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 183 " / > <nl> + < source > & lt ; html & gt ; & lt ; head / & gt ; & lt ; body & gt ; & lt ; p & gt ; This popup menu provides the following options applying to the currently browsed and filtered table : & lt ; / p & gt ; & lt ; ul style = & quot ; margin - top : 0px ; margin - bottom : 0px ; margin - left : 0px ; margin - right : 0px ; - qt - list - indent : 1 ; & quot ; & gt ; & lt ; li style = & quot ; margin - top : 12px ; margin - bottom : 12px ; margin - left : 0px ; margin - right : 0px ; - qt - block - indent : 0 ; text - indent : 0px ; & quot ; & gt ; Export to CSV : this option exports the data of the browsed table as currently displayed ( after filters , display formats and order column ) to a CSV file . & lt ; / li & gt ; & lt ; li style = & quot ; margin - top : 12px ; margin - bottom : 12px ; margin - left : 0px ; margin - right : 0px ; - qt - block - indent : 0 ; text - indent : 0px ; & quot ; & gt ; Save as view : this option saves the current setting of the browsed table ( filters , display formats and order column ) as an SQL view that you can later browse or use in SQL statements . & lt ; / li & gt ; & lt ; / ul & gt ; & lt ; / body & gt ; & lt ; / html & gt ; < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 186 " / > <nl> + < source > . . . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 197 " / > <nl> + < source > Print currently browsed table data < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 200 " / > <nl> + < source > Print currently browsed table data . Print selection if more than one cell is selected . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 224 " / > <nl> + < source > Insert a new record in the current table < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 227 " / > <nl> + < source > & lt ; html & gt ; & lt ; head / & gt ; & lt ; body & gt ; & lt ; p & gt ; This button creates a new record in the database . Hold the mouse button to open a pop - up menu of different options : & lt ; / p & gt ; & lt ; ul & gt ; & lt ; li & gt ; & lt ; span style = & quot ; font - weight : 600 ; & quot ; & gt ; New Record & lt ; / span & gt ; : insert a new record with default values in the database . & lt ; / li & gt ; & lt ; li & gt ; & lt ; span style = & quot ; font - weight : 600 ; & quot ; & gt ; Insert Values . . . & lt ; / span & gt ; : open a dialog for entering values before they are inserted in the database . This allows to enter values acomplishing the different constraints . This dialog is also open if the & lt ; span style = & quot ; font - weight : 600 ; & quot ; & gt ; New Record & lt ; / span & gt ; option fails due to these constraints . & lt ; / li & gt ; & lt ; / ul & gt ; & lt ; / body & gt ; & lt ; / html & gt ; < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 230 " / > <nl> + < location filename = " . . / MainWindow . ui " line = " 2251 " / > <nl> + < source > New Record < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 237 " / > <nl> + < source > Delete the current record < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 240 " / > <nl> + < source > This button deletes the record or records currently selected in the table < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 243 " / > <nl> + < location filename = " . . / MainWindow . cpp " line = " 3593 " / > <nl> + < source > Delete Record < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 255 " / > <nl> + < source > This is the database table view . You can do the following actions : <nl> + - Start writing for editing inline the value . <nl> + - Double - click any record to edit its contents in the cell editor window . <nl> + - Alt + Del for deleting the cell content to NULL . <nl> + - Ctrl + & quot ; for duplicating the current record . <nl> + - Ctrl + & apos ; for copying the value from the cell above . <nl> + - Standard selection and copy / paste operations . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 288 " / > <nl> + < source > & lt ; html & gt ; & lt ; head / & gt ; & lt ; body & gt ; & lt ; p & gt ; Scroll to the beginning & lt ; / p & gt ; & lt ; / body & gt ; & lt ; / html & gt ; < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 291 " / > <nl> + < source > & lt ; html & gt ; & lt ; head / & gt ; & lt ; body & gt ; & lt ; p & gt ; Clicking this button navigates to the beginning in the table view above . & lt ; / p & gt ; & lt ; / body & gt ; & lt ; / html & gt ; < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 294 " / > <nl> + < source > | & lt ; < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 308 " / > <nl> + < source > Scroll one page upwards < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 311 " / > <nl> + < source > & lt ; html & gt ; & lt ; head / & gt ; & lt ; body & gt ; & lt ; p & gt ; Clicking this button navigates one page of records upwards in the table view above . & lt ; / p & gt ; & lt ; / body & gt ; & lt ; / html & gt ; < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 314 " / > <nl> + < source > & lt ; < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 325 " / > <nl> + < source > 0 - 0 of 0 < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 335 " / > <nl> + < source > Scroll one page downwards < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 338 " / > <nl> + < source > & lt ; html & gt ; & lt ; head / & gt ; & lt ; body & gt ; & lt ; p & gt ; Clicking this button navigates one page of records downwards in the table view above . & lt ; / p & gt ; & lt ; / body & gt ; & lt ; / html & gt ; < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 341 " / > <nl> + < source > & gt ; < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 355 " / > <nl> + < source > Scroll to the end < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 358 " / > <nl> + < source > & lt ; html & gt ; & lt ; head / & gt ; & lt ; body & gt ; & lt ; p & gt ; & amp ; lt ; html & amp ; gt ; & amp ; lt ; head / & amp ; gt ; & amp ; lt ; body & amp ; gt ; & amp ; lt ; p & amp ; gt ; Clicking this button navigates up to the end in the table view above . & amp ; lt ; / p & amp ; gt ; & amp ; lt ; / body & amp ; gt ; & amp ; lt ; / html & amp ; gt ; & lt ; / p & gt ; & lt ; / body & gt ; & lt ; / html & gt ; < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 361 " / > <nl> + < source > & gt ; | < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 385 " / > <nl> + < source > & lt ; html & gt ; & lt ; head / & gt ; & lt ; body & gt ; & lt ; p & gt ; Click here to jump to the specified record & lt ; / p & gt ; & lt ; / body & gt ; & lt ; / html & gt ; < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 388 " / > <nl> + < source > & lt ; html & gt ; & lt ; head / & gt ; & lt ; body & gt ; & lt ; p & gt ; This button is used to navigate to the record number specified in the Go to area . & lt ; / p & gt ; & lt ; / body & gt ; & lt ; / html & gt ; < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 391 " / > <nl> + < source > Go to : < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 398 " / > <nl> + < source > Enter record number to browse < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 401 " / > <nl> + < source > Type a record number in this area and click the Go to : button to display the record in the database view < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 404 " / > <nl> + < source > 1 < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 414 " / > <nl> + < source > Edit Pragmas < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 493 " / > <nl> + < source > & lt ; html & gt ; & lt ; head / & gt ; & lt ; body & gt ; & lt ; p & gt ; & lt ; a href = & quot ; https : / / www . sqlite . org / pragma . html # pragma_case_sensitive_like & quot ; & gt ; Case Sensitive Like & lt ; / a & gt ; & lt ; / p & gt ; & lt ; / body & gt ; & lt ; / html & gt ; < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 506 " / > <nl> + < source > Warning : this pragma is not readable and this value has been inferred . Writing the pragma might overwrite a redefined LIKE provided by an SQLite extension . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 929 " / > <nl> + < source > Execute SQL < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 935 " / > <nl> + < source > toolBar1 < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 984 " / > <nl> + < source > & amp ; File < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 988 " / > <nl> + < source > & amp ; Import < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 995 " / > <nl> + < source > & amp ; Export < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 1021 " / > <nl> + < source > & amp ; Edit < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 1033 " / > <nl> + < source > & amp ; View < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 1041 " / > <nl> + < source > & amp ; Help < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 1057 " / > <nl> + < source > & amp ; Tools < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 1078 " / > <nl> + < source > DB Toolbar < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 1097 " / > <nl> + < source > Edit Database & amp ; Cell < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 1109 " / > <nl> + < source > SQL & amp ; Log < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 1127 " / > <nl> + < source > Show S & amp ; QL submitted by < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 1144 " / > <nl> + < source > User < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 1149 " / > <nl> + < source > Application < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 1176 " / > <nl> + < source > This button clears the contents of the SQL logs < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 1179 " / > <nl> + < source > & amp ; Clear < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 1188 " / > <nl> + < source > This panel lets you examine a log of all SQL commands issued by the application or by yourself < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 1225 " / > <nl> + < source > & amp ; Plot < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 1236 " / > <nl> + < source > DB Sche & amp ; ma < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 1249 " / > <nl> + < source > This is the structure of the opened database . <nl> + You can drag multiple object names from the Name column and drop them into the SQL editor and you can adjust the properties of the dropped names using the context menu . This would help you in composing SQL statements . <nl> + You can drag SQL statements from the Schema column and drop them into the SQL editor or into other applications . <nl> + < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 1282 " / > <nl> + < source > & amp ; Remote < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 1291 " / > <nl> + < location filename = " . . / MainWindow . ui " line = " 2165 " / > <nl> + < source > Project Toolbar < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 1310 " / > <nl> + < source > Extra DB toolbar < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 1313 " / > <nl> + < location filename = " . . / MainWindow . ui " line = " 1387 " / > <nl> + < location filename = " . . / MainWindow . ui " line = " 1390 " / > <nl> + < source > Close the current database file < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 1333 " / > <nl> + < source > & amp ; New Database . . . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 1336 " / > <nl> + < location filename = " . . / MainWindow . ui " line = " 1339 " / > <nl> + < source > Create a new database file < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 1342 " / > <nl> + < source > This option is used to create a new database file . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 1345 " / > <nl> + < source > Ctrl + N < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 1357 " / > <nl> + < location filename = " . . / MainWindow . ui " line = " 2220 " / > <nl> + < source > & amp ; Open Database . . . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 1360 " / > <nl> + < location filename = " . . / MainWindow . ui " line = " 1363 " / > <nl> + < location filename = " . . / MainWindow . ui " line = " 2044 " / > <nl> + < location filename = " . . / MainWindow . ui " line = " 2223 " / > <nl> + < location filename = " . . / MainWindow . ui " line = " 2226 " / > <nl> + < source > Open an existing database file < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 1366 " / > <nl> + < location filename = " . . / MainWindow . ui " line = " 2047 " / > <nl> + < location filename = " . . / MainWindow . ui " line = " 2229 " / > <nl> + < source > This option is used to open an existing database file . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 1369 " / > <nl> + < location filename = " . . / MainWindow . ui " line = " 2232 " / > <nl> + < source > Ctrl + O < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 1384 " / > <nl> + < source > & amp ; Close Database < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 1393 " / > <nl> + < source > This button closes the connection to the currently open database file < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 1396 " / > <nl> + < source > Ctrl + W < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 1411 " / > <nl> + < source > & amp ; Revert Changes < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 1414 " / > <nl> + < location filename = " . . / MainWindow . ui " line = " 1417 " / > <nl> + < source > Revert database to last saved state < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 1420 " / > <nl> + < source > This option is used to revert the current database file to its last saved state . All changes made since the last save operation are lost . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 1435 " / > <nl> + < source > & amp ; Write Changes < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 1438 " / > <nl> + < location filename = " . . / MainWindow . ui " line = " 1441 " / > <nl> + < source > Write changes to the database file < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 1444 " / > <nl> + < source > This option is used to save changes to the database file . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 1447 " / > <nl> + < source > Ctrl + S < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 1458 " / > <nl> + < source > Compact & amp ; Database . . . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 1461 " / > <nl> + < source > Compact the database file , removing space wasted by deleted records < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 1464 " / > <nl> + < location filename = " . . / MainWindow . ui " line = " 1467 " / > <nl> + < source > Compact the database file , removing space wasted by deleted records . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 1475 " / > <nl> + < source > E & amp ; xit < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 1478 " / > <nl> + < source > Ctrl + Q < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 1486 " / > <nl> + < source > & amp ; Database from SQL file . . . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 1489 " / > <nl> + < source > Import data from an . sql dump text file into a new or existing database . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 1492 " / > <nl> + < source > This option lets you import data from an . sql dump text file into a new or existing database . SQL dump files can be created on most database engines , including MySQL and PostgreSQL . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 1500 " / > <nl> + < source > & amp ; Table from CSV file . . . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 1503 " / > <nl> + < source > Open a wizard that lets you import data from a comma separated text file into a database table . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 1506 " / > <nl> + < source > Open a wizard that lets you import data from a comma separated text file into a database table . CSV files can be created on most database and spreadsheet applications . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 1514 " / > <nl> + < source > & amp ; Database to SQL file . . . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 1517 " / > <nl> + < source > Export a database to a . sql dump text file . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 1520 " / > <nl> + < source > This option lets you export a database to a . sql dump text file . SQL dump files contain all data necessary to recreate the database on most database engines , including MySQL and PostgreSQL . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 1528 " / > <nl> + < source > & amp ; Table ( s ) as CSV file . . . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 1531 " / > <nl> + < source > Export a database table as a comma separated text file . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 1534 " / > <nl> + < source > Export a database table as a comma separated text file , ready to be imported into other database or spreadsheet applications . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 1549 " / > <nl> + < source > & amp ; Create Table . . . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 1552 " / > <nl> + < source > Open the Create Table wizard , where it is possible to define the name and fields for a new table in the database < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 1567 " / > <nl> + < source > & amp ; Delete Table . . . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 1570 " / > <nl> + < location filename = " . . / MainWindow . cpp " line = " 1782 " / > <nl> + < source > Delete Table < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 1573 " / > <nl> + < source > Open the Delete Table wizard , where you can select a database table to be dropped . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 1588 " / > <nl> + < source > & amp ; Modify Table . . . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 1591 " / > <nl> + < source > Open the Modify Table wizard , where it is possible to rename an existing table . It is also possible to add or delete fields form a table , as well as modify field names and types . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 1606 " / > <nl> + < source > Create & amp ; Index . . . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 1609 " / > <nl> + < source > Open the Create Index wizard , where it is possible to define a new index on an existing database table . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 1621 " / > <nl> + < source > & amp ; Preferences . . . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 1624 " / > <nl> + < location filename = " . . / MainWindow . ui " line = " 1627 " / > <nl> + < source > Open the preferences window . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 1642 " / > <nl> + < source > & amp ; DB Toolbar < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 1645 " / > <nl> + < source > Shows or hides the Database toolbar . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 1648 " / > <nl> + < location filename = " . . / MainWindow . ui " line = " 1694 " / > <nl> + < source > Ctrl + T < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 1660 " / > <nl> + < source > W & amp ; hat & apos ; s This ? < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 1663 " / > <nl> + < source > Shift + F1 < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 1671 " / > <nl> + < source > & amp ; About < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 1679 " / > <nl> + < source > & amp ; Recently opened < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 1688 " / > <nl> + < source > Open & amp ; tab < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 1691 " / > <nl> + < source > This button opens a new tab for the SQL editor < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 1703 " / > <nl> + < source > & amp ; Execute SQL < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 1706 " / > <nl> + < source > Execute all / selected SQL < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 1709 " / > <nl> + < source > This button executes the currently selected SQL statements . If no text is selected , all SQL statements are executed . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 1712 " / > <nl> + < source > Ctrl + Return < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 1721 " / > <nl> + < source > Open SQL file < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 1724 " / > <nl> + < source > This button opens a file containing SQL statements and loads it in a new editor tab < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 1733 " / > <nl> + < location filename = " . . / MainWindow . ui " line = " 1936 " / > <nl> + < location filename = " . . / MainWindow . ui " line = " 1939 " / > <nl> + < source > Save SQL file < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 1745 " / > <nl> + < source > & amp ; Load Extension . . . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 1757 " / > <nl> + < location filename = " . . / MainWindow . ui " line = " 1760 " / > <nl> + < source > Execute current line < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 1763 " / > <nl> + < source > This button executes the SQL statement present in the current editor line < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 1766 " / > <nl> + < source > Shift + F5 < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 1774 " / > <nl> + < source > Export as CSV file < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 1777 " / > <nl> + < source > Export table as comma separated values file < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 1786 " / > <nl> + < source > & amp ; Wiki < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 1798 " / > <nl> + < source > Bug & amp ; Report . . . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 1810 " / > <nl> + < source > Feature Re & amp ; quest . . . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 1822 " / > <nl> + < source > Web & amp ; site < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 1834 " / > <nl> + < source > & amp ; Donate on Patreon . . . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 1846 " / > <nl> + < source > Sa & amp ; ve Project . . . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 1849 " / > <nl> + < location filename = " . . / MainWindow . ui " line = " 1852 " / > <nl> + < source > Save the current session to a file < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 1855 " / > <nl> + < source > This button lets you save all the settings associated to the open DB to a DB4S project file < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 1867 " / > <nl> + < source > Open & amp ; Project . . . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 1870 " / > <nl> + < location filename = " . . / MainWindow . ui " line = " 1873 " / > <nl> + < source > Load a working session from a file < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 1876 " / > <nl> + < source > This button lets you open a DB4S project file < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 1891 " / > <nl> + < source > & amp ; Attach Database . . . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 1894 " / > <nl> + < location filename = " . . / MainWindow . ui " line = " 1897 " / > <nl> + < source > Add another database file to the current database connection < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 1900 " / > <nl> + < source > This button lets you add another database file to the current database connection < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 1912 " / > <nl> + < source > & amp ; Set Encryption . . . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 1924 " / > <nl> + < location filename = " . . / MainWindow . ui " line = " 1927 " / > <nl> + < source > Save SQL file as < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 1942 " / > <nl> + < source > This button saves the content of the current SQL editor tab to a file < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 1951 " / > <nl> + < source > & amp ; Browse Table < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 1960 " / > <nl> + < source > Copy Create statement < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 1963 " / > <nl> + < source > Copy the CREATE statement of the item to the clipboard < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 1968 " / > <nl> + < source > Edit display format < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 1971 " / > <nl> + < source > Edit the display format of the data in this column < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 1979 " / > <nl> + < source > Show rowid column < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 1982 " / > <nl> + < source > Toggle the visibility of the rowid column < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 1987 " / > <nl> + < location filename = " . . / MainWindow . cpp " line = " 3284 " / > <nl> + < source > Set encoding < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 1990 " / > <nl> + < source > Change the encoding of the text in the table cells < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 1995 " / > <nl> + < source > Set encoding for all tables < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 1998 " / > <nl> + < source > Change the default encoding assumed for all tables in the database < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 2007 " / > <nl> + < source > SQLCipher & amp ; FAQ < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 2010 " / > <nl> + < source > Opens the SQLCipher FAQ in a browser window < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 2015 " / > <nl> + < source > Table ( & amp ; s ) to JSON . . . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 2018 " / > <nl> + < source > Export one or more table ( s ) to a JSON file < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 2026 " / > <nl> + < source > Refresh < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 2029 " / > <nl> + < source > F5 < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 2038 " / > <nl> + < source > Open Data & amp ; base Read Only . . . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 2041 " / > <nl> + < source > Open an existing database file in read only mode < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 2058 " / > <nl> + < source > Unlock view editing < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 2061 " / > <nl> + < source > This unlocks the current view for editing . However , you will need appropriate triggers for editing . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 2070 " / > <nl> + < source > Save results < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 2073 " / > <nl> + < source > Save the results view < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 2076 " / > <nl> + < source > This button lets you save the results of the last executed query < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 2088 " / > <nl> + < location filename = " . . / MainWindow . ui " line = " 2091 " / > <nl> + < source > Find text in SQL editor < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 2094 " / > <nl> + < source > This button opens the search bar of the editor < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 2097 " / > <nl> + < source > Ctrl + F < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 2109 " / > <nl> + < location filename = " . . / MainWindow . ui " line = " 2112 " / > <nl> + < source > Find or replace text in SQL editor < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 2115 " / > <nl> + < source > This button opens the find / replace dialog for the current editor tab < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 2118 " / > <nl> + < source > Ctrl + H < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 2126 " / > <nl> + < location filename = " . . / MainWindow . ui " line = " 2188 " / > <nl> + < source > Export to & amp ; CSV < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 2131 " / > <nl> + < location filename = " . . / MainWindow . ui " line = " 2202 " / > <nl> + < source > Save as & amp ; view < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 2134 " / > <nl> + < source > Save as view < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 2139 " / > <nl> + < source > Hide column ( s ) < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 2142 " / > <nl> + < source > Hide selected column ( s ) < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 2147 " / > <nl> + < source > Show all columns < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 2150 " / > <nl> + < source > Show all columns that were hidden < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 2168 " / > <nl> + < source > Shows or hides the Project toolbar . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 2183 " / > <nl> + < source > Extra DB Toolbar < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 2191 " / > <nl> + < location filename = " . . / MainWindow . ui " line = " 2194 " / > <nl> + < source > Export the filtered data to CSV < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 2197 " / > <nl> + < source > This button exports the data of the browsed table as currently displayed ( after filters , display formats and order column ) as a CSV file . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 2205 " / > <nl> + < location filename = " . . / MainWindow . ui " line = " 2208 " / > <nl> + < source > Save the current filter , sort column and display formats as a view < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 2211 " / > <nl> + < source > This button saves the current setting of the browsed table ( filters , display formats and order column ) as an SQL view that you can later browse or use in SQL statements . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 2240 " / > <nl> + < source > Insert Values . . . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 2243 " / > <nl> + < location filename = " . . / MainWindow . ui " line = " 2246 " / > <nl> + < source > Open a dialog for inserting values in a new record < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 2254 " / > <nl> + < location filename = " . . / MainWindow . ui " line = " 2257 " / > <nl> + < source > Insert new record using default values in browsed table < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 2262 " / > <nl> + < source > New In - & amp ; Memory Database < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 2270 " / > <nl> + < source > Drag & amp ; & amp ; Drop Qualified Names < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 2273 " / > <nl> + < location filename = " . . / MainWindow . ui " line = " 2276 " / > <nl> + < source > Use qualified names ( e . g . & quot ; Table & quot ; . & quot ; Field & quot ; ) when dragging the objects and dropping them into the editor < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 2284 " / > <nl> + < source > Drag & amp ; & amp ; Drop Enquoted Names < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 2287 " / > <nl> + < location filename = " . . / MainWindow . ui " line = " 2290 " / > <nl> + < source > Use escaped identifiers ( e . g . & quot ; Table1 & quot ; ) when dragging the objects and dropping them into the editor < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 2295 " / > <nl> + < source > & amp ; Integrity Check < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 2298 " / > <nl> + < source > Runs the integrity_check pragma over the opened database and returns the results in the Execute SQL tab . This pragma does an integrity check of the entire database . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 2303 " / > <nl> + < source > & amp ; Foreign - Key Check < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 2306 " / > <nl> + < source > Runs the foreign_key_check pragma over the opened database and returns the results in the Execute SQL tab < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 2311 " / > <nl> + < source > & amp ; Quick Integrity Check < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 2314 " / > <nl> + < source > Run a quick integrity check over the open DB < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 2317 " / > <nl> + < source > Runs the quick_check pragma over the opened database and returns the results in the Execute SQL tab . This command does most of the checking of PRAGMA integrity_check but runs much faster . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 2322 " / > <nl> + < source > & amp ; Optimize < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 2325 " / > <nl> + < source > Attempt to optimize the database < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 2328 " / > <nl> + < source > Runs the optimize pragma over the opened database . This pragma might perform optimizations that will improve the performance of future queries . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 2337 " / > <nl> + < location filename = " . . / MainWindow . ui " line = " 2364 " / > <nl> + < source > Print < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 2340 " / > <nl> + < source > Print text from current SQL editor tab < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 2346 " / > <nl> + < source > Open a dialog for printing the text in the current SQL editor tab < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 2349 " / > <nl> + < location filename = " . . / MainWindow . ui " line = " 2376 " / > <nl> + < source > Ctrl + P < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 2367 " / > <nl> + < source > Print the structure of the opened database < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 2373 " / > <nl> + < source > Open a dialog for printing the structure of the opened database < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 2388 " / > <nl> + < source > Un / comment block of SQL code < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 2391 " / > <nl> + < source > Comment or uncomment current line or selected block of code < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 2394 " / > <nl> + < source > Comment or uncomment the selected lines or the current line , when there is no selection . All the block is toggled according to the first line . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 2397 " / > <nl> + < source > Ctrl + / < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 2406 " / > <nl> + < source > Stop SQL execution < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . ui " line = " 2409 " / > <nl> + < source > Stop the currently running SQL script < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . cpp " line = " 308 " / > <nl> + < source > Ctrl + L < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . cpp " line = " 313 " / > <nl> + < source > Ctrl + D < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . cpp " line = " 318 " / > <nl> + < source > Ctrl + I < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . cpp " line = " 323 " / > <nl> + < source > Ctrl + E < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . cpp " line = " 347 " / > <nl> + < source > The database is currenctly busy . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . cpp " line = " 353 " / > <nl> + < source > Click here to interrupt the currently running query . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . cpp " line = " 361 " / > <nl> + < source > Encrypted < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . cpp " line = " 362 " / > <nl> + < source > Database is encrypted using SQLCipher < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . cpp " line = " 368 " / > <nl> + < source > Read only < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . cpp " line = " 369 " / > <nl> + < source > Database file is read only . Editing the database is disabled . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . cpp " line = " 375 " / > <nl> + < source > Database encoding < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . cpp " line = " 510 " / > <nl> + < location filename = " . . / MainWindow . cpp " line = " 2974 " / > <nl> + < source > Choose a database file < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . cpp " line = " 551 " / > <nl> + < source > Could not open database file . <nl> + Reason : % 1 < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . cpp " line = " 565 " / > <nl> + < location filename = " . . / MainWindow . cpp " line = " 1679 " / > <nl> + < location filename = " . . / MainWindow . cpp " line = " 2856 " / > <nl> + < source > Choose a filename to save under < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . cpp " line = " 586 " / > <nl> + < source > In - Memory database < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . cpp " line = " 850 " / > <nl> + < source > You are still executing SQL statements . When closing the database now the execution will be stopped . maybe leaving the database in an incosistent state . Are you sure you want to close the database ? < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . cpp " line = " 946 " / > <nl> + < source > Error deleting record : <nl> + % 1 < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . cpp " line = " 955 " / > <nl> + < source > Please select a record first < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . cpp " line = " 1043 " / > <nl> + < source > determining row count . . . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . cpp " line = " 1046 " / > <nl> + < source > % 1 - % 2 of & gt ; = % 3 < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . cpp " line = " 1050 " / > <nl> + < source > % 1 - % 2 of % 3 < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . cpp " line = " 1087 " / > <nl> + < location filename = " . . / MainWindow . cpp " line = " 1101 " / > <nl> + < source > There is no database opened . Please open or create a new database file . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . cpp " line = " 1126 " / > <nl> + < source > Are you sure you want to delete the table & apos ; % 1 & apos ; ? <nl> + All data associated with the table will be lost . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . cpp " line = " 1128 " / > <nl> + < source > Are you sure you want to delete the view & apos ; % 1 & apos ; ? < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . cpp " line = " 1130 " / > <nl> + < source > Are you sure you want to delete the trigger & apos ; % 1 & apos ; ? < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . cpp " line = " 1132 " / > <nl> + < source > Are you sure you want to delete the index & apos ; % 1 & apos ; ? < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . cpp " line = " 1143 " / > <nl> + < source > Error : could not delete the table . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . cpp " line = " 1145 " / > <nl> + < source > Error : could not delete the view . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . cpp " line = " 1147 " / > <nl> + < source > Error : could not delete the trigger . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . cpp " line = " 1149 " / > <nl> + < source > Error : could not delete the index . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . cpp " line = " 1151 " / > <nl> + < source > Message from database engine : <nl> + % 1 < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . cpp " line = " 1180 " / > <nl> + < source > Editing the table requires to save all pending changes now . <nl> + Are you sure you want to save the database ? < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . cpp " line = " 1199 " / > <nl> + < source > Error checking foreign keys after table modification . The changes will be reverted . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . cpp " line = " 1202 " / > <nl> + < source > This table did not pass a foreign - key check . & lt ; br / & gt ; You should run & apos ; Tools | Foreign - Key Check & apos ; and fix the reported issues . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . cpp " line = " 1311 " / > <nl> + < source > You are already executing SQL statements . Do you want to stop them in order to execute the current statements instead ? Note that this might leave the database in an inconsistent state . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . cpp " line = " 1358 " / > <nl> + < source > - - EXECUTING SELECTION IN & apos ; % 1 & apos ; <nl> + - - < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . cpp " line = " 1379 " / > <nl> + < source > - - EXECUTING LINE IN & apos ; % 1 & apos ; <nl> + - - < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . cpp " line = " 1387 " / > <nl> + < source > - - EXECUTING ALL IN & apos ; % 1 & apos ; <nl> + - - < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . cpp " line = " 1417 " / > <nl> + < source > - - At line % 1 : <nl> + % 3 <nl> + - - Result : % 2 < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . cpp " line = " 1467 " / > <nl> + < source > % 1 rows returned in % 2ms < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . cpp " line = " 1473 " / > <nl> + < source > Setting PRAGMA values or vacuuming will commit your current transaction . <nl> + Are you sure ? < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . cpp " line = " 1491 " / > <nl> + < source > Execution finished with errors . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . cpp " line = " 1493 " / > <nl> + < source > Execution finished without errors . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . cpp " line = " 1552 " / > <nl> + < source > Choose text files < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . cpp " line = " 1553 " / > <nl> + < source > Text files ( * . csv * . txt ) ; ; All files ( * ) < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . cpp " line = " 1627 " / > <nl> + < source > Error while saving the database file . This means that not all changes to the database were saved . You need to resolve the following error first . <nl> + <nl> + % 1 < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . cpp " line = " 1636 " / > <nl> + < source > Are you sure you want to undo all changes made to the database file & apos ; % 1 & apos ; since the last save ? < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . cpp " line = " 1661 " / > <nl> + < source > Choose a file to import < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . cpp " line = " 1662 " / > <nl> + < location filename = " . . / MainWindow . cpp " line = " 2177 " / > <nl> + < location filename = " . . / MainWindow . cpp " line = " 2238 " / > <nl> + < source > Text files ( * . sql * . txt ) ; ; All files ( * ) < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . cpp " line = " 1672 " / > <nl> + < source > Do you want to create a new database file to hold the imported data ? <nl> + If you answer no we will attempt to import the data in the SQL file to the current database . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . cpp " line = " 1683 " / > <nl> + < source > File % 1 already exists . Please choose a different name . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . cpp " line = " 1705 " / > <nl> + < source > Error importing data : % 1 < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . cpp " line = " 1707 " / > <nl> + < source > Import completed . Some foreign key constraints are violated . Please fix them before saving . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . cpp " line = " 1709 " / > <nl> + < source > Import completed . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . cpp " line = " 1773 " / > <nl> + < source > Delete View < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . cpp " line = " 1774 " / > <nl> + < source > Modify View < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . cpp " line = " 1776 " / > <nl> + < source > Delete Trigger < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . cpp " line = " 1777 " / > <nl> + < source > Modify Trigger < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . cpp " line = " 1779 " / > <nl> + < source > Delete Index < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . cpp " line = " 1780 " / > <nl> + < source > Modify Index < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . cpp " line = " 1783 " / > <nl> + < source > Modify Table < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . cpp " line = " 1838 " / > <nl> + < source > & amp ; % 1 % 2 < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . cpp " line = " 2064 " / > <nl> + < source > Setting PRAGMA values will commit your current transaction . <nl> + Are you sure ? < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . cpp " line = " 2113 " / > <nl> + < source > The statements in this tab are still executing . Closing the tab will stop the execution . This might leave the database in an inconsistent state . Are you sure you want to close the tab ? < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . cpp " line = " 2176 " / > <nl> + < source > Select SQL file to open < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . cpp " line = " 2185 " / > <nl> + < source > Couldn & apos ; t read file : % 1 . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . cpp " line = " 2223 " / > <nl> + < source > Couldn & apos ; t save file : % 1 . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . cpp " line = " 2237 " / > <nl> + < source > Select file name < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . cpp " line = " 2263 " / > <nl> + < source > Select extension file < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . cpp " line = " 2264 " / > <nl> + < source > Extensions ( * . so * . dylib * . dll ) ; ; All files ( * ) < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . cpp " line = " 2270 " / > <nl> + < source > Extension successfully loaded . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . cpp " line = " 2272 " / > <nl> + < source > Error loading extension : % 1 < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . cpp " line = " 2357 " / > <nl> + < location filename = " . . / MainWindow . cpp " line = " 2680 " / > <nl> + < source > Don & apos ; t show again < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . cpp " line = " 2360 " / > <nl> + < source > New version available . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . cpp " line = " 2361 " / > <nl> + < source > A new DB Browser for SQLite version is available ( % 1 . % 2 . % 3 ) . & lt ; br / & gt ; & lt ; br / & gt ; Please download at & lt ; a href = & apos ; % 4 & apos ; & gt ; % 4 & lt ; / a & gt ; . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . cpp " line = " 2571 " / > <nl> + < source > Choose a project file to open < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . cpp " line = " 2572 " / > <nl> + < location filename = " . . / MainWindow . cpp " line = " 2857 " / > <nl> + < source > DB Browser for SQLite project file ( * . sqbpro ) < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . cpp " line = " 2684 " / > <nl> + < source > This project file is using an old file format because it was created using DB Browser for SQLite version 3 . 10 or lower . Loading this file format is still fully supported but we advice you to convert all your project files to the new file format because support for older formats might be dropped at some point in the future . You can convert your files by simply opening and re - saving them . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . cpp " line = " 3178 " / > <nl> + < source > Duplicate records < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . cpp " line = " 3178 " / > <nl> + < source > Duplicate record < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . cpp " line = " 3183 " / > <nl> + < source > Ctrl + & quot ; < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . cpp " line = " 3280 " / > <nl> + < source > Please choose a new encoding for all tables . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . cpp " line = " 3282 " / > <nl> + < source > Please choose a new encoding for this table . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . cpp " line = " 3285 " / > <nl> + < source > % 1 <nl> + Leave the field empty for using the database encoding . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . cpp " line = " 3297 " / > <nl> + < source > This encoding is either not valid or not supported . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . cpp " line = " 3353 " / > <nl> + < source > Please enter a pseudo - primary key in order to enable editing on this view . This should be the name of a unique column in the view . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . cpp " line = " 3458 " / > <nl> + < source > Collation needed ! Proceed ? < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . cpp " line = " 3459 " / > <nl> + < source > A table in this database requires a special collation function & apos ; % 1 & apos ; that this application can & apos ; t provide without further knowledge . <nl> + If you choose to proceed , be aware bad things can happen to your database . <nl> + Create a backup ! < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . cpp " line = " 3464 " / > <nl> + < source > creating collation < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . cpp " line = " 3473 " / > <nl> + < source > Set a new name for the SQL tab . Use the & apos ; & amp ; & amp ; & apos ; character to allow using the following character as a keyboard shortcut . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . cpp " line = " 3525 " / > <nl> + < source > Please specify the view name < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . cpp " line = " 3529 " / > <nl> + < source > There is already an object with that name . Please choose a different name . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . cpp " line = " 3536 " / > <nl> + < source > View successfully created . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . cpp " line = " 3538 " / > <nl> + < source > Error creating view : % 1 < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . cpp " line = " 3553 " / > <nl> + < source > There is no filter set for this table . View will not be created . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . cpp " line = " 3591 " / > <nl> + < source > Delete Records < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . cpp " line = " 3598 " / > <nl> + < source > This action will open a new SQL tab for running : < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . cpp " line = " 3600 " / > <nl> + < source > Press Help for opening the corresponding SQLite reference page . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / MainWindow . cpp " line = " 3712 " / > <nl> + < source > Busy ( % 1 ) < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < / context > <nl> + < context > <nl> + < name > NullLineEdit < / name > <nl> + < message > <nl> + < location filename = " . . / AddRecordDialog . cpp " line = " 39 " / > <nl> + < source > Set to NULL < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / AddRecordDialog . cpp " line = " 43 " / > <nl> + < source > Alt + Del < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < / context > <nl> + < context > <nl> + < name > PlotDock < / name > <nl> + < message > <nl> + < location filename = " . . / PlotDock . ui " line = " 14 " / > <nl> + < source > Plot < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PlotDock . ui " line = " 30 " / > <nl> + < source > & lt ; html & gt ; & lt ; head / & gt ; & lt ; body & gt ; & lt ; p & gt ; This pane shows the list of columns of the currently browsed table or the just executed query . You can select the columns that you want to be used as X or Y axis for the plot pane below . The table shows detected axis type that will affect the resulting plot . For the Y axis you can only select numeric columns , but for the X axis you will be able to select : & lt ; / p & gt ; & lt ; ul style = & quot ; margin - top : 0px ; margin - bottom : 0px ; margin - left : 0px ; margin - right : 0px ; - qt - list - indent : 1 ; & quot ; & gt ; & lt ; li style = & quot ; margin - top : 12px ; margin - bottom : 0px ; margin - left : 0px ; margin - right : 0px ; - qt - block - indent : 0 ; text - indent : 0px ; & quot ; & gt ; & lt ; span style = & quot ; font - weight : 600 ; & quot ; & gt ; Date / Time & lt ; / span & gt ; : strings with format & amp ; quot ; yyyy - MM - dd hh : mm : ss & amp ; quot ; or & amp ; quot ; yyyy - MM - ddThh : mm : ss & amp ; quot ; & lt ; / li & gt ; & lt ; li style = & quot ; margin - top : 0px ; margin - bottom : 0px ; margin - left : 0px ; margin - right : 0px ; - qt - block - indent : 0 ; text - indent : 0px ; & quot ; & gt ; & lt ; span style = & quot ; font - weight : 600 ; & quot ; & gt ; Date & lt ; / span & gt ; : strings with format & amp ; quot ; yyyy - MM - dd & amp ; quot ; & lt ; / li & gt ; & lt ; li style = & quot ; margin - top : 0px ; margin - bottom : 0px ; margin - left : 0px ; margin - right : 0px ; - qt - block - indent : 0 ; text - indent : 0px ; & quot ; & gt ; & lt ; span style = & quot ; font - weight : 600 ; & quot ; & gt ; Time & lt ; / span & gt ; : strings with format & amp ; quot ; hh : mm : ss & amp ; quot ; & lt ; / li & gt ; & lt ; li style = & quot ; margin - top : 0px ; margin - bottom : 0px ; margin - left : 0px ; margin - right : 0px ; - qt - block - indent : 0 ; text - indent : 0px ; & quot ; & gt ; & lt ; span style = & quot ; font - weight : 600 ; & quot ; & gt ; Label & lt ; / span & gt ; : other string formats . Selecting this column as X axis will produce a Bars plot with the column values as labels for the bars & lt ; / li & gt ; & lt ; li style = & quot ; margin - top : 0px ; margin - bottom : 12px ; margin - left : 0px ; margin - right : 0px ; - qt - block - indent : 0 ; text - indent : 0px ; & quot ; & gt ; & lt ; span style = & quot ; font - weight : 600 ; & quot ; & gt ; Numeric & lt ; / span & gt ; : integer or real values & lt ; / li & gt ; & lt ; / ul & gt ; & lt ; p & gt ; Double - clicking the Y cells you can change the used color for that graph . & lt ; / p & gt ; & lt ; / body & gt ; & lt ; / html & gt ; < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PlotDock . ui " line = " 46 " / > <nl> + < source > Columns < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PlotDock . ui " line = " 51 " / > <nl> + < source > X < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PlotDock . ui " line = " 56 " / > <nl> + < source > Y < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PlotDock . ui " line = " 61 " / > <nl> + < source > Axis Type < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PlotDock . ui " line = " 73 " / > <nl> + < source > Here is a plot drawn when you select the x and y values above . <nl> + <nl> + Click on points to select them in the plot and in the table . Ctrl + Click for selecting a range of points . <nl> + <nl> + Use mouse - wheel for zooming and mouse drag for changing the axis range . <nl> + <nl> + Select the axes or axes labels to drag and zoom only in that orientation . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PlotDock . ui " line = " 89 " / > <nl> + < source > Line type : < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PlotDock . ui " line = " 118 " / > <nl> + < location filename = " . . / PlotDock . ui " line = " 165 " / > <nl> + < source > None < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PlotDock . ui " line = " 123 " / > <nl> + < source > Line < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PlotDock . ui " line = " 128 " / > <nl> + < source > StepLeft < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PlotDock . ui " line = " 133 " / > <nl> + < source > StepRight < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PlotDock . ui " line = " 138 " / > <nl> + < source > StepCenter < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PlotDock . ui " line = " 143 " / > <nl> + < source > Impulse < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PlotDock . ui " line = " 151 " / > <nl> + < source > Point shape : < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PlotDock . ui " line = " 170 " / > <nl> + < source > Cross < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PlotDock . ui " line = " 175 " / > <nl> + < source > Plus < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PlotDock . ui " line = " 180 " / > <nl> + < source > Circle < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PlotDock . ui " line = " 185 " / > <nl> + < source > Disc < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PlotDock . ui " line = " 190 " / > <nl> + < source > Square < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PlotDock . ui " line = " 195 " / > <nl> + < source > Diamond < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PlotDock . ui " line = " 200 " / > <nl> + < source > Star < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PlotDock . ui " line = " 205 " / > <nl> + < source > Triangle < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PlotDock . ui " line = " 210 " / > <nl> + < source > TriangleInverted < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PlotDock . ui " line = " 215 " / > <nl> + < source > CrossSquare < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PlotDock . ui " line = " 220 " / > <nl> + < source > PlusSquare < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PlotDock . ui " line = " 225 " / > <nl> + < source > CrossCircle < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PlotDock . ui " line = " 230 " / > <nl> + < source > PlusCircle < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PlotDock . ui " line = " 235 " / > <nl> + < source > Peace < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PlotDock . ui " line = " 256 " / > <nl> + < source > & lt ; html & gt ; & lt ; head / & gt ; & lt ; body & gt ; & lt ; p & gt ; Save current plot . . . & lt ; / p & gt ; & lt ; p & gt ; File format chosen by extension ( png , jpg , pdf , bmp ) & lt ; / p & gt ; & lt ; / body & gt ; & lt ; / html & gt ; < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PlotDock . ui " line = " 259 " / > <nl> + < source > Save current plot . . . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PlotDock . ui " line = " 285 " / > <nl> + < location filename = " . . / PlotDock . cpp " line = " 448 " / > <nl> + < source > Load all data and redraw plot < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PlotDock . cpp " line = " 54 " / > <nl> + < source > Copy < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PlotDock . cpp " line = " 61 " / > <nl> + < source > Print . . . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PlotDock . cpp " line = " 68 " / > <nl> + < source > Show legend < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PlotDock . cpp " line = " 74 " / > <nl> + < source > Stacked bars < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PlotDock . cpp " line = " 153 " / > <nl> + < source > Date / Time < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PlotDock . cpp " line = " 156 " / > <nl> + < source > Date < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PlotDock . cpp " line = " 159 " / > <nl> + < source > Time < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PlotDock . cpp " line = " 162 " / > <nl> + < location filename = " . . / PlotDock . cpp " line = " 206 " / > <nl> + < source > Numeric < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PlotDock . cpp " line = " 165 " / > <nl> + < source > Label < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PlotDock . cpp " line = " 169 " / > <nl> + < source > Invalid < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PlotDock . cpp " line = " 204 " / > <nl> + < location filename = " . . / PlotDock . cpp " line = " 417 " / > <nl> + < location filename = " . . / PlotDock . cpp " line = " 430 " / > <nl> + < source > Row # < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PlotDock . cpp " line = " 443 " / > <nl> + < source > Load all data and redraw plot . <nl> + Warning : not all data has been fetched from the table yet due to the partial fetch mechanism . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PlotDock . cpp " line = " 529 " / > <nl> + < source > Choose an axis color < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PlotDock . cpp " line = " 563 " / > <nl> + < source > Choose a filename to save under < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PlotDock . cpp " line = " 564 " / > <nl> + < source > PNG ( * . png ) ; ; JPG ( * . jpg ) ; ; PDF ( * . pdf ) ; ; BMP ( * . bmp ) ; ; All Files ( * ) < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PlotDock . cpp " line = " 600 " / > <nl> + < source > There are curves in this plot and the selected line style can only be applied to graphs sorted by X . Either sort the table or query by X to remove curves or select one of the styles supported by curves : None or Line . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < / context > <nl> + < context > <nl> + < name > PreferencesDialog < / name > <nl> + < message > <nl> + < location filename = " . . / PreferencesDialog . ui " line = " 14 " / > <nl> + < source > Preferences < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PreferencesDialog . ui " line = " 27 " / > <nl> + < source > & amp ; General < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PreferencesDialog . ui " line = " 33 " / > <nl> + < source > Default & amp ; location < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PreferencesDialog . ui " line = " 46 " / > <nl> + < source > Remember last location < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PreferencesDialog . ui " line = " 51 " / > <nl> + < source > Always use this location < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PreferencesDialog . ui " line = " 56 " / > <nl> + < source > Remember last location for session only < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PreferencesDialog . ui " line = " 85 " / > <nl> + < location filename = " . . / PreferencesDialog . ui " line = " 1369 " / > <nl> + < location filename = " . . / PreferencesDialog . ui " line = " 1489 " / > <nl> + < source > . . . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PreferencesDialog . ui " line = " 96 " / > <nl> + < source > Lan & amp ; guage < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PreferencesDialog . ui " line = " 128 " / > <nl> + < source > Toolbar style < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PreferencesDialog . ui " line = " 160 " / > <nl> + < source > Only display the icon < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PreferencesDialog . ui " line = " 165 " / > <nl> + < source > Only display the text < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PreferencesDialog . ui " line = " 170 " / > <nl> + < source > The text appears beside the icon < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PreferencesDialog . ui " line = " 175 " / > <nl> + < source > The text appears under the icon < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PreferencesDialog . ui " line = " 180 " / > <nl> + < source > Follow the style < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PreferencesDialog . ui " line = " 188 " / > <nl> + < location filename = " . . / PreferencesDialog . ui " line = " 208 " / > <nl> + < location filename = " . . / PreferencesDialog . ui " line = " 289 " / > <nl> + < location filename = " . . / PreferencesDialog . ui " line = " 309 " / > <nl> + < location filename = " . . / PreferencesDialog . ui " line = " 1128 " / > <nl> + < location filename = " . . / PreferencesDialog . ui " line = " 1148 " / > <nl> + < location filename = " . . / PreferencesDialog . ui " line = " 1168 " / > <nl> + < location filename = " . . / PreferencesDialog . ui " line = " 1188 " / > <nl> + < source > enabled < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PreferencesDialog . ui " line = " 198 " / > <nl> + < source > Automatic & amp ; updates < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PreferencesDialog . ui " line = " 215 " / > <nl> + < source > DB file extensions < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PreferencesDialog . ui " line = " 225 " / > <nl> + < source > Manage < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PreferencesDialog . ui " line = " 232 " / > <nl> + < source > Show remote options < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PreferencesDialog . ui " line = " 243 " / > <nl> + < source > & amp ; Database < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PreferencesDialog . ui " line = " 252 " / > <nl> + < source > Database & amp ; encoding < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PreferencesDialog . ui " line = " 276 " / > <nl> + < source > Open databases with foreign keys enabled . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PreferencesDialog . ui " line = " 279 " / > <nl> + < source > & amp ; Foreign keys < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PreferencesDialog . ui " line = " 296 " / > <nl> + < source > Remove line breaks in schema & amp ; view < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PreferencesDialog . ui " line = " 306 " / > <nl> + < source > When enabled , the line breaks in the Schema column of the DB Structure tab , dock and printed output are removed . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PreferencesDialog . ui " line = " 316 " / > <nl> + < source > Prefetch block si & amp ; ze < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PreferencesDialog . ui " line = " 336 " / > <nl> + < source > Advanced < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PreferencesDialog . ui " line = " 366 " / > <nl> + < source > SQ & amp ; L to execute after opening database < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PreferencesDialog . ui " line = " 392 " / > <nl> + < source > Default field type < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PreferencesDialog . ui " line = " 403 " / > <nl> + < source > Data & amp ; Browser < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PreferencesDialog . ui " line = " 411 " / > <nl> + < source > Font < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PreferencesDialog . ui " line = " 417 " / > <nl> + < source > & amp ; Font < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PreferencesDialog . ui " line = " 430 " / > <nl> + < source > Font si & amp ; ze < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PreferencesDialog . ui " line = " 446 " / > <nl> + < source > Content < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PreferencesDialog . ui " line = " 452 " / > <nl> + < source > Symbol limit in cell < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PreferencesDialog . ui " line = " 484 " / > <nl> + < location filename = " . . / PreferencesDialog . ui " line = " 488 " / > <nl> + < source > This is the maximum number of rows in a table for enabling the value completion based on current values in the column . <nl> + Can be set to 0 for disabling completion . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PreferencesDialog . ui " line = " 502 " / > <nl> + < source > Row count threshold for completion < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PreferencesDialog . ui " line = " 515 " / > <nl> + < source > Field display < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PreferencesDialog . ui " line = " 521 " / > <nl> + < source > Displayed & amp ; text < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PreferencesDialog . ui " line = " 534 " / > <nl> + < source > Binary < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PreferencesDialog . ui " line = " 544 " / > <nl> + < source > NULL < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PreferencesDialog . ui " line = " 554 " / > <nl> + < source > Regular < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PreferencesDialog . ui " line = " 580 " / > <nl> + < source > Text color < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PreferencesDialog . ui " line = " 606 " / > <nl> + < source > Background color < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PreferencesDialog . ui " line = " 709 " / > <nl> + < source > Preview only ( N / A ) < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PreferencesDialog . ui " line = " 743 " / > <nl> + < source > Filters < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PreferencesDialog . ui " line = " 756 " / > <nl> + < source > Escape character < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PreferencesDialog . ui " line = " 766 " / > <nl> + < source > Delay time ( & amp ; ms ) < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PreferencesDialog . ui " line = " 776 " / > <nl> + < source > Set the waiting time before a new filter value is applied . Can be set to 0 for disabling waiting . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PreferencesDialog . ui " line = " 792 " / > <nl> + < source > & amp ; SQL < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PreferencesDialog . ui " line = " 805 " / > <nl> + < source > Settings name < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PreferencesDialog . ui " line = " 810 " / > <nl> + < source > Context < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PreferencesDialog . ui " line = " 815 " / > <nl> + < source > Colour < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PreferencesDialog . ui " line = " 820 " / > <nl> + < source > Bold < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PreferencesDialog . ui " line = " 825 " / > <nl> + < source > Italic < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PreferencesDialog . ui " line = " 830 " / > <nl> + < source > Underline < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PreferencesDialog . ui " line = " 838 " / > <nl> + < source > Keyword < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PreferencesDialog . ui " line = " 858 " / > <nl> + < source > Function < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PreferencesDialog . ui " line = " 866 " / > <nl> + < source > Table < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PreferencesDialog . ui " line = " 886 " / > <nl> + < source > Comment < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PreferencesDialog . ui " line = " 906 " / > <nl> + < source > Identifier < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PreferencesDialog . ui " line = " 926 " / > <nl> + < source > String < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PreferencesDialog . ui " line = " 946 " / > <nl> + < source > Current line < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PreferencesDialog . ui " line = " 954 " / > <nl> + < source > Background < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PreferencesDialog . ui " line = " 962 " / > <nl> + < source > Foreground < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PreferencesDialog . ui " line = " 972 " / > <nl> + < source > SQL editor & amp ; font < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PreferencesDialog . ui " line = " 987 " / > <nl> + < source > SQL & amp ; editor font size < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PreferencesDialog . ui " line = " 1009 " / > <nl> + < source > SQL & amp ; results font size < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PreferencesDialog . ui " line = " 1026 " / > <nl> + < source > Tab size < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PreferencesDialog . ui " line = " 1049 " / > <nl> + < source > & amp ; Wrap lines < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PreferencesDialog . ui " line = " 1060 " / > <nl> + < source > Never < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PreferencesDialog . ui " line = " 1065 " / > <nl> + < source > At word boundaries < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PreferencesDialog . ui " line = " 1070 " / > <nl> + < source > At character boundaries < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PreferencesDialog . ui " line = " 1075 " / > <nl> + < source > At whitespace boundaries < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PreferencesDialog . ui " line = " 1083 " / > <nl> + < source > & amp ; Quotes for identifiers < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PreferencesDialog . ui " line = " 1093 " / > <nl> + < source > Choose the quoting mechanism used by the application for identifiers in SQL code . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PreferencesDialog . ui " line = " 1100 " / > <nl> + < source > & quot ; Double quotes & quot ; - Standard SQL ( recommended ) < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PreferencesDialog . ui " line = " 1105 " / > <nl> + < source > ` Grave accents ` - Traditional MySQL quotes < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PreferencesDialog . ui " line = " 1110 " / > <nl> + < source > [ Square brackets ] - Traditional MS SQL Server quotes < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PreferencesDialog . ui " line = " 1118 " / > <nl> + < source > Code co & amp ; mpletion < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PreferencesDialog . ui " line = " 1135 " / > <nl> + < source > Keywords in & amp ; UPPER CASE < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PreferencesDialog . ui " line = " 1145 " / > <nl> + < source > When set , the SQL keywords are completed in UPPER CASE letters . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PreferencesDialog . ui " line = " 1155 " / > <nl> + < source > Error indicators < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PreferencesDialog . ui " line = " 1165 " / > <nl> + < source > When set , the SQL code lines that caused errors during the last execution are highlighted and the results frame indicates the error in the background < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PreferencesDialog . ui " line = " 1175 " / > <nl> + < source > Hori & amp ; zontal tiling < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PreferencesDialog . ui " line = " 1185 " / > <nl> + < source > If enabled the SQL code editor and the result table view are shown side by side instead of one over the other . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PreferencesDialog . ui " line = " 1198 " / > <nl> + < source > & amp ; Extensions < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PreferencesDialog . ui " line = " 1204 " / > <nl> + < source > Select extensions to load for every database : < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PreferencesDialog . ui " line = " 1225 " / > <nl> + < source > Add extension < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PreferencesDialog . ui " line = " 1236 " / > <nl> + < source > Remove extension < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PreferencesDialog . ui " line = " 1264 " / > <nl> + < source > & lt ; html & gt ; & lt ; head / & gt ; & lt ; body & gt ; & lt ; p & gt ; While supporting the REGEXP operator SQLite doesn & apos ; t implement any regular expression & lt ; br / & gt ; algorithm but calls back the running application . DB Browser for SQLite implements this & lt ; br / & gt ; algorithm for you to let you use REGEXP out of the box . However , as there are multiple possible & lt ; br / & gt ; implementations of this and you might want to use another one , you & apos ; re free to disable the & lt ; br / & gt ; application & apos ; s implementation and load your own by using an extension . Requires restart of the application . & lt ; / p & gt ; & lt ; / body & gt ; & lt ; / html & gt ; < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PreferencesDialog . ui " line = " 1267 " / > <nl> + < source > Disable Regular Expression extension < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PreferencesDialog . ui " line = " 1274 " / > <nl> + < source > & lt ; html & gt ; & lt ; head / & gt ; & lt ; body & gt ; & lt ; p & gt ; SQLite provides an SQL function for loading extensions from a shared library file . Activate this if you want to use the & lt ; span style = & quot ; font - style : italic ; & quot ; & gt ; load_extension ( ) & lt ; / span & gt ; function from SQL code . & lt ; / p & gt ; & lt ; p & gt ; For security reasons , extension loading is turned off by default and must be enabled through this setting . You can always load extensions through the GUI , even though this option is disabled . & lt ; / p & gt ; & lt ; / body & gt ; & lt ; / html & gt ; < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PreferencesDialog . ui " line = " 1277 " / > <nl> + < source > Allow loading extensions from SQL code < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PreferencesDialog . ui " line = " 1285 " / > <nl> + < source > Remote < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PreferencesDialog . ui " line = " 1295 " / > <nl> + < source > Your certificates < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PreferencesDialog . ui " line = " 1320 " / > <nl> + < source > File < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PreferencesDialog . ui " line = " 1325 " / > <nl> + < location filename = " . . / PreferencesDialog . ui " line = " 1421 " / > <nl> + < source > Subject CN < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PreferencesDialog . ui " line = " 1328 " / > <nl> + < source > Subject Common Name < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PreferencesDialog . ui " line = " 1333 " / > <nl> + < source > Issuer CN < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PreferencesDialog . ui " line = " 1336 " / > <nl> + < source > Issuer Common Name < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PreferencesDialog . ui " line = " 1341 " / > <nl> + < location filename = " . . / PreferencesDialog . ui " line = " 1437 " / > <nl> + < source > Valid from < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PreferencesDialog . ui " line = " 1346 " / > <nl> + < location filename = " . . / PreferencesDialog . ui " line = " 1442 " / > <nl> + < source > Valid to < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PreferencesDialog . ui " line = " 1351 " / > <nl> + < location filename = " . . / PreferencesDialog . ui " line = " 1447 " / > <nl> + < source > Serial number < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PreferencesDialog . ui " line = " 1396 " / > <nl> + < source > CA certificates < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PreferencesDialog . ui " line = " 1424 " / > <nl> + < source > Common Name < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PreferencesDialog . ui " line = " 1429 " / > <nl> + < source > Subject O < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PreferencesDialog . ui " line = " 1432 " / > <nl> + < source > Organization < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PreferencesDialog . ui " line = " 1461 " / > <nl> + < source > Clone databases into < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PreferencesDialog . cpp " line = " 64 " / > <nl> + < location filename = " . . / PreferencesDialog . cpp " line = " 585 " / > <nl> + < source > Choose a directory < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PreferencesDialog . cpp " line = " 309 " / > <nl> + < source > The language will change after you restart the application . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PreferencesDialog . cpp " line = " 377 " / > <nl> + < source > Select extension file < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PreferencesDialog . cpp " line = " 378 " / > <nl> + < source > Extensions ( * . so * . dylib * . dll ) ; ; All files ( * ) < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PreferencesDialog . cpp " line = " 511 " / > <nl> + < source > Import certificate file < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PreferencesDialog . cpp " line = " 519 " / > <nl> + < source > No certificates found in this file . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PreferencesDialog . cpp " line = " 536 " / > <nl> + < source > Are you sure you want do remove this certificate ? All certificate data will be deleted from the application settings ! < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / PreferencesDialog . cpp " line = " 621 " / > <nl> + < source > Are you sure you want to clear all the saved settings ? <nl> + All your preferences will be lost and default values will be used . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < / context > <nl> + < context > <nl> + < name > QObject < / name > <nl> + < message > <nl> + < location filename = " . . / FileDialog . cpp " line = " 82 " / > <nl> + < source > All files ( * ) < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / ImportCsvDialog . cpp " line = " 115 " / > <nl> + < source > Error importing data < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / ImportCsvDialog . cpp " line = " 117 " / > <nl> + < source > from record number % 1 < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / ImportCsvDialog . cpp " line = " 118 " / > <nl> + < source > . <nl> + % 1 < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / ImportCsvDialog . cpp " line = " 132 " / > <nl> + < source > Importing CSV file . . . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / ImportCsvDialog . cpp " line = " 133 " / > <nl> + < source > Cancel < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / Settings . cpp " line = " 158 " / > <nl> + < source > SQLite database files ( * . db * . sqlite * . sqlite3 * . db3 ) < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < / context > <nl> + < context > <nl> + < name > RemoteDatabase < / name > <nl> + < message > <nl> + < location filename = " . . / RemoteDatabase . cpp " line = " 107 " / > <nl> + < source > Error when connecting to % 1 . <nl> + % 2 < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / RemoteDatabase . cpp " line = " 268 " / > <nl> + < source > Error opening remote file at % 1 . <nl> + % 2 < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / RemoteDatabase . cpp " line = " 341 " / > <nl> + < source > Error : Invalid client certificate specified . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / RemoteDatabase . cpp " line = " 353 " / > <nl> + < source > Please enter the passphrase for this client certificate in order to authenticate . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / RemoteDatabase . cpp " line = " 377 " / > <nl> + < source > Cancel < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / RemoteDatabase . cpp " line = " 381 " / > <nl> + < source > Uploading remote database to <nl> + % 1 < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / RemoteDatabase . cpp " line = " 383 " / > <nl> + < source > Downloading remote database from <nl> + % 1 < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / RemoteDatabase . cpp " line = " 400 " / > <nl> + < location filename = " . . / RemoteDatabase . cpp " line = " 453 " / > <nl> + < source > Error : The network is not accessible . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / RemoteDatabase . cpp " line = " 462 " / > <nl> + < source > Error : Cannot open the file for sending . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / RemoteDatabase . cpp " line = " 554 " / > <nl> + < source > Error opening local databases list . <nl> + % 1 < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / RemoteDatabase . cpp " line = " 572 " / > <nl> + < source > Error creating local databases list . <nl> + % 1 < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / RemoteDatabase . cpp " line = " 760 " / > <nl> + < source > The remote database has been updated since the last checkout . Do you want to update the local database to the newest version ? Note that this discards any changes you have made locally ! If you don & apos ; t want to lose local changes , click No to open the local version . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < / context > <nl> + < context > <nl> + < name > RemoteDock < / name > <nl> + < message > <nl> + < location filename = " . . / RemoteDock . ui " line = " 14 " / > <nl> + < source > Remote < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / RemoteDock . ui " line = " 29 " / > <nl> + < source > Identity < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / RemoteDock . ui " line = " 46 " / > <nl> + < source > Connect to the remote server using the currently selected identity . The correct server is taken from the identity as well . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / RemoteDock . ui " line = " 49 " / > <nl> + < source > Go < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / RemoteDock . ui " line = " 73 " / > <nl> + < source > Push currently opened database to server < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / RemoteDock . ui " line = " 86 " / > <nl> + < source > & lt ; html & gt ; & lt ; head / & gt ; & lt ; body & gt ; & lt ; p & gt ; In this pane , remote databases from dbhub . io website can be added to DB4S . First you need an identity : & lt ; / p & gt ; & lt ; ol style = & quot ; margin - top : 0px ; margin - bottom : 0px ; margin - left : 0px ; margin - right : 0px ; - qt - list - indent : 1 ; & quot ; & gt ; & lt ; li style = & quot ; margin - top : 12px ; margin - bottom : 0px ; margin - left : 0px ; margin - right : 0px ; - qt - block - indent : 0 ; text - indent : 0px ; & quot ; & gt ; Login to the dbhub . io website ( use your GitHub credentials or whatever you want ) & lt ; / li & gt ; & lt ; li style = & quot ; margin - top : 0px ; margin - bottom : 0px ; margin - left : 0px ; margin - right : 0px ; - qt - block - indent : 0 ; text - indent : 0px ; & quot ; & gt ; Click the button to create a DB4S certificate ( that & apos ; s your identity ) . That & apos ; ll give you a certificate file ( save it to your local disk ) . & lt ; / li & gt ; & lt ; li style = & quot ; margin - top : 0px ; margin - bottom : 12px ; margin - left : 0px ; margin - right : 0px ; - qt - block - indent : 0 ; text - indent : 0px ; & quot ; & gt ; Go to the Remote tab in DB4S Preferences . Click the button to add a new certificate to DB4S and choose the just downloaded certificate file . & lt ; / li & gt ; & lt ; / ol & gt ; & lt ; p & gt ; Now the Remote panel shows your identity and you can add remote databases . & lt ; / p & gt ; & lt ; / body & gt ; & lt ; / html & gt ; < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / RemoteDock . ui " line = " 125 " / > <nl> + < source > & lt ; html & gt ; & lt ; head / & gt ; & lt ; body & gt ; & lt ; p & gt ; No DBHub . io account yet ? & lt ; a href = & quot ; https : / / dbhub . io / & quot ; & gt ; & lt ; span style = & quot ; text - decoration : underline ; color : # 007af4 ; & quot ; & gt ; Create one now & lt ; / span & gt ; & lt ; / a & gt ; and import your certificate & lt ; a href = & quot ; # preferences & quot ; & gt ; & lt ; span style = & quot ; text - decoration : underline ; color : # 007af4 ; & quot ; & gt ; here & lt ; / span & gt ; & lt ; / a & gt ; to share your databases . & lt ; / p & gt ; & lt ; p & gt ; For online help visit & lt ; a href = & quot ; https : / / dbhub . io / about & quot ; & gt ; & lt ; span style = & quot ; text - decoration : underline ; color : # 007af4 ; & quot ; & gt ; here & lt ; / span & gt ; & lt ; / a & gt ; . & lt ; / p & gt ; & lt ; / body & gt ; & lt ; / html & gt ; < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < / context > <nl> + < context > <nl> + < name > RemoteModel < / name > <nl> + < message > <nl> + < location filename = " . . / RemoteModel . cpp " line = " 100 " / > <nl> + < source > Name < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / RemoteModel . cpp " line = " 100 " / > <nl> + < source > Commit < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / RemoteModel . cpp " line = " 100 " / > <nl> + < source > Last modified < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / RemoteModel . cpp " line = " 100 " / > <nl> + < source > Size < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / RemoteModel . cpp " line = " 240 " / > <nl> + < source > bytes < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < / context > <nl> + < context > <nl> + < name > RemotePushDialog < / name > <nl> + < message > <nl> + < location filename = " . . / RemotePushDialog . ui " line = " 14 " / > <nl> + < source > Push database < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / RemotePushDialog . ui " line = " 22 " / > <nl> + < source > Database na & amp ; me to push to < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / RemotePushDialog . ui " line = " 39 " / > <nl> + < source > Commit message < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / RemotePushDialog . ui " line = " 49 " / > <nl> + < source > & lt ; ! DOCTYPE HTML PUBLIC & quot ; - / / W3C / / DTD HTML 4 . 0 / / EN & quot ; & quot ; http : / / www . w3 . org / TR / REC - html40 / strict . dtd & quot ; & gt ; <nl> + & lt ; html & gt ; & lt ; head & gt ; & lt ; meta name = & quot ; qrichtext & quot ; content = & quot ; 1 & quot ; / & gt ; & lt ; style type = & quot ; text / css & quot ; & gt ; <nl> + p , li { white - space : pre - wrap ; } <nl> + & lt ; / style & gt ; & lt ; / head & gt ; & lt ; body style = & quot ; font - family : & apos ; Oxygen - Sans & apos ; ; font - size : 10pt ; font - weight : 400 ; font - style : normal ; & quot ; & gt ; <nl> + & lt ; p style = & quot ; - qt - paragraph - type : empty ; margin - top : 0px ; margin - bottom : 0px ; margin - left : 0px ; margin - right : 0px ; - qt - block - indent : 0 ; text - indent : 0px ; & quot ; & gt ; & lt ; br / & gt ; & lt ; / p & gt ; & lt ; / body & gt ; & lt ; / html & gt ; < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / RemotePushDialog . ui " line = " 63 " / > <nl> + < source > Database licence < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / RemotePushDialog . ui " line = " 83 " / > <nl> + < source > Public < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / RemotePushDialog . ui " line = " 96 " / > <nl> + < source > Branch < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / RemotePushDialog . ui " line = " 116 " / > <nl> + < source > Force push < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / RemotePushDialog . cpp " line = " 47 " / > <nl> + < source > Database will be public . Everyone has read access to it . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / RemotePushDialog . cpp " line = " 49 " / > <nl> + < source > Database will be private . Only you have access to it . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / RemotePushDialog . cpp " line = " 53 " / > <nl> + < source > Use with care . This can cause remote commits to be deleted . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / RemotePushDialog . cpp " line = " 111 " / > <nl> + < source > Unspecified < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < / context > <nl> + < context > <nl> + < name > RunSql < / name > <nl> + < message > <nl> + < location filename = " . . / RunSql . cpp " line = " 120 " / > <nl> + < source > Execution aborted by user < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / RunSql . cpp " line = " 204 " / > <nl> + < source > , % 1 rows affected < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / RunSql . cpp " line = " 218 " / > <nl> + < source > query executed successfully . Took % 1ms % 2 < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / RunSql . cpp " line = " 298 " / > <nl> + < source > executing query < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < / context > <nl> + < context > <nl> + < name > SqlExecutionArea < / name > <nl> + < message > <nl> + < location filename = " . . / SqlExecutionArea . ui " line = " 14 " / > <nl> + < source > Form < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / SqlExecutionArea . ui " line = " 66 " / > <nl> + < source > Find previous match [ Shift + F3 ] < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / SqlExecutionArea . ui " line = " 69 " / > <nl> + < source > Find previous match with mapping < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / SqlExecutionArea . ui " line = " 76 " / > <nl> + < source > Shift + F3 < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / SqlExecutionArea . ui " line = " 90 " / > <nl> + < source > The found pattern must be a whole word < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / SqlExecutionArea . ui " line = " 93 " / > <nl> + < source > Whole Words < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / SqlExecutionArea . ui " line = " 103 " / > <nl> + < source > Text pattern to find considering the checks in this frame < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / SqlExecutionArea . ui " line = " 106 " / > <nl> + < source > Find in editor < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / SqlExecutionArea . ui " line = " 116 " / > <nl> + < source > The found pattern must match in letter case < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / SqlExecutionArea . ui " line = " 119 " / > <nl> + < source > Case Sensitive < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / SqlExecutionArea . ui " line = " 126 " / > <nl> + < source > Find next match [ Enter , F3 ] < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / SqlExecutionArea . ui " line = " 129 " / > <nl> + < source > Find next match with wrapping < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / SqlExecutionArea . ui " line = " 136 " / > <nl> + < source > F3 < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / SqlExecutionArea . ui " line = " 143 " / > <nl> + < source > Interpret search pattern as a regular expression < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / SqlExecutionArea . ui " line = " 146 " / > <nl> + < source > & lt ; html & gt ; & lt ; head / & gt ; & lt ; body & gt ; & lt ; p & gt ; When checked , the pattern to find is interpreted as a UNIX regular expression . See & lt ; a href = & quot ; https : / / en . wikibooks . org / wiki / Regular_Expressions & quot ; & gt ; Regular Expression in Wikibooks & lt ; / a & gt ; . & lt ; / p & gt ; & lt ; / body & gt ; & lt ; / html & gt ; < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / SqlExecutionArea . ui " line = " 149 " / > <nl> + < source > Regular Expression < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / SqlExecutionArea . ui " line = " 169 " / > <nl> + < location filename = " . . / SqlExecutionArea . ui " line = " 172 " / > <nl> + < source > Close Find Bar < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / SqlExecutionArea . ui " line = " 217 " / > <nl> + < location filename = " . . / SqlExecutionArea . ui " line = " 238 " / > <nl> + < source > Results of the last executed statements < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / SqlExecutionArea . ui " line = " 220 " / > <nl> + < source > This field shows the results and status codes of the last executed statements . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < / context > <nl> + < context > <nl> + < name > SqlTextEdit < / name > <nl> + < message > <nl> + < location filename = " . . / sqltextedit . cpp " line = " 37 " / > <nl> + < source > Ctrl + / < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < / context > <nl> + < context > <nl> + < name > SqlUiLexer < / name > <nl> + < message > <nl> + < location filename = " . . / SqlUiLexer . cpp " line = " 67 " / > <nl> + < source > ( X ) The abs ( X ) function returns the absolute value of the numeric argument X . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / SqlUiLexer . cpp " line = " 68 " / > <nl> + < source > ( ) The changes ( ) function returns the number of database rows that were changed or inserted or deleted by the most recently completed INSERT , DELETE , or UPDATE statement . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / SqlUiLexer . cpp " line = " 69 " / > <nl> + < source > ( X1 , X2 , . . . ) The char ( X1 , X2 , . . . , XN ) function returns a string composed of characters having the unicode code point values of integers X1 through XN , respectively . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / SqlUiLexer . cpp " line = " 70 " / > <nl> + < source > ( X , Y , . . . ) The coalesce ( ) function returns a copy of its first non - NULL argument , or NULL if all arguments are NULL < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / SqlUiLexer . cpp " line = " 71 " / > <nl> + < source > ( X , Y ) The glob ( X , Y ) function is equivalent to the expression & quot ; Y GLOB X & quot ; . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / SqlUiLexer . cpp " line = " 72 " / > <nl> + < source > ( X , Y ) The ifnull ( ) function returns a copy of its first non - NULL argument , or NULL if both arguments are NULL . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / SqlUiLexer . cpp " line = " 73 " / > <nl> + < source > ( X , Y ) The instr ( X , Y ) function finds the first occurrence of string Y within string X and returns the number of prior characters plus 1 , or 0 if Y is nowhere found within X . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / SqlUiLexer . cpp " line = " 74 " / > <nl> + < source > ( X ) The hex ( ) function interprets its argument as a BLOB and returns a string which is the upper - case hexadecimal rendering of the content of that blob . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / SqlUiLexer . cpp " line = " 75 " / > <nl> + < source > ( ) The last_insert_rowid ( ) function returns the ROWID of the last row insert from the database connection which invoked the function . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / SqlUiLexer . cpp " line = " 76 " / > <nl> + < source > ( X ) For a string value X , the length ( X ) function returns the number of characters ( not bytes ) in X prior to the first NUL character . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / SqlUiLexer . cpp " line = " 77 " / > <nl> + < source > ( X , Y ) The like ( ) function is used to implement the & quot ; Y LIKE X & quot ; expression . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / SqlUiLexer . cpp " line = " 78 " / > <nl> + < source > ( X , Y , Z ) The like ( ) function is used to implement the & quot ; Y LIKE X ESCAPE Z & quot ; expression . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / SqlUiLexer . cpp " line = " 79 " / > <nl> + < source > ( X ) The load_extension ( X ) function loads SQLite extensions out of the shared library file named X . <nl> + Use of this function must be authorized from Preferences . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / SqlUiLexer . cpp " line = " 80 " / > <nl> + < source > ( X , Y ) The load_extension ( X ) function loads SQLite extensions out of the shared library file named X using the entry point Y . <nl> + Use of this function must be authorized from Preferences . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / SqlUiLexer . cpp " line = " 81 " / > <nl> + < source > ( X ) The lower ( X ) function returns a copy of string X with all ASCII characters converted to lower case . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / SqlUiLexer . cpp " line = " 82 " / > <nl> + < source > ( X ) ltrim ( X ) removes spaces from the left side of X . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / SqlUiLexer . cpp " line = " 83 " / > <nl> + < source > ( X , Y ) The ltrim ( X , Y ) function returns a string formed by removing any and all characters that appear in Y from the left side of X . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / SqlUiLexer . cpp " line = " 84 " / > <nl> + < source > ( X , Y , . . . ) The multi - argument max ( ) function returns the argument with the maximum value , or return NULL if any argument is NULL . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / SqlUiLexer . cpp " line = " 85 " / > <nl> + < source > ( X , Y , . . . ) The multi - argument min ( ) function returns the argument with the minimum value . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / SqlUiLexer . cpp " line = " 86 " / > <nl> + < source > ( X , Y ) The nullif ( X , Y ) function returns its first argument if the arguments are different and NULL if the arguments are the same . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / SqlUiLexer . cpp " line = " 87 " / > <nl> + < source > ( FORMAT , . . . ) The printf ( FORMAT , . . . ) SQL function works like the sqlite3_mprintf ( ) C - language function and the printf ( ) function from the standard C library . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / SqlUiLexer . cpp " line = " 88 " / > <nl> + < source > ( X ) The quote ( X ) function returns the text of an SQL literal which is the value of its argument suitable for inclusion into an SQL statement . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / SqlUiLexer . cpp " line = " 89 " / > <nl> + < source > ( ) The random ( ) function returns a pseudo - random integer between - 9223372036854775808 and + 9223372036854775807 . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / SqlUiLexer . cpp " line = " 90 " / > <nl> + < source > ( N ) The randomblob ( N ) function return an N - byte blob containing pseudo - random bytes . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / SqlUiLexer . cpp " line = " 91 " / > <nl> + < source > ( X , Y , Z ) The replace ( X , Y , Z ) function returns a string formed by substituting string Z for every occurrence of string Y in string X . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / SqlUiLexer . cpp " line = " 92 " / > <nl> + < source > ( X ) The round ( X ) function returns a floating - point value X rounded to zero digits to the right of the decimal point . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / SqlUiLexer . cpp " line = " 93 " / > <nl> + < source > ( X , Y ) The round ( X , Y ) function returns a floating - point value X rounded to Y digits to the right of the decimal point . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / SqlUiLexer . cpp " line = " 94 " / > <nl> + < source > ( X ) rtrim ( X ) removes spaces from the right side of X . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / SqlUiLexer . cpp " line = " 95 " / > <nl> + < source > ( X , Y ) The rtrim ( X , Y ) function returns a string formed by removing any and all characters that appear in Y from the right side of X . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / SqlUiLexer . cpp " line = " 96 " / > <nl> + < source > ( X ) The soundex ( X ) function returns a string that is the soundex encoding of the string X . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / SqlUiLexer . cpp " line = " 97 " / > <nl> + < source > ( X , Y ) substr ( X , Y ) returns all characters through the end of the string X beginning with the Y - th . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / SqlUiLexer . cpp " line = " 98 " / > <nl> + < source > ( X , Y , Z ) The substr ( X , Y , Z ) function returns a substring of input string X that begins with the Y - th character and which is Z characters long . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / SqlUiLexer . cpp " line = " 99 " / > <nl> + < source > ( ) The total_changes ( ) function returns the number of row changes caused by INSERT , UPDATE or DELETE statements since the current database connection was opened . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / SqlUiLexer . cpp " line = " 100 " / > <nl> + < source > ( X ) trim ( X ) removes spaces from both ends of X . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / SqlUiLexer . cpp " line = " 101 " / > <nl> + < source > ( X , Y ) The trim ( X , Y ) function returns a string formed by removing any and all characters that appear in Y from both ends of X . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / SqlUiLexer . cpp " line = " 102 " / > <nl> + < source > ( X ) The typeof ( X ) function returns a string that indicates the datatype of the expression X . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / SqlUiLexer . cpp " line = " 103 " / > <nl> + < source > ( X ) The unicode ( X ) function returns the numeric unicode code point corresponding to the first character of the string X . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / SqlUiLexer . cpp " line = " 104 " / > <nl> + < source > ( X ) The upper ( X ) function returns a copy of input string X in which all lower - case ASCII characters are converted to their upper - case equivalent . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / SqlUiLexer . cpp " line = " 105 " / > <nl> + < source > ( N ) The zeroblob ( N ) function returns a BLOB consisting of N bytes of 0x00 . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / SqlUiLexer . cpp " line = " 107 " / > <nl> + < location filename = " . . / SqlUiLexer . cpp " line = " 108 " / > <nl> + < location filename = " . . / SqlUiLexer . cpp " line = " 109 " / > <nl> + < location filename = " . . / SqlUiLexer . cpp " line = " 110 " / > <nl> + < source > ( timestring , modifier , modifier , . . . ) < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / SqlUiLexer . cpp " line = " 111 " / > <nl> + < source > ( format , timestring , modifier , modifier , . . . ) < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / SqlUiLexer . cpp " line = " 113 " / > <nl> + < source > ( X ) The avg ( ) function returns the average value of all non - NULL X within a group . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / SqlUiLexer . cpp " line = " 114 " / > <nl> + < source > ( X ) The count ( X ) function returns a count of the number of times that X is not NULL in a group . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / SqlUiLexer . cpp " line = " 115 " / > <nl> + < source > ( X ) The group_concat ( ) function returns a string which is the concatenation of all non - NULL values of X . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / SqlUiLexer . cpp " line = " 116 " / > <nl> + < source > ( X , Y ) The group_concat ( ) function returns a string which is the concatenation of all non - NULL values of X . If parameter Y is present then it is used as the separator between instances of X . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / SqlUiLexer . cpp " line = " 117 " / > <nl> + < source > ( X ) The max ( ) aggregate function returns the maximum value of all values in the group . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / SqlUiLexer . cpp " line = " 118 " / > <nl> + < source > ( X ) The min ( ) aggregate function returns the minimum non - NULL value of all values in the group . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / SqlUiLexer . cpp " line = " 119 " / > <nl> + < location filename = " . . / SqlUiLexer . cpp " line = " 120 " / > <nl> + < source > ( X ) The sum ( ) and total ( ) aggregate functions return sum of all non - NULL values in the group . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / SqlUiLexer . cpp " line = " 122 " / > <nl> + < source > ( ) The number of the row within the current partition . Rows are numbered starting from 1 in the order defined by the ORDER BY clause in the window definition , or in arbitrary order otherwise . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / SqlUiLexer . cpp " line = " 123 " / > <nl> + < source > ( ) The row_number ( ) of the first peer in each group - the rank of the current row with gaps . If there is no ORDER BY clause , then all rows are considered peers and this function always returns 1 . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / SqlUiLexer . cpp " line = " 124 " / > <nl> + < source > ( ) The number of the current row & apos ; s peer group within its partition - the rank of the current row without gaps . Partitions are numbered starting from 1 in the order defined by the ORDER BY clause in the window definition . If there is no ORDER BY clause , then all rows are considered peers and this function always returns 1 . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / SqlUiLexer . cpp " line = " 125 " / > <nl> + < source > ( ) Despite the name , this function always returns a value between 0 . 0 and 1 . 0 equal to ( rank - 1 ) / ( partition - rows - 1 ) , where rank is the value returned by built - in window function rank ( ) and partition - rows is the total number of rows in the partition . If the partition contains only one row , this function returns 0 . 0 . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / SqlUiLexer . cpp " line = " 126 " / > <nl> + < source > ( ) The cumulative distribution . Calculated as row - number / partition - rows , where row - number is the value returned by row_number ( ) for the last peer in the group and partition - rows the number of rows in the partition . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / SqlUiLexer . cpp " line = " 127 " / > <nl> + < source > ( N ) Argument N is handled as an integer . This function divides the partition into N groups as evenly as possible and assigns an integer between 1 and N to each group , in the order defined by the ORDER BY clause , or in arbitrary order otherwise . If necessary , larger groups occur first . This function returns the integer value assigned to the group that the current row is a part of . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / SqlUiLexer . cpp " line = " 128 " / > <nl> + < source > ( expr ) Returns the result of evaluating expression expr against the previous row in the partition . Or , if there is no previous row ( because the current row is the first ) , NULL . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / SqlUiLexer . cpp " line = " 129 " / > <nl> + < source > ( expr , offset ) If the offset argument is provided , then it must be a non - negative integer . In this case the value returned is the result of evaluating expr against the row offset rows before the current row within the partition . If offset is 0 , then expr is evaluated against the current row . If there is no row offset rows before the current row , NULL is returned . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / SqlUiLexer . cpp " line = " 130 " / > <nl> + < location filename = " . . / SqlUiLexer . cpp " line = " 133 " / > <nl> + < source > ( expr , offset , default ) If default is also provided , then it is returned instead of NULL if the row identified by offset does not exist . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / SqlUiLexer . cpp " line = " 131 " / > <nl> + < source > ( expr ) Returns the result of evaluating expression expr against the next row in the partition . Or , if there is no next row ( because the current row is the last ) , NULL . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / SqlUiLexer . cpp " line = " 132 " / > <nl> + < source > ( expr , offset ) If the offset argument is provided , then it must be a non - negative integer . In this case the value returned is the result of evaluating expr against the row offset rows after the current row within the partition . If offset is 0 , then expr is evaluated against the current row . If there is no row offset rows after the current row , NULL is returned . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / SqlUiLexer . cpp " line = " 134 " / > <nl> + < source > ( expr ) This built - in window function calculates the window frame for each row in the same way as an aggregate window function . It returns the value of expr evaluated against the first row in the window frame for each row . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / SqlUiLexer . cpp " line = " 135 " / > <nl> + < source > ( expr ) This built - in window function calculates the window frame for each row in the same way as an aggregate window function . It returns the value of expr evaluated against the last row in the window frame for each row . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / SqlUiLexer . cpp " line = " 136 " / > <nl> + < source > ( expr , N ) This built - in window function calculates the window frame for each row in the same way as an aggregate window function . It returns the value of expr evaluated against the row N of the window frame . Rows are numbered within the window frame starting from 1 in the order defined by the ORDER BY clause if one is present , or in arbitrary order otherwise . If there is no Nth row in the partition , then NULL is returned . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < / context > <nl> + < context > <nl> + < name > SqliteTableModel < / name > <nl> + < message > <nl> + < location filename = " . . / sqlitetablemodel . cpp " line = " 27 " / > <nl> + < source > reading rows < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / sqlitetablemodel . cpp " line = " 264 " / > <nl> + < source > loading . . . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / sqlitetablemodel . cpp " line = " 327 " / > <nl> + < source > References % 1 ( % 2 ) <nl> + Hold % 3Shift and click to jump there < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / sqlitetablemodel . cpp " line = " 427 " / > <nl> + < source > Error changing data : <nl> + % 1 < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / sqlitetablemodel . cpp " line = " 666 " / > <nl> + < source > retrieving list of columns < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / sqlitetablemodel . cpp " line = " 848 " / > <nl> + < source > Fetching data . . . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / sqlitetablemodel . cpp " line = " 849 " / > <nl> + < source > Cancel < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < / context > <nl> + < context > <nl> + < name > VacuumDialog < / name > <nl> + < message > <nl> + < location filename = " . . / VacuumDialog . ui " line = " 14 " / > <nl> + < source > Compact Database < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / VacuumDialog . ui " line = " 26 " / > <nl> + < source > Warning : Compacting the database will commit all of your changes . < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / VacuumDialog . ui " line = " 39 " / > <nl> + < source > Please select the databases to co & amp ; mpact : < / source > <nl> + < translation type = " unfinished " > < / translation > <nl> + < / message > <nl> + < / context > <nl> + < / TS > <nl>
Generate a new . ts file for Persian
sqlitebrowser/sqlitebrowser
df33455fda61171f1f62a89047692a3c047357db
2018-12-15T03:49:09Z
mmm a / drivers / javascript / net . coffee <nl> ppp b / drivers / javascript / net . coffee <nl> class TcpConnection extends Connection <nl> pbkdf2_cache [ cache_string ] = u <nl> return u <nl> <nl> + # a , b should be strings <nl> compare_digest = ( a , b ) - > <nl> left = undefined <nl> right = b <nl> class TcpConnection extends Connection <nl> if a . length is b . length <nl> left = a <nl> result = 0 <nl> - else <nl> + if a . length ! = b . length <nl> left = b <nl> result = 1 <nl> <nl> - len = Math . min ( a . length , b . length ) <nl> + len = Math . min ( left . length , right . length ) <nl> for i in [ 0 . . . len ] <nl> - result | = xor_bytes ( a [ i ] , b [ i ] ) <nl> + result | = left [ i ] ^ right [ i ] <nl> <nl> return result is 0 <nl> <nl>
compare_digest fix ( for )
rethinkdb/rethinkdb
6d19d937654707ab3f3aa3573a600b684e716f01
2016-08-04T00:55:23Z
new file mode 100644 <nl> index 00000000000 . . 2a52de886f8 <nl> mmm / dev / null <nl> ppp b / dbms / tests / performance / simple / system_numbers . xml <nl> <nl> + < test > <nl> + < name > wip < / name > <nl> + < type > once < / type > <nl> + < stop_conditions > <nl> + < any_of > <nl> + < ! - - This is only for infinite running query . - - > <nl> + < average_speed_not_changing_for_ms > 10000 < / average_speed_not_changing_for_ms > <nl> + < total_time_ms > 1000 < / total_time_ms > <nl> + < / any_of > <nl> + < / stop_conditions > <nl> + < metrics > <nl> + < ! - - For running one inifinite query - - > <nl> + < max_rows_per_second / > <nl> + < max_bytes_per_second / > <nl> + < avg_rows_per_second / > <nl> + < avg_bytes_per_second / > <nl> + < / metrics > <nl> + <nl> + < ! - - <nl> + 9 . Π“Π΅Π½Π΅Ρ€Π°Ρ‚ΠΎΡ€ случайных чисСл . <nl> + Ѐункция rand прСдставляСт собой linear congruential generator ( Ρ‚ΠΎ Π΅ΡΡ‚ΡŒ , цСлочислСнноС ΡƒΠΌΠ½ΠΎΠΆΠ΅Π½ΠΈΠ΅ Π½Π° константу ΠΈ слоТСниС с константой ) , Π²ΠΎΠ·Π²Ρ€Π°Ρ‰Π°ΡŽΡ‰ΠΈΠΉ 32 - Π±ΠΈΡ‚Π½Ρ‹Π΅ Ρ†Π΅Π»Ρ‹Π΅ случайныС числа . <nl> + Она Ρ€Π΅Π°Π»ΠΈΠ·ΠΎΠ²Π°Π½Π° Ρ‚Π°ΠΊ , Ρ‡Ρ‚ΠΎΠ±Ρ‹ нСсколько ΠΏΠΎΡ‚ΠΎΠΊΠΎΠ² случайных чисСл Π²Ρ‹Ρ‡ΠΈΡΠ»ΡΠ»ΠΎΡΡŒ нСзависимо , ΠΈ компилятор ΠΌΠΎΠ³ Π²Π΅ΠΊΡ‚ΠΎΡ€ΠΈΠ·ΠΎΠ²Π°Ρ‚ΡŒ Ρ†ΠΈΠΊΠ» . <nl> + ВСст , ΠΊΠ°ΠΊ ΠΈ ΠΌΠ½ΠΎΠ³ΠΈΠ΅ Π΄Ρ€ΡƒΠ³ΠΈΠ΅ Π½ΠΈΠΆΠ΅ , прСдставлСн Π² Π²ΠΈΠ΄Π΅ запроса ΠΈΠ· Ρ‚Π°Π±Π»ΠΈΡ†Ρ‹ system . numbers . Π§Ρ‚Π΅Π½ΠΈΠ΅ ΠΈΠ· этой Ρ‚Π°Π±Π»ΠΈΡ†Ρ‹ осущСствляСтся Π² ΠΎΠ΄ΠΈΠ½ ΠΏΠΎΡ‚ΠΎΠΊ , ΠΈ эта Ρ‚Π°Π±Π»ΠΈΡ†Π° ΠΏΡ€ΠΈ Ρ‡Ρ‚Π΅Π½ΠΈΠΈ Π²Ρ‹Π΄Π°Ρ‘Ρ‚ подряд ΠΏΠΎΡ‡Ρ‚ΠΈ всС Π½Π°Ρ‚ΡƒΡ€Π°Π»ΡŒΠ½Ρ‹Π΅ числа . <nl> + Π’ΠΎ Π΅ΡΡ‚ΡŒ , этот запрос прСдставляСт собой Π½Π΅ΠΎΠ±Ρ‹Ρ‡Π½Ρ‹ΠΌ ΠΎΠ±Ρ€Π°Π·ΠΎΠΌ написанный бСсконСчный Ρ†ΠΈΠΊΠ» . <nl> + ΠœΡ‹ запускаСм этот запрос ΠΈ наблюдаСм , с ΠΊΠ°ΠΊΠΎΠΉ ΡΠΊΠΎΡ€ΠΎΡΡ‚ΡŒΡŽ ΠΎΠ½ выполняСтся . Π§Π΅Ρ€Π΅Π· нСсколько сСкунд , ΠΊΠΎΠ³Π΄Π° ΡΠΊΠΎΡ€ΠΎΡΡ‚ΡŒ стабилизируСтся , ΠΏΡ€Π΅Ρ€Ρ‹Π²Π°Π΅ΠΌ Π²Ρ‹ΠΏΠΎΠ»Π½Π΅Π½ΠΈΠ΅ . <nl> + Π’ качСствС скорости выполнСния запроса указываСтся количСство ΠΎΠ±Ρ€Π°Π±ΠΎΡ‚Π°Π½Π½Ρ‹Ρ… исходных ( ΠΏΡ€ΠΎΡ‡ΠΈΡ‚Π°Π½Π½Ρ‹Ρ… ΠΈΠ· Ρ‚Π°Π±Π»ΠΈΡ†Ρ‹ ) Π΄Π°Π½Π½Ρ‹Ρ… Π² Π΅Π΄ΠΈΠ½ΠΈΡ†Ρƒ Π²Ρ€Π΅ΠΌΠ΅Π½ΠΈ . <nl> + НапримСр , Π² Ρ‚Π°Π±Π»ΠΈΡ†Π΅ system . numbers Ρ‡ΠΈΡ‚Π°Π΅ΠΌΡ‹Π΅ Π½Π°ΠΌΠΈ Π΄Π°Π½Π½Ρ‹Π΅ - это числа Ρ‚ΠΈΠΏΠ° UInt64 ( 8 Π±Π°ΠΉΡ‚ ) . Если ΠΌΡ‹ ΠΎΠ±Ρ€Π°Π±Π°Ρ‚Ρ‹Π²Π°Π΅ΠΌ ΠΌΠΈΠ»Π»ΠΈΠ°Ρ€Π΄ Ρ‚Π°ΠΊΠΈΡ… чисСл Π² сСкунду , Ρ‚ΠΎ отобразится ΡΠΊΠΎΡ€ΠΎΡΡ‚ΡŒ - 8 GB / sec . <nl> + - - > <nl> + < query > SELECT count ( ) FROM system . numbers WHERE NOT ignore ( rand ( ) ) < / query > <nl> + < ! - - 10 . НСкриптографичСская Ρ…ΡΡˆ - функция для Ρ†Π΅Π»Ρ‹Ρ… чисСл 64bit - > 64bit . - - > <nl> + < query > SELECT count ( ) FROM system . numbers WHERE NOT ignore ( intHash64 ( number ) ) < / query > <nl> + < ! - - 11 . НСкриптографичСская Ρ…ΡΡˆ - функция для Ρ†Π΅Π»Ρ‹Ρ… чисСл 64bit - > 32bit . - - > <nl> + < query > SELECT count ( ) FROM system . numbers WHERE NOT ignore ( intHash32 ( number ) ) < / query > <nl> + < ! - - 12 . ΠŸΡ€Π΅ΠΎΠ±Ρ€Π°Π·ΠΎΠ²Π°Π½ΠΈΠ΅ Ρ†Π΅Π»ΠΎΠ³ΠΎ числа Π² строку Π² дСсятичном Π²ΠΈΠ΄Π΅ . - - > <nl> + < query > SELECT count ( ) FROM system . numbers WHERE NOT ignore ( toString ( number ) ) < / query > <nl> + < ! - - 13 . ΠŸΡ€Π΅ΠΎΠ±Ρ€Π°Π·ΠΎΠ²Π°Π½ΠΈΠ΅ Ρ†Π΅Π»ΠΎΠ³ΠΎ числа Π² строку ΠΏΡƒΡ‚Ρ‘ΠΌ копирования куска памяти . - - > <nl> + < query > SELECT count ( ) FROM system . numbers WHERE NOT ignore ( reinterpretAsString ( number ) ) < / query > <nl> + <nl> + < ! - - 26 . ЦСлочислСнноС Π΄Π΅Π»Π΅Π½ΠΈΠ΅ Π½Π° константу . Π˜ΡΠΏΠΎΠ»ΡŒΠ·ΡƒΠ΅Ρ‚ΡΡ Π±ΠΈΠ±Π»ΠΈΠΎΡ‚Π΅ΠΊΠ° libdivide . - - > <nl> + < query > SELECT count ( ) FROM system . numbers WHERE NOT ignore ( number / 7 ) < / query > <nl> + < ! - - 27 . ЦСлочислСнноС Π΄Π΅Π»Π΅Π½ΠΈΠ΅ Π½Π° константу . - - > <nl> + < query > SELECT count ( ) FROM system . numbers WHERE NOT ignore ( number % 7 ) < / query > <nl> + < ! - - 28 . ЦСлочислСнноС Π΄Π΅Π»Π΅Π½ΠΈΠ΅ Π½Π° константу . - - > <nl> + < query > SELECT count ( ) FROM system . numbers WHERE NOT ignore ( number % 34908756 ) < / query > <nl> + < ! - - 29 . Lookup - Ρ‚Π°Π±Π»ΠΈΡ†Π° , ΠΏΠΎΠΌΠ΅Ρ‰Π°ΡŽΡ‰Π°ΡΡΡ Π² L2 - кэш . - - > <nl> + < query > SELECT number % 1000 AS k , count ( ) FROM system . numbers GROUP BY k < / query > <nl> + < ! - - 30 . Π₯эш - Ρ‚Π°Π±Π»ΠΈΡ†Π° , ΠΏΠΎΠΌΠ΅Ρ‰Π°ΡŽΡ‰Π°ΡΡΡ Π² L3 - кэш . - - > <nl> + < query > SELECT number % 100000 AS k , count ( ) FROM system . numbers GROUP BY k < / query > <nl> + < ! - - 31 . Π₯эш - Ρ‚Π°Π±Π»ΠΈΡ†Π° , Π½Π°Π²Π΅Ρ€Π½ΠΎΠ΅ ΠΏΠΎΠΌΠ΅Ρ‰Π°ΡŽΡ‰Π°ΡΡΡ Π² L3 - кэш . - - > <nl> + < query > SELECT number % 1000000 AS k , count ( ) FROM system . numbers GROUP BY k < / query > <nl> + < ! - - 32 . Π₯эш - Ρ‚Π°Π±Π»ΠΈΡ†Π° , Π½Π΅ ΠΏΠΎΠΌΠ΅Ρ‰Π°ΡŽΡ‰Π°ΡΡΡ Π² L3 - кэш . - - > <nl> + < query > SELECT number % 10000000 AS k , count ( ) FROM system . numbers GROUP BY k < / query > <nl> + < ! - - 33 . Π₯эш - Ρ‚Π°Π±Π»ΠΈΡ†Π° , Ρ‚Ρ€Π΅Π±ΡƒΡŽΡ‰Π°Ρ ΠΊΡƒΡ‡Ρƒ ΠΎΠΏΠ΅Ρ€Π°Ρ‚ΠΈΠ²ΠΊΠΈ . Π’ΠΎΠ·ΠΌΠΎΠΆΠ½Ρ‹ интСрСсныС эффСкты . - - > <nl> + < query > SELECT number % 500000000 AS k , count ( ) FROM system . numbers GROUP BY k < / query > <nl> + <nl> + <nl> + < ! - - 35 . Кэш - ΠΏΡ€ΠΎΠΌΠ°Ρ…ΠΈ , осущСствляСмыС ΠΈΠ· ΠΌΠ½ΠΎΠ³ΠΈΡ… процСссорных ядСр . - - > <nl> + < ! - - < query > SELECT number % ( intDiv ( 100000000 , { THREADS } ) ) AS k , count ( ) FROM system . numbers_mt GROUP BY k < / query > - - > <nl> + < ! - - 46 . Запрос , Ρ‚Ρ€Π΅Π±ΡƒΡŽΡ‰ΠΈΠΉ ΠΌΠ½ΠΎΠ³ΠΎ бСсполСзных ΠΊΠΎΠΏΠΈΡ€ΠΎΠ²Π°Π½ΠΈΠΉ . - - > <nl> + < query > SELECT count ( ) FROM system . numbers WHERE NOT ignore ( materialize ( ' xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ' ) AS s , concat ( s , s , s , s , s , s , s , s , s , s ) AS t , concat ( t , t , t , t , t , t , t , t , t , t ) AS u ) SETTINGS max_block_size = 1000 < / query > <nl> + <nl> + < / test > <nl> new file mode 100644 <nl> index 00000000000 . . 2aebef8d71a <nl> mmm / dev / null <nl> ppp b / dbms / tests / performance / simple / test_hits . xml <nl> <nl> + < test > <nl> + < name > test . hits misc < / name > <nl> + < type > once < / type > <nl> + < stop_conditions > <nl> + < any_of > <nl> + < ! - - This is only for infinite running query . - - > <nl> + < average_speed_not_changing_for_ms > 10000 < / average_speed_not_changing_for_ms > <nl> + < total_time_ms > 1000 < / total_time_ms > <nl> + < / any_of > <nl> + < / stop_conditions > <nl> + < metrics > <nl> + < ! - - For running one inifinite query - - > <nl> + < max_rows_per_second / > <nl> + < max_bytes_per_second / > <nl> + < avg_rows_per_second / > <nl> + < avg_bytes_per_second / > <nl> + < / metrics > <nl> + < preconditions > <nl> + < table_exists > test . hits < / table_exists > <nl> + < / preconditions > <nl> + <nl> + < ! - - <nl> + 14 . НСкриптографичСская Ρ…ΡΡˆ - функция для строк нСбольшой Π΄Π»ΠΈΠ½Ρ‹ . <nl> + Π’ качСствС Π΄Π°Π½Π½Ρ‹Ρ… Π² ΡΠ»Π΅Π΄ΡƒΡŽΡ‰ΠΈΡ… тСстах Π±ΡƒΠ΄ΡƒΡ‚ ΠΈΡΠΏΠΎΠ»ΡŒΠ·ΠΎΠ²Π°Π½Ρ‹ поисковыС Ρ„Ρ€Π°Π·Ρ‹ ( SearchPhrase ) , URL ΠΈ PageCharset . <nl> + Π‘Ρ‚Ρ€ΠΎΠΊΠ° SearchPhrase нСпустая Ρ‚ΠΎΠ»ΡŒΠΊΠΎ Π² 6 . 8 % случаСв . БрСдняя Π΄Π»ΠΈΠ½Π° нСпустой строки - 47 Π±Π°ΠΉΡ‚ . <nl> + URL ΠΏΠΎΡ‡Ρ‚ΠΈ всСгда нСпуст ΠΈ Π΅Π³ΠΎ срСдняя Π΄Π»ΠΈΠ½Π° - 77 Π±Π°ΠΉΡ‚ . <nl> + PageCharset Ρ‚ΠΎΠΆΠ΅ ΠΏΠΎΡ‡Ρ‚ΠΈ всСгда нСпуст , Π½ΠΎ Π΅Π³ΠΎ срСдняя Π΄Π»ΠΈΠ½Π° помСньшС - 6 . 2 Π±Π°ΠΉΡ‚Π° . - - > <nl> + <nl> + < query > SELECT count ( ) FROM test . hits WHERE NOT ignore ( cityHash64 ( SearchPhrase ) ) SETTINGS max_threads = 1 < / query > <nl> + < ! - - 15 . НСкриптографичСская Ρ…ΡΡˆ - функция для строк нСбольшой Π΄Π»ΠΈΠ½Ρ‹ . - - > <nl> + <nl> + < query > SELECT count ( ) FROM test . hits WHERE NOT ignore ( farmHash64 ( SearchPhrase ) ) SETTINGS max_threads = 1 < / query > <nl> + < ! - - 16 . НСкриптографичСская Ρ…ΡΡˆ - функция для строк нСбольшой Π΄Π»ΠΈΠ½Ρ‹ . - - > <nl> + < query > SELECT count ( ) FROM test . hits WHERE NOT ignore ( metroHash64 ( SearchPhrase ) ) SETTINGS max_threads = 1 < / query > <nl> + < ! - - 17 . ΠšΡ€ΠΈΠΏΡ‚ΠΎΠ³Ρ€Π°Ρ„ΠΈΡ‡Π΅ΡΠΊΠ°Ρ Ρ…ΡΡˆ - функция для строк . - - > <nl> + < query > SELECT count ( ) FROM test . hits WHERE NOT ignore ( sipHash64 ( SearchPhrase ) ) SETTINGS max_threads = 1 < / query > <nl> + < ! - - 18 . ΠšΡ€ΠΈΠΏΡ‚ΠΎΠ³Ρ€Π°Ρ„ΠΈΡ‡Π΅ΡΠΊΠ°Ρ Ρ…ΡΡˆ - функция для строк . - - > <nl> + < query > SELECT count ( ) FROM test . hits WHERE NOT ignore ( MD5 ( SearchPhrase ) ) SETTINGS max_threads = 1 < / query > <nl> + < ! - - 19 . ΠšΡ€ΠΈΠΏΡ‚ΠΎΠ³Ρ€Π°Ρ„ΠΈΡ‡Π΅ΡΠΊΠ°Ρ Ρ…ΡΡˆ - функция для строк . - - > <nl> + < query > SELECT count ( ) FROM test . hits WHERE NOT ignore ( MD5 ( URL ) ) SETTINGS max_threads = 1 < / query > <nl> + < ! - - 20 . - - > <nl> + < query > SELECT count ( ) FROM test . hits WHERE NOT ignore ( cityHash64 ( URL ) ) SETTINGS max_threads = 1 < / query > <nl> + < ! - - 21 . - - > <nl> + < query > SELECT count ( ) FROM test . hits WHERE NOT ignore ( sipHash64 ( URL ) ) SETTINGS max_threads = 1 < / query > <nl> + < ! - - 22 . - - > <nl> + < query > SELECT count ( ) FROM test . hits WHERE NOT ignore ( cityHash64 ( PageCharset ) ) SETTINGS max_threads = 1 < / query > <nl> + < ! - - 23 . Поиск подстроки Π² строкС . - - > <nl> + < query > SELECT count ( ) FROM test . hits WHERE URL LIKE ' % metrika % ' SETTINGS max_threads = 1 < / query > <nl> + < ! - - 24 . Π‘ΠΎΠ»Π΅Π΅ слоТный поиск подстроки Π² строкС . - - > <nl> + < query > SELECT count ( ) FROM test . hits WHERE positionCaseInsensitiveUTF8 ( URL , ' новости ' ) ! = 0 SETTINGS max_threads = 1 < / query > <nl> + < ! - - 25 . РСгСксп . - - > <nl> + < query > SELECT count ( ) FROM test . hits WHERE match ( URL , ' ^ https ? : / / ( ? : www \ \ . ) ? metri [ kc ] a \ \ . yandex \ \ . ( ? : ru | com | com \ \ . tr | ua | by | kz ) / . + ? 2014 ' ) SETTINGS max_threads = 1 < / query > <nl> + <nl> + <nl> + < ! - - 34 . БлоТная агрСгация . - - > <nl> + < query > SELECT SearchEngineID , SearchPhrase , RegionID FROM test . hits GROUP BY SearchEngineID , SearchPhrase , RegionID ORDER BY count ( ) DESC LIMIT 10 SETTINGS max_threads = 1 < / query > <nl> + < ! - - 36 . Ѐункция для Ρ€Π°Π±ΠΎΡ‚Ρ‹ с Π΄Π°Ρ‚ΠΎΠΉ ΠΈ Π²Ρ€Π΅ΠΌΠ΅Π½Π΅ΠΌ . - - > <nl> + < query > SELECT count ( ) FROM test . hits WHERE NOT ignore ( toMonday ( EventTime ) ) SETTINGS max_threads = 1 < / query > <nl> + < ! - - 37 . Ѐункция для Ρ€Π°Π±ΠΎΡ‚Ρ‹ с URL . - - > <nl> + < query > SELECT count ( ) FROM test . hits WHERE NOT ignore ( cutQueryString ( URL ) ) SETTINGS max_threads = 1 < / query > <nl> + < ! - - 38 . Π Π°Π·Π½Ρ‹Π΅ Π°Π»Π³ΠΎΡ€ΠΈΡ‚ΠΌΡ‹ вычислСния ΠΊΠ²Π°Π½Ρ‚ΠΈΠ»Π΅ΠΉ . - - > <nl> + < query > SELECT quantilesIf ( 0 . 5 , 0 . 9 ) ( SendTiming , SendTiming > 0 ) FROM test . hits SETTINGS max_threads = 1 < / query > <nl> + < ! - - 39 . Π Π°Π·Π½Ρ‹Π΅ Π°Π»Π³ΠΎΡ€ΠΈΡ‚ΠΌΡ‹ вычислСния ΠΊΠ²Π°Π½Ρ‚ΠΈΠ»Π΅ΠΉ . - - > <nl> + < query > SELECT quantilesTimingIf ( 0 . 5 , 0 . 9 ) ( SendTiming , SendTiming > 0 ) FROM test . hits SETTINGS max_threads = 1 < / query > <nl> + < ! - - 40 . Π Π°Π·Π½Ρ‹Π΅ Π°Π»Π³ΠΎΡ€ΠΈΡ‚ΠΌΡ‹ вычислСния ΠΊΠ²Π°Π½Ρ‚ΠΈΠ»Π΅ΠΉ . - - > <nl> + < query > SELECT quantilesExactIf ( 0 . 5 , 0 . 9 ) ( SendTiming , SendTiming > 0 ) FROM test . hits SETTINGS max_threads = 1 < / query > <nl> + < ! - - 41 . Π Π°Π·Π½Ρ‹Π΅ Π°Π»Π³ΠΎΡ€ΠΈΡ‚ΠΌΡ‹ вычислСния ΠΊΠ²Π°Π½Ρ‚ΠΈΠ»Π΅ΠΉ . - - > <nl> + < query > SELECT quantilesTDigestIf ( 0 . 5 , 0 . 9 ) ( SendTiming , SendTiming > 0 ) FROM test . hits SETTINGS max_threads = 1 < / query > <nl> + < ! - - 42 . Π Π°Π·Π½Ρ‹Π΅ Π°Π»Π³ΠΎΡ€ΠΈΡ‚ΠΌΡ‹ вычислСния ΠΊΠ°Ρ€Π΄ΠΈΠ½Π°Π»ΡŒΠ½ΠΎΡΡ‚ΠΈ . - - > <nl> + < query > SELECT uniq ( UserID ) FROM test . hits SETTINGS max_threads = 1 < / query > <nl> + < ! - - 43 . Π Π°Π·Π½Ρ‹Π΅ Π°Π»Π³ΠΎΡ€ΠΈΡ‚ΠΌΡ‹ вычислСния ΠΊΠ°Ρ€Π΄ΠΈΠ½Π°Π»ΡŒΠ½ΠΎΡΡ‚ΠΈ . - - > <nl> + < query > SELECT uniqCombined ( UserID ) FROM test . hits SETTINGS max_threads = 1 < / query > <nl> + < ! - - 44 . Π Π°Π·Π½Ρ‹Π΅ Π°Π»Π³ΠΎΡ€ΠΈΡ‚ΠΌΡ‹ вычислСния ΠΊΠ°Ρ€Π΄ΠΈΠ½Π°Π»ΡŒΠ½ΠΎΡΡ‚ΠΈ . - - > <nl> + < query > SELECT uniqExact ( UserID ) FROM test . hits SETTINGS max_threads = 1 < / query > <nl> + < ! - - 45 . Π§Ρ‚ΠΎ - Ρ‚ΠΎ Ρ‡ΡƒΡ‚ΡŒ Π±ΠΎΠ»Π΅Π΅ ΠΏΠΎΡ…ΠΎΠΆΠ΅Π΅ Π½Π° Ρ€Π΅Π°Π»ΡŒΠ½Ρ‹ΠΉ запрос . - - > <nl> + < query > SELECT RegionID , uniq ( UserID ) FROM test . hits GROUP BY RegionID SETTINGS max_threads = 1 < / query > <nl> + < ! - - 47 . Π§ΠΈΡ‚Π°Π΅ΠΌ ΠΈ Ρ€Π°Π·ΠΆΠΈΠΌΠ°Π΅ΠΌ всС столбцы , ΠΈ Π½ΠΈΡ‡Π΅Π³ΠΎ с Π½ΠΈΠΌΠΈ ΠΏΠΎΡ‚ΠΎΠΌ Π½Π΅ Π΄Π΅Π»Π°Π΅ΠΌ . - - > <nl> + < query > SELECT count ( ) FROM test . hits WHERE NOT ignore ( * ) SETTINGS max_threads = 1 < / query > <nl> + <nl> + < / test > <nl>
Add some perf tests
ClickHouse/ClickHouse
bab4b3b042765fb68b91e8643fd702b8c35a3759
2017-07-18T16:35:01Z
mmm a / src / google / protobuf / io / gzip_stream . h <nl> ppp b / src / google / protobuf / io / gzip_stream . h <nl> class LIBPROTOBUF_EXPORT GzipOutputStream : public ZeroCopyOutputStream { <nl> ZLIB = 2 , <nl> } ; <nl> <nl> - struct Options { <nl> + struct LIBPROTOBUF_EXPORT Options { <nl> / / Defaults to GZIP . <nl> Format format ; <nl> <nl>
Set LIBPROTOBUF_EXPORT on GzipOutputStream : : Options
protocolbuffers/protobuf
a101fa52895fc2ad83d8b5d610243531b1608a08
2017-01-20T23:39:34Z
mmm a / src / core / ext / filters / client_channel / lb_policy / xds / xds_client_stats . h <nl> ppp b / src / core / ext / filters / client_channel / lb_policy / xds / xds_client_stats . h <nl> class XdsLocalityName : public RefCounted < XdsLocalityName > { <nl> public : <nl> struct Less { <nl> bool operator ( ) ( const RefCountedPtr < XdsLocalityName > & lhs , <nl> - const RefCountedPtr < XdsLocalityName > & rhs ) { <nl> + const RefCountedPtr < XdsLocalityName > & rhs ) const { <nl> int cmp_result = strcmp ( lhs - > region_ . get ( ) , rhs - > region_ . get ( ) ) ; <nl> if ( cmp_result ! = 0 ) return cmp_result < 0 ; <nl> cmp_result = strcmp ( lhs - > zone_ . get ( ) , rhs - > zone_ . get ( ) ) ; <nl> mmm a / src / core / lib / gprpp / map . h <nl> ppp b / src / core / lib / gprpp / map . h <nl> struct StringLess { <nl> bool operator ( ) ( const char * a , const char * b ) const { <nl> return strcmp ( a , b ) < 0 ; <nl> } <nl> - bool operator ( ) ( const UniquePtr < char > & k1 , const UniquePtr < char > & k2 ) { <nl> + bool operator ( ) ( const UniquePtr < char > & k1 , const UniquePtr < char > & k2 ) const { <nl> return strcmp ( k1 . get ( ) , k2 . get ( ) ) < 0 ; <nl> } <nl> } ; <nl> <nl> template < typename T > <nl> struct RefCountedPtrLess { <nl> - bool operator ( ) ( const RefCountedPtr < T > & p1 , const RefCountedPtr < T > & p2 ) { <nl> + bool operator ( ) ( const RefCountedPtr < T > & p1 , <nl> + const RefCountedPtr < T > & p2 ) const { <nl> return p1 . get ( ) < p2 . get ( ) ; <nl> } <nl> } ; <nl> class Map { <nl> iterator end ( ) { return iterator ( this , nullptr ) ; } <nl> <nl> iterator lower_bound ( const Key & k ) { <nl> - key_compare compare ; <nl> + / / This is a workaround for " const key_compare compare ; " <nl> + / / because some versions of compilers cannot build this by requiring <nl> + / / a user - provided constructor . ( ref : https : / / stackoverflow . com / q / 7411515 ) <nl> + key_compare compare_tmp ; <nl> + const key_compare & compare = compare_tmp ; <nl> return std : : find_if ( begin ( ) , end ( ) , [ & k , & compare ] ( const value_type & v ) { <nl> return ! compare ( v . first , k ) ; <nl> } ) ; <nl> Map < Key , T , Compare > : : RemoveRecursive ( Entry * root , const key_type & k ) { <nl> template < class Key , class T , class Compare > <nl> int Map < Key , T , Compare > : : CompareKeys ( const key_type & lhs , <nl> const key_type & rhs ) { <nl> - key_compare compare ; <nl> + / / This is a workaround for " const key_compare compare ; " <nl> + / / because some versions of compilers cannot build this by requiring <nl> + / / a user - provided constructor . ( ref : https : / / stackoverflow . com / q / 7411515 ) <nl> + key_compare compare_tmp ; <nl> + const key_compare & compare = compare_tmp ; <nl> bool left_comparison = compare ( lhs , rhs ) ; <nl> bool right_comparison = compare ( rhs , lhs ) ; <nl> / / Both values are equal <nl>
Merge pull request from veblush / less - const
grpc/grpc
e21289a77d71c94b96b3f4008fc19870e5df5a01
2019-08-15T00:25:01Z
mmm a / dbms / src / Dictionaries / ClickHouseDictionarySource . cpp <nl> ppp b / dbms / src / Dictionaries / ClickHouseDictionarySource . cpp <nl> ClickHouseDictionarySource : : ClickHouseDictionarySource ( <nl> , query_builder { dict_struct , db , table , where , IdentifierQuotingStyle : : Backticks } <nl> , sample_block { sample_block } <nl> , context ( context ) <nl> - , is_local { isLocalAddress ( { host , port } , config . getInt ( " tcp_port " , 0 ) ) } <nl> + , is_local { isLocalAddress ( { host , port } , context . getTCPPort ( ) ) } <nl> , pool { is_local ? nullptr : createPool ( host , port , secure , db , user , password , context ) } <nl> , load_all_query { query_builder . composeLoadAllQuery ( ) } <nl> { <nl>
Merge pull request from yandex / fixed - clickhouse - localhost - dictionaries
ClickHouse/ClickHouse
8e68169b7f5752b858501ba30de938274624a27a
2019-01-29T12:40:08Z
mmm a / scripts / internalCI . ps1 <nl> ppp b / scripts / internalCI . ps1 <nl> New - Item - type file downloads \ AlwaysAllowDownloads - errorAction SilentlyContinue <nl> if ( - not $ ? ) { throw $ ? } <nl> <nl> # Clear out any intermediate files from the previous build <nl> - Get - ChildItem buildtrees / * / * | ? Name - ne " src " | Remove - Item - Recurse - Force <nl> + Get - ChildItem buildtrees / * / * | ? { $ _ . Name - ne " src " - and $ _ . Extension - ne " . log " } | Remove - Item - Recurse - Force <nl> <nl> # Purge any outdated packages <nl> . / vcpkg remove - - outdated - - recurse <nl>
[ vcpkg - ci ] Do not delete log files
microsoft/vcpkg
e288a87b9f048b53ecf20bebc429ab1ab732220a
2017-05-26T01:15:05Z
mmm a / src / metric / rank_metric . cc <nl> ppp b / src / metric / rank_metric . cc <nl> struct EvalAMS : public Metric { <nl> for ( bst_omp_uint i = 0 ; i < ndata ; + + i ) { <nl> rec [ i ] = std : : make_pair ( h_preds [ i ] , i ) ; <nl> } <nl> - std : : sort ( rec . begin ( ) , rec . end ( ) , common : : CmpFirst ) ; <nl> + std : : stable_sort ( rec . begin ( ) , rec . end ( ) , common : : CmpFirst ) ; <nl> auto ntop = static_cast < unsigned > ( ratio_ * ndata ) ; <nl> if ( ntop = = 0 ) ntop = ndata ; <nl> const double br = 10 . 0 ; <nl> struct EvalAuc : public Metric { <nl> for ( unsigned j = gptr [ group_id ] ; j < gptr [ group_id + 1 ] ; + + j ) { <nl> rec . emplace_back ( h_preds [ j ] , j ) ; <nl> } <nl> - XGBOOST_PARALLEL_SORT ( rec . begin ( ) , rec . end ( ) , common : : CmpFirst ) ; <nl> + XGBOOST_PARALLEL_STABLE_SORT ( rec . begin ( ) , rec . end ( ) , common : : CmpFirst ) ; <nl> / / calculate AUC <nl> double sum_pospair = 0 . 0 ; <nl> double sum_npos = 0 . 0 , sum_nneg = 0 . 0 , buf_pos = 0 . 0 , buf_neg = 0 . 0 ; <nl> struct EvalPrecision : public EvalRankList { <nl> protected : <nl> bst_float EvalMetric ( std : : vector < std : : pair < bst_float , unsigned > > & rec ) const override { <nl> / / calculate Precision <nl> - std : : sort ( rec . begin ( ) , rec . end ( ) , common : : CmpFirst ) ; <nl> + std : : stable_sort ( rec . begin ( ) , rec . end ( ) , common : : CmpFirst ) ; <nl> unsigned nhit = 0 ; <nl> for ( size_t j = 0 ; j < rec . size ( ) & & j < this - > topn_ ; + + j ) { <nl> nhit + = ( rec [ j ] . second ! = 0 ) ; <nl> struct EvalMAP : public EvalRankList { <nl> <nl> protected : <nl> bst_float EvalMetric ( std : : vector < std : : pair < bst_float , unsigned > > & rec ) const override { <nl> - std : : sort ( rec . begin ( ) , rec . end ( ) , common : : CmpFirst ) ; <nl> + std : : stable_sort ( rec . begin ( ) , rec . end ( ) , common : : CmpFirst ) ; <nl> unsigned nhits = 0 ; <nl> double sumap = 0 . 0 ; <nl> for ( size_t i = 0 ; i < rec . size ( ) ; + + i ) { <nl> struct EvalAucPR : public Metric { <nl> total_neg + = wt * ( 1 . 0f - h_labels [ j ] ) ; <nl> rec . emplace_back ( h_preds [ j ] , j ) ; <nl> } <nl> - XGBOOST_PARALLEL_SORT ( rec . begin ( ) , rec . end ( ) , common : : CmpFirst ) ; <nl> + XGBOOST_PARALLEL_STABLE_SORT ( rec . begin ( ) , rec . end ( ) , common : : CmpFirst ) ; <nl> / / we need pos > 0 & & neg > 0 <nl> if ( 0 . 0 = = total_pos | | 0 . 0 = = total_neg ) { <nl> auc_error + = 1 ; <nl> mmm a / src / objective / rank_obj . cu <nl> ppp b / src / objective / rank_obj . cu <nl> <nl> namespace xgboost { <nl> namespace obj { <nl> <nl> - # if defined ( XGBOOST_USE_CUDA ) <nl> + # if defined ( XGBOOST_USE_CUDA ) & & ! defined ( GTEST_TEST ) <nl> DMLC_REGISTRY_FILE_TAG ( rank_obj_gpu ) ; <nl> # endif / / defined ( XGBOOST_USE_CUDA ) <nl> <nl> struct LambdaRankParam : public XGBoostParameter < LambdaRankParam > { <nl> } <nl> } ; <nl> <nl> + # if defined ( __CUDACC__ ) <nl> + / / This type sorts an array which is divided into multiple groups . The sorting is influenced <nl> + / / by the function object ' Comparator ' <nl> + template < typename T > <nl> + class SegmentSorter { <nl> + private : <nl> + / / Items sorted within the group <nl> + dh : : caching_device_vector < T > ditems_ ; <nl> + <nl> + / / Original position of the items before they are sorted descendingly within its groups <nl> + dh : : caching_device_vector < uint32_t > doriginal_pos_ ; <nl> + <nl> + / / Segments within the original list that delineates the different groups <nl> + dh : : caching_device_vector < uint32_t > group_segments_ ; <nl> + <nl> + / / Need this on the device as it is used in the kernels <nl> + dh : : caching_device_vector < uint32_t > dgroups_ ; / / Group information on device <nl> + <nl> + / / Initialize everything but the segments <nl> + void Init ( uint32_t num_elems ) { <nl> + ditems_ . resize ( num_elems ) ; <nl> + <nl> + doriginal_pos_ . resize ( num_elems ) ; <nl> + thrust : : sequence ( doriginal_pos_ . begin ( ) , doriginal_pos_ . end ( ) ) ; <nl> + } <nl> + <nl> + / / Initialize all with group info <nl> + void Init ( const std : : vector < uint32_t > & groups ) { <nl> + uint32_t num_elems = groups . back ( ) ; <nl> + this - > Init ( num_elems ) ; <nl> + this - > CreateGroupSegments ( groups ) ; <nl> + } <nl> + <nl> + public : <nl> + / / This needs to be public due to device lambda <nl> + void CreateGroupSegments ( const std : : vector < uint32_t > & groups ) { <nl> + uint32_t num_elems = groups . back ( ) ; <nl> + group_segments_ . resize ( num_elems ) ; <nl> + <nl> + dgroups_ = groups ; <nl> + <nl> + / / Launch a kernel that populates the segment information for the different groups <nl> + uint32_t * gsegs = group_segments_ . data ( ) . get ( ) ; <nl> + const uint32_t * dgroups = dgroups_ . data ( ) . get ( ) ; <nl> + uint32_t ngroups = dgroups_ . size ( ) ; <nl> + int device_id = - 1 ; <nl> + dh : : safe_cuda ( cudaGetDevice ( & device_id ) ) ; <nl> + dh : : LaunchN ( device_id , num_elems , nullptr , [ = ] __device__ ( uint32_t idx ) { <nl> + / / Find the group first <nl> + uint32_t group_idx = dh : : UpperBound ( dgroups , ngroups , idx ) ; <nl> + gsegs [ idx ] = group_idx - 1 ; <nl> + } ) ; <nl> + } <nl> + <nl> + / / Accessors that returns device pointer <nl> + inline const T * Items ( ) const { return ditems_ . data ( ) . get ( ) ; } <nl> + inline uint32_t NumItems ( ) const { return ditems_ . size ( ) ; } <nl> + inline const uint32_t * OriginalPositions ( ) const { return doriginal_pos_ . data ( ) . get ( ) ; } <nl> + inline const dh : : caching_device_vector < uint32_t > & GroupSegments ( ) const { <nl> + return group_segments_ ; <nl> + } <nl> + inline uint32_t NumGroups ( ) const { return dgroups_ . size ( ) - 1 ; } <nl> + inline const uint32_t * GroupIndices ( ) const { return dgroups_ . data ( ) . get ( ) ; } <nl> + <nl> + / / Sort an array that is divided into multiple groups . The array is sorted within each group . <nl> + / / This version provides the group information that is on the host . <nl> + / / The array is sorted based on an adaptable binary predicate . By default a stateless predicate <nl> + / / is used . <nl> + template < typename Comparator = thrust : : greater < T > > <nl> + void SortItems ( const T * ditems , uint32_t item_size , const std : : vector < uint32_t > & groups , <nl> + const Comparator & comp = Comparator ( ) ) { <nl> + this - > Init ( groups ) ; <nl> + this - > SortItems ( ditems , item_size , group_segments_ , comp ) ; <nl> + } <nl> + <nl> + / / Sort an array that is divided into multiple groups . The array is sorted within each group . <nl> + / / This version provides the group information that is on the device . <nl> + / / The array is sorted based on an adaptable binary predicate . By default a stateless predicate <nl> + / / is used . <nl> + template < typename Comparator = thrust : : greater < T > > <nl> + void SortItems ( const T * ditems , uint32_t item_size , <nl> + const dh : : caching_device_vector < uint32_t > & group_segments , <nl> + const Comparator & comp = Comparator ( ) ) { <nl> + this - > Init ( item_size ) ; <nl> + <nl> + / / Sort the items that are grouped . We would like to avoid using predicates to perform the sort , <nl> + / / as thrust resorts to using a merge sort as opposed to a much much faster radix sort <nl> + / / when comparators are used . Hence , the following algorithm is used . This is done so that <nl> + / / we can grab the appropriate related values from the original list later , after the <nl> + / / items are sorted . <nl> + / / <nl> + / / Here is the internal representation : <nl> + / / dgroups_ : [ 0 , 3 , 5 , 8 , 10 ] <nl> + / / group_segments_ : 0 0 0 | 1 1 | 2 2 2 | 3 3 <nl> + / / doriginal_pos_ : 0 1 2 | 3 4 | 5 6 7 | 8 9 <nl> + / / ditems_ : 1 0 1 | 2 1 | 1 3 3 | 4 4 ( from original items ) <nl> + / / <nl> + / / Sort the items first and make a note of the original positions in doriginal_pos_ <nl> + / / based on the sort <nl> + / / ditems_ : 4 4 3 3 2 1 1 1 1 0 <nl> + / / doriginal_pos_ : 8 9 6 7 3 0 2 4 5 1 <nl> + / / NOTE : This consumes space , but is much faster than some of the other approaches - sorting <nl> + / / in kernel , sorting using predicates etc . <nl> + <nl> + ditems_ . assign ( thrust : : device_ptr < const T > ( ditems ) , <nl> + thrust : : device_ptr < const T > ( ditems ) + item_size ) ; <nl> + <nl> + / / Allocator to be used by sort for managing space overhead while sorting <nl> + dh : : XGBCachingDeviceAllocator < char > alloc ; <nl> + <nl> + thrust : : stable_sort_by_key ( thrust : : cuda : : par ( alloc ) , <nl> + ditems_ . begin ( ) , ditems_ . end ( ) , <nl> + doriginal_pos_ . begin ( ) , comp ) ; <nl> + <nl> + / / Next , gather the segments based on the doriginal_pos_ . This is to reflect the <nl> + / / holisitic item sort order on the segments <nl> + / / group_segments_c_ : 3 3 2 2 1 0 0 1 2 0 <nl> + / / doriginal_pos_ : 8 9 6 7 3 0 2 4 5 1 ( stays the same ) <nl> + dh : : caching_device_vector < uint32_t > group_segments_c ( group_segments ) ; <nl> + thrust : : gather ( doriginal_pos_ . begin ( ) , doriginal_pos_ . end ( ) , <nl> + group_segments . begin ( ) , group_segments_c . begin ( ) ) ; <nl> + <nl> + / / Now , sort the group segments so that you may bring the items within the group together , <nl> + / / in the process also noting the relative changes to the doriginal_pos_ while that happens <nl> + / / group_segments_c_ : 0 0 0 1 1 2 2 2 3 3 <nl> + / / doriginal_pos_ : 0 2 1 3 4 6 7 5 8 9 <nl> + thrust : : stable_sort_by_key ( thrust : : cuda : : par ( alloc ) , <nl> + group_segments_c . begin ( ) , group_segments_c . end ( ) , <nl> + doriginal_pos_ . begin ( ) , thrust : : less < uint32_t > ( ) ) ; <nl> + <nl> + / / Finally , gather the original items based on doriginal_pos_ to sort the input and <nl> + / / to store them in ditems_ <nl> + / / doriginal_pos_ : 0 2 1 3 4 6 7 5 8 9 ( stays the same ) <nl> + / / ditems_ : 1 1 0 2 1 3 3 1 4 4 ( from unsorted items - ditems ) <nl> + thrust : : gather ( doriginal_pos_ . begin ( ) , doriginal_pos_ . end ( ) , <nl> + thrust : : device_ptr < const T > ( ditems ) , ditems_ . begin ( ) ) ; <nl> + } <nl> + } ; <nl> + <nl> + / / Helper functions <nl> + <nl> + / / Items of size ' n ' are sorted in a descending order <nl> + / / If left is true , find the number of elements > v ; 0 if nothing is greater <nl> + / / If left is false , find the number of elements < v ; 0 if nothing is lesser <nl> + template < typename T > <nl> + XGBOOST_DEVICE __forceinline__ uint32_t <nl> + CountNumItemsImpl ( bool left , const T * __restrict__ items , uint32_t n , T v ) { <nl> + const T * items_begin = items ; <nl> + uint32_t num_remaining = n ; <nl> + const T * middle_item = nullptr ; <nl> + uint32_t middle ; <nl> + while ( num_remaining > 0 ) { <nl> + middle_item = items_begin ; <nl> + middle = num_remaining / 2 ; <nl> + middle_item + = middle ; <nl> + if ( ( left & & * middle_item > v ) | | ( ! left & & ! ( v > * middle_item ) ) ) { <nl> + items_begin = + + middle_item ; <nl> + num_remaining - = middle + 1 ; <nl> + } else { <nl> + num_remaining = middle ; <nl> + } <nl> + } <nl> + <nl> + return left ? items_begin - items : items + n - items_begin ; <nl> + } <nl> + <nl> + template < typename T > <nl> + XGBOOST_DEVICE __forceinline__ uint32_t <nl> + CountNumItemsToTheLeftOf ( const T * __restrict__ items , uint32_t n , T v ) { <nl> + return CountNumItemsImpl ( true , items , n , v ) ; <nl> + } <nl> + <nl> + template < typename T > <nl> + XGBOOST_DEVICE __forceinline__ uint32_t <nl> + CountNumItemsToTheRightOf ( const T * __restrict__ items , uint32_t n , T v ) { <nl> + return CountNumItemsImpl ( false , items , n , v ) ; <nl> + } <nl> + # endif <nl> + <nl> / * ! \ brief helper information in a list * / <nl> struct ListEntry { <nl> / * ! \ brief the predict score we in the data * / <nl> struct PairwiseLambdaWeightComputer { <nl> return " rank : pairwise " ; <nl> } <nl> <nl> - / / Stopgap method - will be removed when we support other type of ranking - ndcg , map etc . <nl> + / / Stopgap method - will be removed when we support other type of ranking - map <nl> / / on GPU later <nl> inline static bool SupportOnGPU ( ) { return true ; } <nl> + <nl> + # if defined ( __CUDACC__ ) <nl> + PairwiseLambdaWeightComputer ( const bst_float * dpreds , <nl> + uint32_t pred_size , <nl> + const SegmentSorter < float > & segment_label_sorter ) { } <nl> + <nl> + struct PairwiseLambdaWeightMultiplier { <nl> + / / Adjust the items weight by this value <nl> + __device__ __forceinline__ bst_float GetWeight ( uint32_t gidx , int pidx , int nidx ) const { <nl> + return 1 . 0f ; <nl> + } <nl> + } ; <nl> + <nl> + inline PairwiseLambdaWeightMultiplier GetWeightMultiplier ( ) const { <nl> + return { } ; <nl> + } <nl> + # endif <nl> } ; <nl> <nl> / / beta version : NDCG lambda rank <nl> struct NDCGLambdaWeightComputer { <nl> - / / Stopgap method - will be removed when we support other type of ranking - ndcg , map etc . <nl> + public : <nl> + # if defined ( __CUDACC__ ) <nl> + / / This function object computes the group ' s DCG for a given group <nl> + struct ComputeGroupDCG { <nl> + public : <nl> + XGBOOST_DEVICE ComputeGroupDCG ( const float * dsorted_labels , const uint32_t * dgroups ) <nl> + : dsorted_labels_ ( dsorted_labels ) , <nl> + dgroups_ ( dgroups ) { } <nl> + <nl> + / / Compute DCG for group ' gidx ' <nl> + __device__ __forceinline__ float operator ( ) ( uint32_t gidx ) const { <nl> + uint32_t group_begin = dgroups_ [ gidx ] ; <nl> + uint32_t group_end = dgroups_ [ gidx + 1 ] ; <nl> + uint32_t group_size = group_end - group_begin ; <nl> + return ComputeGroupDCGWeight ( & dsorted_labels_ [ group_begin ] , group_size ) ; <nl> + } <nl> + <nl> + private : <nl> + const float * dsorted_labels_ { nullptr } ; / / Labels sorted within a group <nl> + const uint32_t * dgroups_ { nullptr } ; / / The group indices - where each group begins and ends <nl> + } ; <nl> + <nl> + / / Type containing device pointers that can be cheaply copied on the kernel <nl> + class NDCGLambdaWeightMultiplier { <nl> + public : <nl> + NDCGLambdaWeightMultiplier ( const float * dsorted_labels , <nl> + const uint32_t * dorig_pos , <nl> + const uint32_t * dgroups , <nl> + const float * dgroup_dcg_ptr , <nl> + uint32_t * dindexable_sorted_preds_pos_ptr ) <nl> + : dsorted_labels_ ( dsorted_labels ) , <nl> + dorig_pos_ ( dorig_pos ) , <nl> + dgroups_ ( dgroups ) , <nl> + dgroup_dcg_ptr_ ( dgroup_dcg_ptr ) , <nl> + dindexable_sorted_preds_pos_ptr_ ( dindexable_sorted_preds_pos_ptr ) { } <nl> + <nl> + / / Adjust the items weight by this value <nl> + __device__ __forceinline__ bst_float GetWeight ( uint32_t gidx , int pidx , int nidx ) const { <nl> + if ( dgroup_dcg_ptr_ [ gidx ] = = 0 . 0 ) return 0 . 0f ; <nl> + <nl> + uint32_t group_begin = dgroups_ [ gidx ] ; <nl> + <nl> + auto ppred_idx = dorig_pos_ [ pidx ] ; <nl> + auto npred_idx = dorig_pos_ [ nidx ] ; <nl> + KERNEL_CHECK ( ppred_idx ! = npred_idx ) ; <nl> + <nl> + / / Note : the label positive and negative indices are relative to the entire dataset . <nl> + / / Hence , scale them back to an index within the group <nl> + ppred_idx = dindexable_sorted_preds_pos_ptr_ [ ppred_idx ] - group_begin ; <nl> + npred_idx = dindexable_sorted_preds_pos_ptr_ [ npred_idx ] - group_begin ; <nl> + return NDCGLambdaWeightComputer : : ComputeDeltaWeight ( <nl> + ppred_idx , npred_idx , <nl> + static_cast < int > ( dsorted_labels_ [ pidx ] ) , static_cast < int > ( dsorted_labels_ [ nidx ] ) , <nl> + dgroup_dcg_ptr_ [ gidx ] ) ; <nl> + } <nl> + <nl> + private : <nl> + const float * dsorted_labels_ { nullptr } ; / / Labels sorted within a group <nl> + const uint32_t * dorig_pos_ { nullptr } ; / / Original indices of the labels before they are sorted <nl> + const uint32_t * dgroups_ { nullptr } ; / / The group indices <nl> + const float * dgroup_dcg_ptr_ { nullptr } ; / / Start address of the group DCG values <nl> + / / Where can a prediction for a label be found in the original array , when they are sorted <nl> + uint32_t * dindexable_sorted_preds_pos_ptr_ { nullptr } ; <nl> + } ; <nl> + <nl> + NDCGLambdaWeightComputer ( const bst_float * dpreds , <nl> + uint32_t pred_size , <nl> + const SegmentSorter < float > & segment_label_sorter ) <nl> + : dgroup_dcg_ ( segment_label_sorter . NumGroups ( ) ) , <nl> + dindexable_sorted_preds_pos_ ( pred_size ) , <nl> + weight_multiplier_ ( segment_label_sorter . Items ( ) , <nl> + segment_label_sorter . OriginalPositions ( ) , <nl> + segment_label_sorter . GroupIndices ( ) , <nl> + dgroup_dcg_ . data ( ) . get ( ) , <nl> + dindexable_sorted_preds_pos_ . data ( ) . get ( ) ) { <nl> + / / Sort the predictions first and get the sorted position <nl> + SegmentSorter < float > segment_prediction_sorter ; <nl> + segment_prediction_sorter . SortItems ( dpreds , pred_size , segment_label_sorter . GroupSegments ( ) ) ; <nl> + <nl> + this - > CreateIndexableSortedPredictionPositions ( segment_prediction_sorter . OriginalPositions ( ) ) ; <nl> + <nl> + / / Compute each group ' s DCG concurrently <nl> + / / Set the values to be the group indices first so that the predicate knows which <nl> + / / group it is dealing with <nl> + thrust : : sequence ( dgroup_dcg_ . begin ( ) , dgroup_dcg_ . end ( ) ) ; <nl> + <nl> + / / TODO ( sriramch ) : parallelize across all elements , if possible <nl> + / / Transform each group - the predictate computes the group ' s DCG <nl> + thrust : : transform ( dgroup_dcg_ . begin ( ) , dgroup_dcg_ . end ( ) , <nl> + dgroup_dcg_ . begin ( ) , <nl> + ComputeGroupDCG ( segment_label_sorter . Items ( ) , <nl> + segment_label_sorter . GroupIndices ( ) ) ) ; <nl> + } <nl> + <nl> + inline NDCGLambdaWeightMultiplier GetWeightMultiplier ( ) const { return weight_multiplier_ ; } <nl> + inline const dh : : caching_device_vector < uint32_t > & GetSortedPredPos ( ) const { <nl> + return dindexable_sorted_preds_pos_ ; <nl> + } <nl> + # endif <nl> + <nl> + / / Stopgap method - will be removed when we support other type of ranking - map <nl> / / on GPU later <nl> - inline static bool SupportOnGPU ( ) { return false ; } <nl> + inline static bool SupportOnGPU ( ) { return true ; } <nl> <nl> static void GetLambdaWeight ( const std : : vector < ListEntry > & sorted_list , <nl> std : : vector < LambdaPair > * io_pairs ) { <nl> struct NDCGLambdaWeightComputer { <nl> for ( size_t i = 0 ; i < sorted_list . size ( ) ; + + i ) { <nl> labels [ i ] = sorted_list [ i ] . label ; <nl> } <nl> - std : : sort ( labels . begin ( ) , labels . end ( ) , std : : greater < bst_float > ( ) ) ; <nl> - IDCG = CalcDCG ( labels ) ; <nl> + std : : stable_sort ( labels . begin ( ) , labels . end ( ) , std : : greater < bst_float > ( ) ) ; <nl> + IDCG = ComputeGroupDCGWeight ( & labels [ 0 ] , labels . size ( ) ) ; <nl> } <nl> if ( IDCG = = 0 . 0 ) { <nl> for ( auto & pair : pairs ) { <nl> pair . weight = 0 . 0f ; <nl> } <nl> } else { <nl> - IDCG = 1 . 0f / IDCG ; <nl> for ( auto & pair : pairs ) { <nl> unsigned pos_idx = pair . pos_index ; <nl> unsigned neg_idx = pair . neg_index ; <nl> - float pos_loginv = 1 . 0f / std : : log2 ( pos_idx + 2 . 0f ) ; <nl> - float neg_loginv = 1 . 0f / std : : log2 ( neg_idx + 2 . 0f ) ; <nl> - auto pos_label = static_cast < int > ( sorted_list [ pos_idx ] . label ) ; <nl> - auto neg_label = static_cast < int > ( sorted_list [ neg_idx ] . label ) ; <nl> - bst_float original = <nl> - ( ( 1 < < pos_label ) - 1 ) * pos_loginv + ( ( 1 < < neg_label ) - 1 ) * neg_loginv ; <nl> - float changed = <nl> - ( ( 1 < < neg_label ) - 1 ) * pos_loginv + ( ( 1 < < pos_label ) - 1 ) * neg_loginv ; <nl> - bst_float delta = ( original - changed ) * IDCG ; <nl> - if ( delta < 0 . 0f ) delta = - delta ; <nl> - pair . weight * = delta ; <nl> + pair . weight * = ComputeDeltaWeight ( pos_idx , neg_idx , <nl> + sorted_list [ pos_idx ] . label , sorted_list [ neg_idx ] . label , <nl> + IDCG ) ; <nl> } <nl> } <nl> } <nl> struct NDCGLambdaWeightComputer { <nl> } <nl> <nl> private : <nl> - inline static bst_float CalcDCG ( const std : : vector < bst_float > & labels ) { <nl> + XGBOOST_DEVICE inline static bst_float ComputeGroupDCGWeight ( const float * sorted_labels , <nl> + uint32_t size ) { <nl> double sumdcg = 0 . 0 ; <nl> - for ( size_t i = 0 ; i < labels . size ( ) ; + + i ) { <nl> - const auto rel = static_cast < unsigned > ( labels [ i ] ) ; <nl> + for ( uint32_t i = 0 ; i < size ; + + i ) { <nl> + const auto rel = static_cast < unsigned > ( sorted_labels [ i ] ) ; <nl> if ( rel ! = 0 ) { <nl> sumdcg + = ( ( 1 < < rel ) - 1 ) / std : : log2 ( static_cast < bst_float > ( i + 2 ) ) ; <nl> } <nl> } <nl> return static_cast < bst_float > ( sumdcg ) ; <nl> } <nl> + <nl> + / / Compute the weight adjustment for an item within a group : <nl> + / / ppred_idx = > Where does the positive label live , had the list been sorted by prediction <nl> + / / npred_idx = > Where does the negative label live , had the list been sorted by prediction <nl> + / / pos_label = > positive label value from sorted label list <nl> + / / neg_label = > negative label value from sorted label list <nl> + XGBOOST_DEVICE inline static bst_float ComputeDeltaWeight ( uint32_t ppred_idx , uint32_t npred_idx , <nl> + int pos_label , int neg_label , <nl> + float idcg ) { <nl> + float pos_loginv = 1 . 0f / std : : log2 ( ppred_idx + 2 . 0f ) ; <nl> + float neg_loginv = 1 . 0f / std : : log2 ( npred_idx + 2 . 0f ) ; <nl> + bst_float original = ( ( 1 < < pos_label ) - 1 ) * pos_loginv + ( ( 1 < < neg_label ) - 1 ) * neg_loginv ; <nl> + float changed = ( ( 1 < < neg_label ) - 1 ) * pos_loginv + ( ( 1 < < pos_label ) - 1 ) * neg_loginv ; <nl> + bst_float delta = ( original - changed ) * ( 1 . 0f / idcg ) ; <nl> + if ( delta < 0 . 0f ) delta = - delta ; <nl> + return delta ; <nl> + } <nl> + <nl> + # if defined ( __CUDACC__ ) <nl> + / / While computing the weight that needs to be adjusted by this ranking objective , we need <nl> + / / to figure out where positive and negative labels chosen earlier exists , if the group <nl> + / / were to be sorted by its predictions . To accommodate this , we employ the following algorithm . <nl> + / / For a given group , let ' s assume the following : <nl> + / / labels : 1 5 9 2 4 8 0 7 6 3 <nl> + / / predictions : 1 9 0 8 2 7 3 6 5 4 <nl> + / / position : 0 1 2 3 4 5 6 7 8 9 <nl> + / / <nl> + / / After label sort : <nl> + / / labels : 9 8 7 6 5 4 3 2 1 0 <nl> + / / position : 2 5 7 8 1 4 9 3 0 6 <nl> + / / <nl> + / / After prediction sort : <nl> + / / predictions : 9 8 7 6 5 4 3 2 1 0 <nl> + / / position : 1 3 5 7 8 9 6 4 0 2 <nl> + / / <nl> + / / If a sorted label at position ' x ' is chosen , then we need to find out where the prediction <nl> + / / for this label ' x ' exists , if the group were to be sorted by predictions . <nl> + / / We first take the sorted prediction positions : <nl> + / / position : 1 3 5 7 8 9 6 4 0 2 <nl> + / / at indices : 0 1 2 3 4 5 6 7 8 9 <nl> + / / <nl> + / / We create a sorted prediction positional array , such that value at position ' x ' gives <nl> + / / us the position in the sorted prediction array where its related prediction lies . <nl> + / / dindexable_sorted_preds_pos_ptr_ : 8 0 9 1 7 2 6 3 4 5 <nl> + / / at indices : 0 1 2 3 4 5 6 7 8 9 <nl> + / / Basically , swap the previous 2 arrays , sort the indices and reorder positions <nl> + / / for an O ( 1 ) lookup using the position where the sorted label exists <nl> + void CreateIndexableSortedPredictionPositions ( const uint32_t * dsorted_preds_pos ) { <nl> + dh : : caching_device_vector < uint32_t > indices ( dindexable_sorted_preds_pos_ . size ( ) ) ; <nl> + thrust : : sequence ( indices . begin ( ) , indices . end ( ) ) ; <nl> + thrust : : scatter ( indices . begin ( ) , indices . end ( ) , / / Rearrange indices . . . <nl> + thrust : : device_ptr < const uint32_t > ( dsorted_preds_pos ) , / / . . . based on this map <nl> + dindexable_sorted_preds_pos_ . begin ( ) ) ; / / Write results into this <nl> + } <nl> + <nl> + dh : : caching_device_vector < float > dgroup_dcg_ ; <nl> + / / Where can a prediction for a label be found in the original array , when they are sorted <nl> + dh : : caching_device_vector < uint32_t > dindexable_sorted_preds_pos_ ; <nl> + NDCGLambdaWeightMultiplier weight_multiplier_ ; / / This computes the adjustment to the weight <nl> + # endif <nl> } ; <nl> <nl> struct MAPLambdaWeightComputer { <nl> struct MAPLambdaWeightComputer { <nl> } <nl> <nl> public : <nl> - / / Stopgap method - will be removed when we support other type of ranking - ndcg , map etc . <nl> + / / Stopgap method - will be removed when we support other type of ranking - map <nl> / / on GPU later <nl> inline static bool SupportOnGPU ( ) { return false ; } <nl> <nl> struct MAPLambdaWeightComputer { <nl> pair . neg_index , & map_stats ) ; <nl> } <nl> } <nl> - } ; <nl> <nl> # if defined ( __CUDACC__ ) <nl> - / / Helper functions <nl> - <nl> - / / Labels of size ' n ' are sorted in a descending order <nl> - / / If left is true , find the number of elements > v ; 0 if nothing is greater <nl> - / / If left is false , find the number of elements < v ; 0 if nothing is lesser <nl> - __device__ __forceinline__ int <nl> - CountNumLabelsImpl ( bool left , const float * __restrict__ labels , int n , float v ) { <nl> - const float * labels_begin = labels ; <nl> - int num_remaining = n ; <nl> - const float * middle_item = nullptr ; <nl> - int middle ; <nl> - while ( num_remaining > 0 ) { <nl> - middle_item = labels_begin ; <nl> - middle = num_remaining / 2 ; <nl> - middle_item + = middle ; <nl> - if ( ( left & & * middle_item > v ) | | ( ! left & & ! ( v > * middle_item ) ) ) { <nl> - labels_begin = + + middle_item ; <nl> - num_remaining - = middle + 1 ; <nl> - } else { <nl> - num_remaining = middle ; <nl> + MAPLambdaWeightComputer ( const bst_float * dpreds , <nl> + uint32_t pred_size , <nl> + const SegmentSorter < float > & segment_label_sorter ) { } <nl> + <nl> + struct MAPLambdaWeightMultiplier { <nl> + / / Adjust the items weight by this value <nl> + __device__ __forceinline__ bst_float GetWeight ( uint32_t gidx , int pidx , int nidx ) const { <nl> + return 1 . 0f ; <nl> } <nl> - } <nl> - <nl> - return left ? labels_begin - labels : labels + n - labels_begin ; <nl> - } <nl> - <nl> - __device__ __forceinline__ int <nl> - CountNumLabelsToTheLeftOf ( const float * __restrict__ labels , int n , float v ) { <nl> - return CountNumLabelsImpl ( true , labels , n , v ) ; <nl> - } <nl> + } ; <nl> <nl> - __device__ __forceinline__ int <nl> - CountNumLabelsToTheRightOf ( const float * __restrict__ labels , int n , float v ) { <nl> - return CountNumLabelsImpl ( false , labels , n , v ) ; <nl> - } <nl> + inline MAPLambdaWeightMultiplier GetWeightMultiplier ( ) const { <nl> + return { } ; <nl> + } <nl> + # endif <nl> + } ; <nl> <nl> - class SortedLabelList { <nl> + # if defined ( __CUDACC__ ) <nl> + class SortedLabelList : SegmentSorter < float > { <nl> private : <nl> - / / Labels sorted within the group <nl> - dh : : caching_device_vector < float > dsorted_labels_ ; <nl> - <nl> - / / Original position of the labels before they are sorted descendingly within its groups <nl> - dh : : caching_device_vector < uint32_t > doriginal_pos_ ; <nl> - <nl> - / / Segments within the original list that delineates the different groups <nl> - dh : : caching_device_vector < uint32_t > group_segments_ ; <nl> - <nl> - / / Need this on the device as it is used in the kernels <nl> - dh : : caching_device_vector < uint32_t > dgroups_ ; / / Group information on device <nl> - <nl> - int device_id_ { - 1 } ; / / GPU device ID <nl> const LambdaRankParam & param_ ; / / Objective configuration <nl> <nl> - dh : : XGBCachingDeviceAllocator < char > alloc_ ; / / Allocator to be used by sort for managing <nl> - / / space overhead while sorting <nl> - <nl> public : <nl> - SortedLabelList ( int dev_id , <nl> - const LambdaRankParam & param ) <nl> - : device_id_ ( dev_id ) , <nl> - param_ ( param ) { } <nl> - <nl> - void InitWithTrainingInfo ( const std : : vector < uint32_t > & groups ) { <nl> - int num_elems = groups . back ( ) ; <nl> - <nl> - dsorted_labels_ . resize ( num_elems ) ; <nl> - <nl> - doriginal_pos_ . resize ( num_elems ) ; <nl> - thrust : : sequence ( doriginal_pos_ . begin ( ) , doriginal_pos_ . end ( ) ) ; <nl> + explicit SortedLabelList ( const LambdaRankParam & param ) <nl> + : param_ ( param ) { } <nl> <nl> - group_segments_ . resize ( num_elems ) ; <nl> - <nl> - dgroups_ = groups ; <nl> - <nl> - / / Launch a kernel that populates the segment information for the different groups <nl> - uint32_t * gsegs = group_segments_ . data ( ) . get ( ) ; <nl> - const unsigned * dgroups = dgroups_ . data ( ) . get ( ) ; <nl> - size_t ngroups = dgroups_ . size ( ) ; <nl> - dh : : LaunchN ( device_id_ , num_elems , nullptr , [ = ] __device__ ( unsigned idx ) { <nl> - / / Find the group first <nl> - int group_idx = dh : : UpperBound ( dgroups , ngroups , idx ) ; <nl> - gsegs [ idx ] = group_idx - 1 ; <nl> - } ) ; <nl> - } <nl> - <nl> - / / Sort the groups by labels . We would like to avoid using predicates to perform the sort , <nl> - / / as thrust resorts to using a merge sort as opposed to a much much faster radix sort <nl> - / / when comparators are used . Hence , the following algorithm is used . This is done so that <nl> - / / we can grab the appropriate prediction values from the original list later , after the <nl> - / / labels are sorted . <nl> - / / <nl> - / / Here is the internal representation : <nl> - / / dgroups_ : [ 0 , 3 , 5 , 8 , 10 ] <nl> - / / group_segments_ : 0 0 0 | 1 1 | 2 2 2 | 3 3 <nl> - / / doriginal_pos_ : 0 1 2 | 3 4 | 5 6 7 | 8 9 <nl> - / / dsorted_labels_ : 1 0 1 | 2 1 | 1 3 3 | 4 4 ( from original labels ) <nl> - / / <nl> - / / Sort the labels first and make a note of the original positions in doriginal_pos_ <nl> - / / based on the sort <nl> - / / dsorted_labels_ : 4 4 3 3 2 1 1 1 1 0 <nl> - / / doriginal_pos_ : 8 9 6 7 3 0 2 4 5 1 <nl> - / / NOTE : This consumes space , but is much faster than some of the other approaches - sorting <nl> - / / in kernel , sorting using predicates etc . <nl> - void Sort ( const HostDeviceVector < bst_float > & dlabels ) { <nl> - dsorted_labels_ . assign ( dh : : tcbegin ( dlabels ) , dh : : tcend ( dlabels ) ) ; <nl> - thrust : : stable_sort_by_key ( thrust : : cuda : : par ( alloc_ ) , <nl> - dsorted_labels_ . begin ( ) , dsorted_labels_ . end ( ) , <nl> - doriginal_pos_ . begin ( ) , thrust : : greater < float > ( ) ) ; <nl> - <nl> - / / Next , gather the segments based on the doriginal_pos_ . This is to reflect the <nl> - / / holisitic label sort order on the segments <nl> - / / group_segments_c_ : 3 3 2 2 1 0 0 1 2 0 <nl> - / / doriginal_pos_ : 8 9 6 7 3 0 2 4 5 1 ( stays the same ) <nl> - thrust : : device_vector < uint32_t > group_segments_c ( group_segments_ ) ; <nl> - thrust : : gather ( doriginal_pos_ . begin ( ) , doriginal_pos_ . end ( ) , <nl> - group_segments_ . begin ( ) , group_segments_c . begin ( ) ) ; <nl> - <nl> - / / Now , sort the group segments so that you may bring the labels within the group together , <nl> - / / in the process also noting the relative changes to the doriginal_pos_ while that happens <nl> - / / group_segments_c_ : 0 0 0 1 1 2 2 2 3 3 <nl> - / / doriginal_pos_ : 0 2 1 3 4 6 7 5 8 9 <nl> - thrust : : stable_sort_by_key ( thrust : : cuda : : par ( alloc_ ) , <nl> - group_segments_c . begin ( ) , group_segments_c . end ( ) , <nl> - doriginal_pos_ . begin ( ) , thrust : : less < int > ( ) ) ; <nl> - <nl> - / / Finally , gather the original labels based on doriginal_pos_ to sort the input and <nl> - / / to store them in dsorted_labels_ <nl> - / / doriginal_pos_ : 0 2 1 3 4 6 7 5 8 9 ( stays the same ) <nl> - / / dsorted_labels_ : 1 1 0 2 1 3 3 1 4 4 ( from unsorted dlabels - dlabels ) <nl> - thrust : : gather ( doriginal_pos_ . begin ( ) , doriginal_pos_ . end ( ) , <nl> - dh : : tcbegin ( dlabels ) , dsorted_labels_ . begin ( ) ) ; <nl> - } <nl> - <nl> - ~ SortedLabelList ( ) { <nl> - dh : : safe_cuda ( cudaSetDevice ( device_id_ ) ) ; <nl> + / / Sort the labels that are grouped by ' groups ' <nl> + void Sort ( const HostDeviceVector < bst_float > & dlabels , const std : : vector < uint32_t > & groups ) { <nl> + this - > SortItems ( dlabels . ConstDevicePointer ( ) , dlabels . Size ( ) , groups ) ; <nl> } <nl> <nl> / / This kernel can only run * after * the kernel in sort is completed , as they <nl> / / use the default stream <nl> + template < typename LambdaWeightComputerT > <nl> void ComputeGradients ( const bst_float * dpreds , <nl> - GradientPair * out_gpair , <nl> const HostDeviceVector < bst_float > & weights , <nl> + int iter , <nl> + GradientPair * out_gpair , <nl> float weight_normalization_factor ) { <nl> / / Group info on device <nl> - const unsigned * dgroups = dgroups_ . data ( ) . get ( ) ; <nl> - size_t ngroups = dgroups_ . size ( ) ; <nl> + const uint32_t * dgroups = this - > GroupIndices ( ) ; <nl> + uint32_t ngroups = this - > NumGroups ( ) + 1 ; <nl> <nl> - auto total_items = group_segments_ . size ( ) ; <nl> - size_t niter = param_ . num_pairsample * total_items ; <nl> + uint32_t total_items = this - > NumItems ( ) ; <nl> + uint32_t niter = param_ . num_pairsample * total_items ; <nl> <nl> float fix_list_weight = param_ . fix_list_weight ; <nl> <nl> - const uint32_t * original_pos = doriginal_pos_ . data ( ) . get ( ) ; <nl> + const uint32_t * original_pos = this - > OriginalPositions ( ) ; <nl> <nl> - size_t num_weights = weights . Size ( ) ; <nl> + uint32_t num_weights = weights . Size ( ) ; <nl> auto dweights = num_weights ? weights . ConstDevicePointer ( ) : nullptr ; <nl> <nl> - const bst_float * sorted_labels = dsorted_labels_ . data ( ) . get ( ) ; <nl> + const bst_float * sorted_labels = this - > Items ( ) ; <nl> <nl> + / / This is used to adjust the weight of different elements based on the different ranking <nl> + / / objective function policies <nl> + LambdaWeightComputerT weight_computer ( dpreds , total_items , * this ) ; <nl> + auto wmultiplier = weight_computer . GetWeightMultiplier ( ) ; <nl> + <nl> + int device_id = - 1 ; <nl> + dh : : safe_cuda ( cudaGetDevice ( & device_id ) ) ; <nl> / / For each instance in the group , compute the gradient pair concurrently <nl> - dh : : LaunchN ( device_id_ , niter , nullptr , [ = ] __device__ ( size_t idx ) { <nl> + dh : : LaunchN ( device_id , niter , nullptr , [ = ] __device__ ( uint32_t idx ) { <nl> / / First , determine the group ' idx ' belongs to <nl> - unsigned item_idx = idx % total_items ; <nl> - int group_idx = dh : : UpperBound ( dgroups , ngroups , item_idx ) ; <nl> + uint32_t item_idx = idx % total_items ; <nl> + uint32_t group_idx = dh : : UpperBound ( dgroups , ngroups , item_idx ) ; <nl> / / Span of this group within the larger labels / predictions sorted tuple <nl> - int group_begin = dgroups [ group_idx - 1 ] ; <nl> - int group_end = dgroups [ group_idx ] ; <nl> - int total_group_items = group_end - group_begin ; <nl> + uint32_t group_begin = dgroups [ group_idx - 1 ] ; <nl> + uint32_t group_end = dgroups [ group_idx ] ; <nl> + uint32_t total_group_items = group_end - group_begin ; <nl> <nl> / / Are the labels diverse enough ? If they are all the same , then there is nothing to pick <nl> / / from another group - bail sooner <nl> class SortedLabelList { <nl> <nl> / / Find the number of labels less than and greater than the current label <nl> / / at the sorted index position item_idx <nl> - int nleft = CountNumLabelsToTheLeftOf ( <nl> - sorted_labels + group_begin , total_group_items , sorted_labels [ item_idx ] ) ; <nl> - int nright = CountNumLabelsToTheRightOf ( <nl> - sorted_labels + group_begin , total_group_items , sorted_labels [ item_idx ] ) ; <nl> + uint32_t nleft = CountNumItemsToTheLeftOf ( <nl> + sorted_labels + group_begin , item_idx - group_begin + 1 , sorted_labels [ item_idx ] ) ; <nl> + uint32_t nright = CountNumItemsToTheRightOf ( <nl> + sorted_labels + item_idx , group_end - item_idx , sorted_labels [ item_idx ] ) ; <nl> <nl> / / Create a minstd_rand object to act as our source of randomness <nl> - thrust : : minstd_rand rng ; <nl> - rng . discard ( idx ) ; <nl> + thrust : : minstd_rand rng ( ( iter + 1 ) * 1111 ) ; <nl> + rng . discard ( ( ( idx / total_items ) * total_group_items ) + item_idx - group_begin ) ; <nl> / / Create a uniform_int_distribution to produce a sample from outside of the <nl> / / present label group <nl> thrust : : uniform_int_distribution < int > dist ( 0 , nleft + nright - 1 ) ; <nl> class SortedLabelList { <nl> neg_idx = item_idx ; <nl> } else { <nl> pos_idx = item_idx ; <nl> - int items_in_group = total_group_items - nleft - nright ; <nl> + uint32_t items_in_group = total_group_items - nleft - nright ; <nl> neg_idx = sample + items_in_group + group_begin ; <nl> } <nl> <nl> class SortedLabelList { <nl> bst_float h = thrust : : max ( p * ( 1 . 0f - p ) , eps ) ; <nl> <nl> / / Rescale each gradient and hessian so that the group has a weighted constant <nl> - float scale = 1 . 0f / ( niter / total_items ) ; <nl> + float scale = __frcp_ru ( niter / total_items ) ; <nl> if ( fix_list_weight ! = 0 . 0f ) { <nl> scale * = fix_list_weight / total_group_items ; <nl> } <nl> <nl> float weight = num_weights ? dweights [ group_idx - 1 ] : 1 . 0f ; <nl> weight * = weight_normalization_factor ; <nl> + weight * = wmultiplier . GetWeight ( group_idx - 1 , pos_idx , neg_idx ) ; <nl> weight * = scale ; <nl> / / Accumulate gradient and hessian in both positive and negative indices <nl> const GradientPair in_pos_gpair ( g * weight , 2 . 0f * weight * h ) ; <nl> class SortedLabelList { <nl> const GradientPair in_neg_gpair ( - g * weight , 2 . 0f * weight * h ) ; <nl> dh : : AtomicAddGpair ( & out_gpair [ original_pos [ neg_idx ] ] , in_neg_gpair ) ; <nl> } ) ; <nl> + <nl> + / / Wait until the computations done by the kernel is complete <nl> + dh : : safe_cuda ( cudaStreamSynchronize ( nullptr ) ) ; <nl> } <nl> } ; <nl> # endif <nl> class LambdaRankObj : public ObjFunction { <nl> / / Check if we have a GPU assignment ; else , revert back to CPU <nl> auto device = tparam_ - > gpu_id ; <nl> if ( device > = 0 & & LambdaWeightComputerT : : SupportOnGPU ( ) ) { <nl> - ComputeGradientsOnGPU ( preds , info , out_gpair , gptr ) ; <nl> + ComputeGradientsOnGPU ( preds , info , iter , out_gpair , gptr ) ; <nl> } else { <nl> / / Revert back to CPU <nl> # endif <nl> class LambdaRankObj : public ObjFunction { <nl> LOG ( DEBUG ) < < " Computing pairwise gradients on CPU . " ; <nl> <nl> bst_float weight_normalization_factor = ComputeWeightNormalizationFactor ( info , gptr ) ; <nl> + <nl> + const auto & preds_h = preds . HostVector ( ) ; <nl> + const auto & labels = info . labels_ . HostVector ( ) ; <nl> + std : : vector < GradientPair > & gpair = out_gpair - > HostVector ( ) ; <nl> + const auto ngroup = static_cast < bst_omp_uint > ( gptr . size ( ) - 1 ) ; <nl> out_gpair - > Resize ( preds . Size ( ) ) ; <nl> + <nl> # pragma omp parallel <nl> { <nl> / / parallel construct , declare random number generator here , so that each <nl> / / thread use its own random number generator , seed by thread id and current iteration <nl> - common : : RandomEngine rnd ( iter * 1111 + omp_get_thread_num ( ) ) ; <nl> - <nl> + std : : minstd_rand rnd ( ( iter + 1 ) * 1111 ) ; <nl> std : : vector < LambdaPair > pairs ; <nl> std : : vector < ListEntry > lst ; <nl> std : : vector < std : : pair < bst_float , unsigned > > rec ; <nl> - const auto & preds_h = preds . HostVector ( ) ; <nl> - const auto & labels = info . labels_ . HostVector ( ) ; <nl> - std : : vector < GradientPair > & gpair = out_gpair - > HostVector ( ) ; <nl> - const auto ngroup = static_cast < bst_omp_uint > ( gptr . size ( ) - 1 ) ; <nl> <nl> # pragma omp for schedule ( static ) <nl> for ( bst_omp_uint k = 0 ; k < ngroup ; + + k ) { <nl> class LambdaRankObj : public ObjFunction { <nl> lst . emplace_back ( preds_h [ j ] , labels [ j ] , j ) ; <nl> gpair [ j ] = GradientPair ( 0 . 0f , 0 . 0f ) ; <nl> } <nl> - std : : sort ( lst . begin ( ) , lst . end ( ) , ListEntry : : CmpPred ) ; <nl> + std : : stable_sort ( lst . begin ( ) , lst . end ( ) , ListEntry : : CmpPred ) ; <nl> rec . resize ( lst . size ( ) ) ; <nl> for ( unsigned i = 0 ; i < lst . size ( ) ; + + i ) { <nl> rec [ i ] = std : : make_pair ( lst [ i ] . label , i ) ; <nl> } <nl> - std : : sort ( rec . begin ( ) , rec . end ( ) , common : : CmpFirst ) ; <nl> + std : : stable_sort ( rec . begin ( ) , rec . end ( ) , common : : CmpFirst ) ; <nl> / / enumerate buckets with same label , for each item in the lst , grab another sample randomly <nl> for ( unsigned i = 0 ; i < rec . size ( ) ; ) { <nl> unsigned j = i + 1 ; <nl> class LambdaRankObj : public ObjFunction { <nl> # if defined ( __CUDACC__ ) <nl> void ComputeGradientsOnGPU ( const HostDeviceVector < bst_float > & preds , <nl> const MetaInfo & info , <nl> + int iter , <nl> HostDeviceVector < GradientPair > * out_gpair , <nl> const std : : vector < unsigned > & gptr ) { <nl> LOG ( DEBUG ) < < " Computing pairwise gradients on GPU . " ; <nl> class LambdaRankObj : public ObjFunction { <nl> auto d_preds = preds . ConstDevicePointer ( ) ; <nl> auto d_gpair = out_gpair - > DevicePointer ( ) ; <nl> <nl> - if ( ! slist_ ) { <nl> - slist_ . reset ( new SortedLabelList ( device , param_ ) ) ; <nl> - } <nl> - <nl> - / / Create segments based on group info <nl> - slist_ - > InitWithTrainingInfo ( gptr ) ; <nl> + SortedLabelList slist ( param_ ) ; <nl> <nl> / / Sort the labels within the groups on the device <nl> - slist_ - > Sort ( info . labels_ ) ; <nl> + slist . Sort ( info . labels_ , gptr ) ; <nl> <nl> / / Initialize the gradients next <nl> out_gpair - > Fill ( GradientPair ( 0 . 0f , 0 . 0f ) ) ; <nl> <nl> / / Finally , compute the gradients <nl> - slist_ - > ComputeGradients ( d_preds , d_gpair , info . weights_ , weight_normalization_factor ) ; <nl> - <nl> - / / Wait until the computations done by the kernel is complete <nl> - dh : : safe_cuda ( cudaStreamSynchronize ( nullptr ) ) ; <nl> + slist . ComputeGradients < LambdaWeightComputerT > <nl> + ( d_preds , info . weights_ , iter , d_gpair , weight_normalization_factor ) ; <nl> } <nl> # endif <nl> <nl> LambdaRankParam param_ ; <nl> - # if defined ( __CUDACC__ ) <nl> - std : : unique_ptr < SortedLabelList > slist_ ; <nl> - # endif <nl> } ; <nl> <nl> + # if ! defined ( GTEST_TEST ) <nl> / / register the objective functions <nl> DMLC_REGISTER_PARAMETER ( LambdaRankParam ) ; <nl> <nl> XGBOOST_REGISTER_OBJECTIVE ( LambdaRankNDCG , NDCGLambdaWeightComputer : : Name ( ) ) <nl> XGBOOST_REGISTER_OBJECTIVE ( LambdaRankObjMAP , MAPLambdaWeightComputer : : Name ( ) ) <nl> . describe ( " LambdaRank with MAP as objective . " ) <nl> . set_body ( [ ] ( ) { return new LambdaRankObj < MAPLambdaWeightComputer > ( ) ; } ) ; <nl> + # endif <nl> <nl> } / / namespace obj <nl> } / / namespace xgboost <nl> mmm a / tests / cpp / objective / test_ranking_obj . cc <nl> ppp b / tests / cpp / objective / test_ranking_obj . cc <nl> TEST ( Objective , DeclareUnifiedTest ( PairwiseRankingGPairSameLabels ) ) { <nl> ASSERT_NO_THROW ( obj - > DefaultEvalMetric ( ) ) ; <nl> } <nl> <nl> + TEST ( Objective , DeclareUnifiedTest ( NDCGRankingGPair ) ) { <nl> + std : : vector < std : : pair < std : : string , std : : string > > args ; <nl> + xgboost : : GenericParameter lparam = xgboost : : CreateEmptyGenericParam ( GPUIDX ) ; <nl> + <nl> + std : : unique_ptr < xgboost : : ObjFunction > obj { <nl> + xgboost : : ObjFunction : : Create ( " rank : ndcg " , & lparam ) <nl> + } ; <nl> + obj - > Configure ( args ) ; <nl> + CheckConfigReload ( obj , " rank : ndcg " ) ; <nl> + <nl> + / / Test with setting sample weight to second query group <nl> + CheckRankingObjFunction ( obj , <nl> + { 0 , 0 . 1f , 0 , 0 . 1f } , <nl> + { 0 , 1 , 0 , 1 } , <nl> + { 2 . 0f , 0 . 0f } , <nl> + { 0 , 2 , 4 } , <nl> + { 0 . 7f , - 0 . 7f , 0 . 0f , 0 . 0f } , <nl> + { 0 . 74f , 0 . 74f , 0 . 0f , 0 . 0f } ) ; <nl> + <nl> + CheckRankingObjFunction ( obj , <nl> + { 0 , 0 . 1f , 0 , 0 . 1f } , <nl> + { 0 , 1 , 0 , 1 } , <nl> + { 1 . 0f , 1 . 0f } , <nl> + { 0 , 2 , 4 } , <nl> + { 0 . 35f , - 0 . 35f , 0 . 35f , - 0 . 35f } , <nl> + { 0 . 368f , 0 . 368f , 0 . 368f , 0 . 368f } ) ; <nl> + ASSERT_NO_THROW ( obj - > DefaultEvalMetric ( ) ) ; <nl> + } <nl> + <nl> } / / namespace xgboost <nl> mmm a / tests / cpp / objective / test_ranking_obj_gpu . cu <nl> ppp b / tests / cpp / objective / test_ranking_obj_gpu . cu <nl> @ @ - 1 + 1 , 159 @ @ <nl> # include " test_ranking_obj . cc " <nl> + <nl> + # include " . . / . . / . . / src / objective / rank_obj . cu " <nl> + <nl> + namespace xgboost { <nl> + <nl> + template < typename T = uint32_t , typename Comparator = thrust : : greater < T > > <nl> + std : : unique_ptr < xgboost : : obj : : SegmentSorter < T > > <nl> + RankSegmentSorterTestImpl ( const std : : vector < uint32_t > & group_indices , <nl> + const std : : vector < T > & hlabels , <nl> + const std : : vector < T > & expected_sorted_hlabels , <nl> + const std : : vector < uint32_t > & expected_orig_pos <nl> + ) { <nl> + std : : unique_ptr < xgboost : : obj : : SegmentSorter < T > > seg_sorter_ptr ( <nl> + new xgboost : : obj : : SegmentSorter < T > ) ; <nl> + xgboost : : obj : : SegmentSorter < T > & seg_sorter ( * seg_sorter_ptr ) ; <nl> + <nl> + / / Create a bunch of unsorted labels on the device and sort it via the segment sorter <nl> + dh : : device_vector < T > dlabels ( hlabels ) ; <nl> + seg_sorter . SortItems ( dlabels . data ( ) . get ( ) , dlabels . size ( ) , group_indices , Comparator ( ) ) ; <nl> + <nl> + EXPECT_EQ ( seg_sorter . NumItems ( ) , group_indices . back ( ) ) ; <nl> + EXPECT_EQ ( seg_sorter . NumGroups ( ) , group_indices . size ( ) - 1 ) ; <nl> + <nl> + / / Check the labels <nl> + dh : : device_vector < T > sorted_dlabels ( seg_sorter . NumItems ( ) ) ; <nl> + sorted_dlabels . assign ( thrust : : device_ptr < const T > ( seg_sorter . Items ( ) ) , <nl> + thrust : : device_ptr < const T > ( seg_sorter . Items ( ) ) <nl> + + seg_sorter . NumItems ( ) ) ; <nl> + thrust : : host_vector < T > sorted_hlabels ( sorted_dlabels ) ; <nl> + EXPECT_EQ ( expected_sorted_hlabels , sorted_hlabels ) ; <nl> + <nl> + / / Check the indices <nl> + dh : : device_vector < uint32_t > dorig_pos ( seg_sorter . NumItems ( ) ) ; <nl> + dorig_pos . assign ( thrust : : device_ptr < const uint32_t > ( seg_sorter . OriginalPositions ( ) ) , <nl> + thrust : : device_ptr < const uint32_t > ( seg_sorter . OriginalPositions ( ) ) <nl> + + seg_sorter . NumItems ( ) ) ; <nl> + dh : : device_vector < uint32_t > horig_pos ( dorig_pos ) ; <nl> + EXPECT_EQ ( expected_orig_pos , horig_pos ) ; <nl> + <nl> + return seg_sorter_ptr ; <nl> + } <nl> + <nl> + TEST ( Objective , RankSegmentSorterTest ) { <nl> + RankSegmentSorterTestImpl ( { 0 , 2 , 4 , 7 , 10 , 14 , 18 , 22 , 26 } , / / Groups <nl> + { 1 , 1 , / / Labels <nl> + 1 , 2 , <nl> + 3 , 2 , 1 , <nl> + 1 , 2 , 1 , <nl> + 1 , 3 , 4 , 2 , <nl> + 1 , 2 , 1 , 1 , <nl> + 1 , 2 , 2 , 3 , <nl> + 3 , 3 , 1 , 2 } , <nl> + { 1 , 1 , / / Expected sorted labels <nl> + 2 , 1 , <nl> + 3 , 2 , 1 , <nl> + 2 , 1 , 1 , <nl> + 4 , 3 , 2 , 1 , <nl> + 2 , 1 , 1 , 1 , <nl> + 3 , 2 , 2 , 1 , <nl> + 3 , 3 , 2 , 1 } , <nl> + { 0 , 1 , / / Expected original positions <nl> + 3 , 2 , <nl> + 4 , 5 , 6 , <nl> + 8 , 7 , 9 , <nl> + 12 , 11 , 13 , 10 , <nl> + 15 , 14 , 16 , 17 , <nl> + 21 , 19 , 20 , 18 , <nl> + 22 , 23 , 25 , 24 } ) ; <nl> + } <nl> + <nl> + TEST ( Objective , RankSegmentSorterSingleGroupTest ) { <nl> + RankSegmentSorterTestImpl ( { 0 , 7 } , / / Groups <nl> + { 6 , 1 , 4 , 3 , 0 , 5 , 2 } , / / Labels <nl> + { 6 , 5 , 4 , 3 , 2 , 1 , 0 } , / / Expected sorted labels <nl> + { 0 , 5 , 2 , 3 , 6 , 1 , 4 } ) ; / / Expected original positions <nl> + } <nl> + <nl> + TEST ( Objective , RankSegmentSorterAscendingTest ) { <nl> + RankSegmentSorterTestImpl < uint32_t , thrust : : less < uint32_t > > ( <nl> + { 0 , 4 , 7 } , / / Groups <nl> + { 3 , 1 , 4 , 2 , / / Labels <nl> + 6 , 5 , 7 } , <nl> + { 1 , 2 , 3 , 4 , / / Expected sorted labels <nl> + 5 , 6 , 7 } , <nl> + { 1 , 3 , 0 , 2 , / / Expected original positions <nl> + 5 , 4 , 6 } ) ; <nl> + } <nl> + <nl> + using CountFunctor = uint32_t ( * ) ( const int * , uint32_t , int ) ; <nl> + void RankItemCountImpl ( const std : : vector < int > & sorted_items , CountFunctor f , <nl> + int find_val , uint32_t exp_val ) { <nl> + EXPECT_NE ( std : : find ( sorted_items . begin ( ) , sorted_items . end ( ) , find_val ) , sorted_items . end ( ) ) ; <nl> + EXPECT_EQ ( f ( & sorted_items [ 0 ] , sorted_items . size ( ) , find_val ) , exp_val ) ; <nl> + } <nl> + <nl> + TEST ( Objective , RankItemCountOnLeft ) { <nl> + / / Items sorted descendingly <nl> + std : : vector < int > sorted_items { 10 , 10 , 6 , 4 , 4 , 4 , 4 , 1 , 1 , 1 , 1 , 1 , 0 } ; <nl> + RankItemCountImpl ( sorted_items , & xgboost : : obj : : CountNumItemsToTheLeftOf , <nl> + 10 , static_cast < uint32_t > ( 0 ) ) ; <nl> + RankItemCountImpl ( sorted_items , & xgboost : : obj : : CountNumItemsToTheLeftOf , <nl> + 6 , static_cast < uint32_t > ( 2 ) ) ; <nl> + RankItemCountImpl ( sorted_items , & xgboost : : obj : : CountNumItemsToTheLeftOf , <nl> + 4 , static_cast < uint32_t > ( 3 ) ) ; <nl> + RankItemCountImpl ( sorted_items , & xgboost : : obj : : CountNumItemsToTheLeftOf , <nl> + 1 , static_cast < uint32_t > ( 7 ) ) ; <nl> + RankItemCountImpl ( sorted_items , & xgboost : : obj : : CountNumItemsToTheLeftOf , <nl> + 0 , static_cast < uint32_t > ( 12 ) ) ; <nl> + } <nl> + <nl> + TEST ( Objective , RankItemCountOnRight ) { <nl> + / / Items sorted descendingly <nl> + std : : vector < int > sorted_items { 10 , 10 , 6 , 4 , 4 , 4 , 4 , 1 , 1 , 1 , 1 , 1 , 0 } ; <nl> + RankItemCountImpl ( sorted_items , & xgboost : : obj : : CountNumItemsToTheRightOf , <nl> + 10 , static_cast < uint32_t > ( 11 ) ) ; <nl> + RankItemCountImpl ( sorted_items , & xgboost : : obj : : CountNumItemsToTheRightOf , <nl> + 6 , static_cast < uint32_t > ( 10 ) ) ; <nl> + RankItemCountImpl ( sorted_items , & xgboost : : obj : : CountNumItemsToTheRightOf , <nl> + 4 , static_cast < uint32_t > ( 6 ) ) ; <nl> + RankItemCountImpl ( sorted_items , & xgboost : : obj : : CountNumItemsToTheRightOf , <nl> + 1 , static_cast < uint32_t > ( 1 ) ) ; <nl> + RankItemCountImpl ( sorted_items , & xgboost : : obj : : CountNumItemsToTheRightOf , <nl> + 0 , static_cast < uint32_t > ( 0 ) ) ; <nl> + } <nl> + <nl> + TEST ( Objective , NDCGLambdaWeightComputerTest ) { <nl> + auto segment_label_sorter = RankSegmentSorterTestImpl < float > ( <nl> + { 0 , 4 , 7 , 12 } , / / Groups <nl> + { 3 . 1f , 1 . 2f , 2 . 3f , 4 . 4f , / / Labels <nl> + 7 . 8f , 5 . 01f , 6 . 96f , <nl> + 10 . 3f , 8 . 7f , 11 . 4f , 9 . 45f , 11 . 4f } , <nl> + { 4 . 4f , 3 . 1f , 2 . 3f , 1 . 2f , / / Expected sorted labels <nl> + 7 . 8f , 6 . 96f , 5 . 01f , <nl> + 11 . 4f , 11 . 4f , 10 . 3f , 9 . 45f , 8 . 7f } , <nl> + { 3 , 0 , 2 , 1 , / / Expected original positions <nl> + 4 , 6 , 5 , <nl> + 9 , 11 , 7 , 10 , 8 } ) ; <nl> + <nl> + / / Created segmented predictions for the labels from above <nl> + std : : vector < bst_float > hpreds { - 9 . 78f , 24 . 367f , 0 . 908f , - 11 . 47f , <nl> + - 1 . 03f , - 2 . 79f , - 3 . 1f , <nl> + 104 . 22f , 103 . 1f , - 101 . 7f , 100 . 5f , 45 . 1f } ; <nl> + dh : : device_vector < bst_float > dpreds ( hpreds ) ; <nl> + xgboost : : obj : : NDCGLambdaWeightComputer ndcg_lw_computer ( dpreds . data ( ) . get ( ) , <nl> + dpreds . size ( ) , <nl> + * segment_label_sorter ) ; <nl> + <nl> + / / Where will the predictions move from its current position , if they were sorted <nl> + / / descendingly ? <nl> + auto dsorted_pred_pos = ndcg_lw_computer . GetSortedPredPos ( ) ; <nl> + thrust : : host_vector < uint32_t > hsorted_pred_pos ( dsorted_pred_pos ) ; <nl> + std : : vector < uint32_t > expected_sorted_pred_pos { 2 , 0 , 1 , 3 , <nl> + 4 , 5 , 6 , <nl> + 7 , 8 , 11 , 9 , 10 } ; <nl> + EXPECT_EQ ( expected_sorted_pred_pos , hsorted_pred_pos ) ; <nl> + } <nl> + <nl> + } / / namespace xgboost <nl> new file mode 100644 <nl> index 0000000000 . . d51d7f0067 <nl> mmm / dev / null <nl> ppp b / tests / python - gpu / test_gpu_ranking . py <nl> <nl> + import numpy as np <nl> + from scipy . sparse import csr_matrix <nl> + import xgboost <nl> + import os <nl> + import math <nl> + import unittest <nl> + import itertools <nl> + import shutil <nl> + import urllib . request <nl> + import zipfile <nl> + <nl> + class TestRanking ( unittest . TestCase ) : <nl> + @ classmethod <nl> + def setUpClass ( cls ) : <nl> + " " " <nl> + Download and setup the test fixtures <nl> + " " " <nl> + from sklearn . datasets import load_svmlight_files <nl> + # download the test data <nl> + cls . dpath = ' demo / rank / ' <nl> + src = ' https : / / s3 - us - west - 2 . amazonaws . com / xgboost - examples / MQ2008 . zip ' <nl> + target = cls . dpath + ' / MQ2008 . zip ' <nl> + <nl> + if os . path . exists ( cls . dpath ) and os . path . exists ( target ) : <nl> + print ( " Skipping dataset download . . . " ) <nl> + else : <nl> + urllib . request . urlretrieve ( url = src , filename = target ) <nl> + with zipfile . ZipFile ( target , ' r ' ) as f : <nl> + f . extractall ( path = cls . dpath ) <nl> + <nl> + ( x_train , y_train , qid_train , x_test , y_test , qid_test , <nl> + x_valid , y_valid , qid_valid ) = load_svmlight_files ( <nl> + ( cls . dpath + " MQ2008 / Fold1 / train . txt " , <nl> + cls . dpath + " MQ2008 / Fold1 / test . txt " , <nl> + cls . dpath + " MQ2008 / Fold1 / vali . txt " ) , <nl> + query_id = True , zero_based = False ) <nl> + # instantiate the matrices <nl> + cls . dtrain = xgboost . DMatrix ( x_train , y_train ) <nl> + cls . dvalid = xgboost . DMatrix ( x_valid , y_valid ) <nl> + cls . dtest = xgboost . DMatrix ( x_test , y_test ) <nl> + # set the group counts from the query IDs <nl> + cls . dtrain . set_group ( [ len ( list ( items ) ) <nl> + for _key , items in itertools . groupby ( qid_train ) ] ) <nl> + cls . dtest . set_group ( [ len ( list ( items ) ) <nl> + for _key , items in itertools . groupby ( qid_test ) ] ) <nl> + cls . dvalid . set_group ( [ len ( list ( items ) ) <nl> + for _key , items in itertools . groupby ( qid_valid ) ] ) <nl> + # save the query IDs for testing <nl> + cls . qid_train = qid_train <nl> + cls . qid_test = qid_test <nl> + cls . qid_valid = qid_valid <nl> + <nl> + # model training parameters <nl> + cls . params = { ' booster ' : ' gbtree ' , <nl> + ' tree_method ' : ' gpu_hist ' , <nl> + ' gpu_id ' : 0 , <nl> + ' predictor ' : ' gpu_predictor ' <nl> + } <nl> + cls . cpu_params = { ' booster ' : ' gbtree ' , <nl> + ' tree_method ' : ' hist ' , <nl> + ' gpu_id ' : - 1 , <nl> + ' predictor ' : ' cpu_predictor ' <nl> + } <nl> + <nl> + @ classmethod <nl> + def tearDownClass ( cls ) : <nl> + " " " <nl> + Cleanup test artifacts from download and unpacking <nl> + : return : <nl> + " " " <nl> + os . remove ( cls . dpath + " MQ2008 . zip " ) <nl> + shutil . rmtree ( cls . dpath + " MQ2008 " ) <nl> + <nl> + @ classmethod <nl> + def __test_training_with_rank_objective ( cls , rank_objective , metric_name , tolerance = 1e - 02 ) : <nl> + " " " <nl> + Internal method that trains the dataset using the rank objective on GPU and CPU , evaluates <nl> + the metric and determines if the delta between the metric is within the tolerance level <nl> + : return : <nl> + " " " <nl> + # specify validations set to watch performance <nl> + watchlist = [ ( cls . dtest , ' eval ' ) , ( cls . dtrain , ' train ' ) ] <nl> + <nl> + num_trees = 2500 <nl> + check_metric_improvement_rounds = 10 <nl> + <nl> + evals_result = { } <nl> + cls . params [ ' objective ' ] = rank_objective <nl> + cls . params [ ' eval_metric ' ] = metric_name <nl> + bst = xgboost . train ( cls . params , cls . dtrain , num_boost_round = num_trees , <nl> + early_stopping_rounds = check_metric_improvement_rounds , <nl> + evals = watchlist , evals_result = evals_result ) <nl> + gpu_map_metric = evals_result [ ' train ' ] [ metric_name ] [ - 1 ] <nl> + <nl> + evals_result = { } <nl> + cls . cpu_params [ ' objective ' ] = rank_objective <nl> + cls . cpu_params [ ' eval_metric ' ] = metric_name <nl> + bstc = xgboost . train ( cls . cpu_params , cls . dtrain , num_boost_round = num_trees , <nl> + early_stopping_rounds = check_metric_improvement_rounds , <nl> + evals = watchlist , evals_result = evals_result ) <nl> + cpu_map_metric = evals_result [ ' train ' ] [ metric_name ] [ - 1 ] <nl> + <nl> + print ( " { 0 } gpu { 1 } metric { 2 } " . format ( rank_objective , metric_name , gpu_map_metric ) ) <nl> + print ( " { 0 } cpu { 1 } metric { 2 } " . format ( rank_objective , metric_name , cpu_map_metric ) ) <nl> + print ( " gpu best score { 0 } cpu best score { 1 } " . format ( bst . best_score , bstc . best_score ) ) <nl> + assert np . allclose ( gpu_map_metric , cpu_map_metric , tolerance , tolerance ) <nl> + assert np . allclose ( bst . best_score , bstc . best_score , tolerance , tolerance ) <nl> + <nl> + def test_training_rank_pairwise_map_metric ( self ) : <nl> + " " " <nl> + Train an XGBoost ranking model with pairwise objective function and compare map metric <nl> + " " " <nl> + self . __test_training_with_rank_objective ( ' rank : pairwise ' , ' map ' ) <nl> + <nl> + def test_training_rank_pairwise_auc_metric ( self ) : <nl> + " " " <nl> + Train an XGBoost ranking model with pairwise objective function and compare auc metric <nl> + " " " <nl> + self . __test_training_with_rank_objective ( ' rank : pairwise ' , ' auc ' ) <nl> + <nl> + def test_training_rank_pairwise_ndcg_metric ( self ) : <nl> + " " " <nl> + Train an XGBoost ranking model with pairwise objective function and compare ndcg metric <nl> + " " " <nl> + self . __test_training_with_rank_objective ( ' rank : pairwise ' , ' ndcg ' ) <nl> + <nl> + def test_training_rank_ndcg_map ( self ) : <nl> + " " " <nl> + Train an XGBoost ranking model with ndcg objective function and compare map metric <nl> + " " " <nl> + self . __test_training_with_rank_objective ( ' rank : ndcg ' , ' map ' ) <nl> + <nl> + def test_training_rank_ndcg_auc ( self ) : <nl> + " " " <nl> + Train an XGBoost ranking model with ndcg objective function and compare auc metric <nl> + " " " <nl> + self . __test_training_with_rank_objective ( ' rank : ndcg ' , ' auc ' ) <nl> + <nl> + def test_training_rank_ndcg_ndcg ( self ) : <nl> + " " " <nl> + Train an XGBoost ranking model with ndcg objective function and compare ndcg metric <nl> + " " " <nl> + self . __test_training_with_rank_objective ( ' rank : ndcg ' , ' ndcg ' ) <nl>
- ndcg ltr implementation on gpu ( )
dmlc/xgboost
2abe69d7744b4f695ffcf89a6add16233bfc7986
2019-11-12T22:21:04Z
mmm a / include / swift / AST / Decl . h <nl> ppp b / include / swift / AST / Decl . h <nl> namespace swift { <nl> class ASTContext ; <nl> class ASTWalker ; <nl> class Type ; <nl> - class ClassType ; <nl> class Expr ; <nl> class FuncDecl ; <nl> class FuncExpr ; <nl> namespace swift { <nl> class Component ; <nl> class DeclAttributes ; <nl> class OneOfElementDecl ; <nl> - class OneOfType ; <nl> class NameAliasType ; <nl> - class NominalType ; <nl> class Pattern ; <nl> class ProtocolType ; <nl> enum class Resilience : unsigned char ; <nl> class TypeAliasDecl ; <nl> class Stmt ; <nl> - class StructType ; <nl> - class TupleType ; <nl> class ValueDecl ; <nl> <nl> enum class DeclKind { <nl> class VarDecl : public ValueDecl { <nl> } ; <nl> <nl> GetSetRecord * GetSet ; <nl> - <nl> + VarDecl * OverriddenDecl ; <nl> + <nl> public : <nl> VarDecl ( SourceLoc VarLoc , Identifier Name , Type Ty , DeclContext * DC ) <nl> : ValueDecl ( DeclKind : : Var , DC , Name , Ty ) , <nl> - VarLoc ( VarLoc ) , GetSet ( ) { } <nl> + VarLoc ( VarLoc ) , GetSet ( ) , OverriddenDecl ( nullptr ) { } <nl> <nl> SourceLoc getLoc ( ) const { return VarLoc ; } <nl> SourceLoc getStartLoc ( ) const { return VarLoc ; } <nl> class VarDecl : public ValueDecl { <nl> / / / \ brief Retrieve the setter used to mutate the value of this variable . <nl> FuncDecl * getSetter ( ) const { return GetSet ? GetSet - > Set : nullptr ; } <nl> <nl> + VarDecl * getOverriddenDecl ( ) const { return OverriddenDecl ; } <nl> + void setOverriddenDecl ( VarDecl * over ) { OverriddenDecl = over ; } <nl> + <nl> / / Implement isa / cast / dyncast / etc . <nl> static bool classof ( const Decl * D ) { return D - > getKind ( ) = = DeclKind : : Var ; } <nl> static bool classof ( const VarDecl * D ) { return true ; } <nl> class FuncDecl : public ValueDecl { <nl> GenericParamList * GenericParams ; <nl> FuncExpr * Body ; <nl> llvm : : PointerIntPair < Decl * , 1 , bool > GetOrSetDecl ; <nl> - <nl> + FuncDecl * OverriddenDecl ; <nl> + <nl> public : <nl> FuncDecl ( SourceLoc StaticLoc , SourceLoc FuncLoc , Identifier Name , <nl> SourceLoc NameLoc , GenericParamList * GenericParams , Type Ty , <nl> FuncExpr * Body , DeclContext * DC ) <nl> : ValueDecl ( DeclKind : : Func , DC , Name , Ty ) , StaticLoc ( StaticLoc ) , <nl> FuncLoc ( FuncLoc ) , NameLoc ( NameLoc ) , GenericParams ( GenericParams ) , <nl> - Body ( Body ) { } <nl> + Body ( Body ) , OverriddenDecl ( nullptr ) { } <nl> <nl> bool isStatic ( ) const { <nl> return StaticLoc . isValid ( ) | | getName ( ) . isOperator ( ) ; <nl> class FuncDecl : public ValueDecl { <nl> / / / getGetterOrSetterDecl - Return the declaration for which this function <nl> / / / is a getter or setter , if it is one . <nl> Decl * getGetterOrSetterDecl ( ) const { return GetOrSetDecl . getPointer ( ) ; } <nl> - <nl> + <nl> + FuncDecl * getOverriddenDecl ( ) const { return OverriddenDecl ; } <nl> + void setOverriddenDecl ( FuncDecl * over ) { OverriddenDecl = over ; } <nl> + <nl> / / Implement isa / cast / dyncast / etc . <nl> static bool classof ( const Decl * D ) { return D - > getKind ( ) = = DeclKind : : Func ; } <nl> static bool classof ( const FuncDecl * D ) { return true ; } <nl> class SubscriptDecl : public ValueDecl { <nl> SourceRange Braces ; <nl> FuncDecl * Get ; <nl> FuncDecl * Set ; <nl> - <nl> + SubscriptDecl * OverriddenDecl ; <nl> + <nl> public : <nl> SubscriptDecl ( Identifier NameHack , SourceLoc SubscriptLoc , Pattern * Indices , <nl> SourceLoc ArrowLoc , TypeLoc ElementTy , <nl> class SubscriptDecl : public ValueDecl { <nl> : ValueDecl ( DeclKind : : Subscript , Parent , NameHack , Type ( ) ) , <nl> SubscriptLoc ( SubscriptLoc ) , <nl> ArrowLoc ( ArrowLoc ) , Indices ( Indices ) , ElementTy ( ElementTy ) , <nl> - Braces ( Braces ) , Get ( Get ) , Set ( Set ) { } <nl> + Braces ( Braces ) , Get ( Get ) , Set ( Set ) , OverriddenDecl ( nullptr ) { } <nl> <nl> SourceLoc getStartLoc ( ) const { return SubscriptLoc ; } <nl> SourceLoc getLoc ( ) const ; <nl> class SubscriptDecl : public ValueDecl { <nl> static bool classof ( const Decl * D ) { <nl> return D - > getKind ( ) = = DeclKind : : Subscript ; <nl> } <nl> - <nl> + <nl> + SubscriptDecl * getOverriddenDecl ( ) const { return OverriddenDecl ; } <nl> + void setOverriddenDecl ( SubscriptDecl * over ) { OverriddenDecl = over ; } <nl> + <nl> static bool classof ( const SubscriptDecl * D ) { return true ; } <nl> } ; <nl> <nl> mmm a / include / swift / AST / Diagnostics . def <nl> ppp b / include / swift / AST / Diagnostics . def <nl> ERROR ( requires_generic_param_equal , sema_tcd , none , <nl> " same - type requirement makes generic parameters % 0 and % 1 equivalent " , <nl> ( Identifier , Identifier ) ) <nl> <nl> + ERROR ( override_multiple_decls_base , sema_tcd , none , <nl> + " declaration cannot override more than one base class declaration " , ( ) ) <nl> + ERROR ( override_multiple_decls_derived , sema_tcd , none , <nl> + " declaration cannot be overridden by more than one derived class " <nl> + " declaration " , ( ) ) <nl> + ERROR ( override_decl_extension , sema_tcd , none , <nl> + " declarations from extensions cannot be overridden yet " , ( ) ) <nl> + ERROR ( overload_base_decl , sema_tcd , none , <nl> + " cannot overload a declaration from a base class " , ( ) ) <nl> + <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> / / Type Check Expressions <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> mmm a / include / swift / AST / NameLookup . h <nl> ppp b / include / swift / AST / NameLookup . h <nl> class MemberLookup { <nl> typedef llvm : : SmallPtrSet < TypeDecl * , 8 > VisitedSet ; <nl> void doIt ( Type BaseTy , Module & M , VisitedSet & Visited ) ; <nl> void lookupMembers ( Type BaseType , Module & M , <nl> + llvm : : SmallPtrSet < ValueDecl * , 8 > & Overridden , <nl> SmallVectorImpl < ValueDecl * > & Result ) ; <nl> } ; <nl> <nl> mmm a / lib / AST / NameLookup . cpp <nl> ppp b / lib / AST / NameLookup . cpp <nl> void MemberLookup : : doIt ( Type BaseTy , Module & M , VisitedSet & Visited ) { <nl> return ; <nl> } <nl> <nl> + llvm : : SmallPtrSet < ValueDecl * , 8 > OverriddenMethods ; <nl> do { <nl> / / Look in for members of a nominal type . <nl> SmallVector < ValueDecl * , 8 > ExtensionMethods ; <nl> - lookupMembers ( BaseTy , M , ExtensionMethods ) ; <nl> + lookupMembers ( BaseTy , M , OverriddenMethods , ExtensionMethods ) ; <nl> <nl> for ( ValueDecl * VD : ExtensionMethods ) { <nl> if ( TypeDecl * TAD = dyn_cast < TypeDecl > ( VD ) ) { <nl> void MemberLookup : : doIt ( Type BaseTy , Module & M , VisitedSet & Visited ) { <nl> } <nl> <nl> void MemberLookup : : lookupMembers ( Type BaseType , Module & M , <nl> + llvm : : SmallPtrSet < ValueDecl * , 8 > & Overridden , <nl> SmallVectorImpl < ValueDecl * > & Result ) { <nl> - assert ( Results . empty ( ) & & <nl> - " This expects that the input list is empty , could be generalized " ) ; <nl> - <nl> NominalTypeDecl * D ; <nl> ArrayRef < ValueDecl * > BaseMembers ; <nl> SmallVector < ValueDecl * , 2 > BaseMembersStorage ; <nl> void MemberLookup : : lookupMembers ( Type BaseType , Module & M , <nl> } <nl> <nl> for ( Decl * Member : D - > getMembers ( ) ) { <nl> - if ( ValueDecl * VD = dyn_cast < ValueDecl > ( Member ) ) <nl> - BaseMembersStorage . push_back ( VD ) ; <nl> + if ( ValueDecl * VD = dyn_cast < ValueDecl > ( Member ) ) { <nl> + if ( auto FD = dyn_cast < FuncDecl > ( VD ) ) { <nl> + if ( FD - > getOverriddenDecl ( ) ) <nl> + Overridden . insert ( FD - > getOverriddenDecl ( ) ) ; <nl> + } else if ( auto VarD = dyn_cast < VarDecl > ( VD ) ) { <nl> + if ( VarD - > getOverriddenDecl ( ) ) <nl> + Overridden . insert ( VarD - > getOverriddenDecl ( ) ) ; <nl> + } else if ( auto SD = dyn_cast < SubscriptDecl > ( VD ) ) { <nl> + if ( SD - > getOverriddenDecl ( ) ) <nl> + Overridden . insert ( SD - > getOverriddenDecl ( ) ) ; <nl> + } <nl> + if ( ! Overridden . count ( VD ) ) <nl> + BaseMembersStorage . push_back ( VD ) ; <nl> + } <nl> } <nl> if ( D - > getGenericParams ( ) ) <nl> for ( auto param : * D - > getGenericParams ( ) ) <nl> mmm a / lib / Sema / TypeChecker . cpp <nl> ppp b / lib / Sema / TypeChecker . cpp <nl> static Expr * BindName ( UnresolvedDeclRefExpr * UDRE , DeclContext * Context , <nl> llvm_unreachable ( " Can ' t represent lookup result " ) ; <nl> } <nl> <nl> + static void checkClassOverrides ( TypeChecker & TC , ClassDecl * CD ) { <nl> + if ( ! CD - > hasBaseClass ( ) ) <nl> + return ; <nl> + <nl> + Type Base = CD - > getBaseClass ( ) ; <nl> + llvm : : DenseMap < Identifier , std : : vector < ValueDecl * > > FoundDecls ; <nl> + llvm : : SmallPtrSet < ValueDecl * , 16 > OverriddenDecls ; <nl> + for ( Decl * MemberD : CD - > getMembers ( ) ) { <nl> + ValueDecl * MemberVD = dyn_cast < ValueDecl > ( MemberD ) ; <nl> + if ( ! MemberVD ) <nl> + continue ; <nl> + if ( isa < DestructorDecl > ( MemberVD ) | | isa < ConstructorDecl > ( MemberVD ) ) <nl> + continue ; <nl> + if ( MemberVD - > getName ( ) . empty ( ) ) <nl> + continue ; <nl> + auto FoundDeclResult = FoundDecls . insert ( { MemberVD - > getName ( ) , <nl> + std : : vector < ValueDecl * > ( ) } ) ; <nl> + auto & CurDecls = FoundDeclResult . first - > second ; <nl> + if ( FoundDeclResult . second ) { <nl> + MemberLookup Lookup ( Base , MemberVD - > getName ( ) , TC . TU ) ; <nl> + for ( auto BaseMember : Lookup . Results ) <nl> + CurDecls . push_back ( BaseMember . D ) ; <nl> + } <nl> + if ( ! CurDecls . empty ( ) ) { <nl> + if ( isa < TypeDecl > ( MemberVD ) ) { <nl> + / / Duplicate type declaration ; this gets diagnosed earlier . <nl> + / / FIXME : That doesn ' t actually happen at the moment . <nl> + continue ; <nl> + } <nl> + <nl> + ValueDecl * OverriddenDecl = nullptr ; <nl> + <nl> + / / First , check for an exact type match . <nl> + for ( unsigned i = 0 , e = CurDecls . size ( ) ; i ! = e ; + + i ) { <nl> + if ( isa < TypeDecl > ( CurDecls [ i ] ) ) { <nl> + / / Overriding type declaration ; this gets diagnosed earlier . <nl> + / / FIXME : That doesn ' t actually happen at the moment . <nl> + break ; <nl> + } <nl> + if ( MemberVD - > getKind ( ) ! = CurDecls [ i ] - > getKind ( ) ) <nl> + continue ; <nl> + bool isTypeEqual = false ; <nl> + if ( isa < FuncDecl > ( MemberVD ) ) { <nl> + AnyFunctionType * MemberFTy = <nl> + MemberVD - > getType ( ) - > getAs < AnyFunctionType > ( ) ; <nl> + AnyFunctionType * OtherFTy = <nl> + CurDecls [ i ] - > getType ( ) - > getAs < AnyFunctionType > ( ) ; <nl> + if ( MemberFTy & & OtherFTy ) <nl> + isTypeEqual = MemberFTy - > getResult ( ) - > isEqual ( OtherFTy - > getResult ( ) ) ; <nl> + } else { <nl> + isTypeEqual = MemberVD - > getType ( ) - > isEqual ( CurDecls [ i ] - > getType ( ) ) ; <nl> + } <nl> + if ( isTypeEqual ) { <nl> + if ( CurDecls [ i ] - > getDeclContext ( ) = = MemberVD - > getDeclContext ( ) ) { <nl> + / / Duplicate declaration , diagnosed elsewhere <nl> + / / FIXME : That doesn ' t actually happen at the moment . <nl> + continue ; <nl> + } <nl> + if ( OverriddenDecl ) { <nl> + / / Two decls from the base class have the same type ; this will <nl> + / / trigger an error elsewhere . <nl> + / / FIXME : That doesn ' t actually happen at the moment . <nl> + continue ; <nl> + } <nl> + OverriddenDecl = CurDecls [ i ] ; <nl> + } <nl> + } <nl> + <nl> + / / Then , check for a subtyping relationship . <nl> + / / FIXME : Need to check exact match for all members before checking <nl> + / / subtyping for any member . <nl> + if ( ! OverriddenDecl ) { <nl> + for ( unsigned i = 0 , e = CurDecls . size ( ) ; i ! = e ; + + i ) { <nl> + if ( CurDecls [ i ] - > getDeclContext ( ) = = MemberVD - > getDeclContext ( ) ) { <nl> + / / We ignore sub - typing on the same class . <nl> + continue ; <nl> + } <nl> + if ( MemberVD - > getKind ( ) ! = CurDecls [ i ] - > getKind ( ) ) <nl> + continue ; <nl> + bool isSubtype = false ; <nl> + if ( isa < FuncDecl > ( MemberVD ) ) { <nl> + AnyFunctionType * MemberFTy = <nl> + MemberVD - > getType ( ) - > getAs < AnyFunctionType > ( ) ; <nl> + AnyFunctionType * OtherFTy = <nl> + CurDecls [ i ] - > getType ( ) - > getAs < AnyFunctionType > ( ) ; <nl> + if ( MemberFTy & & OtherFTy ) { <nl> + bool Trivial ; <nl> + isSubtype = TC . isSubtypeOf ( MemberFTy - > getResult ( ) , <nl> + OtherFTy - > getResult ( ) , <nl> + Trivial ) & & Trivial ; <nl> + } <nl> + } else { <nl> + bool Trivial ; <nl> + isSubtype = TC . isSubtypeOf ( MemberVD - > getType ( ) , <nl> + CurDecls [ i ] - > getType ( ) , <nl> + Trivial ) & & Trivial ; <nl> + } <nl> + if ( isSubtype ) { <nl> + if ( OverriddenDecl ) { <nl> + TC . diagnose ( MemberVD - > getLoc ( ) , <nl> + diag : : override_multiple_decls_base ) ; <nl> + continue ; <nl> + } <nl> + OverriddenDecl = CurDecls [ i ] ; <nl> + } <nl> + } <nl> + } <nl> + if ( OverriddenDecl ) { <nl> + if ( ! OverriddenDecls . insert ( OverriddenDecl ) ) { <nl> + TC . diagnose ( MemberVD - > getLoc ( ) , <nl> + diag : : override_multiple_decls_derived ) ; <nl> + continue ; <nl> + } <nl> + if ( OverriddenDecl - > getDeclContext ( ) - > getContextKind ( ) = = <nl> + DeclContextKind : : ExtensionDecl ) { <nl> + TC . diagnose ( MemberVD - > getLoc ( ) , diag : : override_decl_extension ) ; <nl> + continue ; <nl> + } <nl> + if ( auto FD = dyn_cast < FuncDecl > ( MemberVD ) ) { <nl> + FD - > setOverriddenDecl ( cast < FuncDecl > ( OverriddenDecl ) ) ; <nl> + } else if ( auto VD = dyn_cast < VarDecl > ( MemberVD ) ) { <nl> + VD - > setOverriddenDecl ( cast < VarDecl > ( OverriddenDecl ) ) ; <nl> + } else if ( auto SD = dyn_cast < SubscriptDecl > ( MemberVD ) ) { <nl> + SD - > setOverriddenDecl ( cast < SubscriptDecl > ( OverriddenDecl ) ) ; <nl> + } else { <nl> + llvm_unreachable ( " Unexpected decl " ) ; <nl> + } <nl> + continue ; <nl> + } <nl> + / / FIXME : This isn ' t quite right : if the derived class overrides all <nl> + / / the base class decls , we should allow additional overloads . <nl> + TC . diagnose ( MemberVD - > getLoc ( ) , diag : : overload_base_decl ) ; <nl> + } <nl> + } <nl> + } <nl> + <nl> + <nl> / / / performTypeChecking - Once parsing and namebinding are complete , these <nl> / / / walks the AST to resolve types and diagnose problems therein . <nl> / / / <nl> void swift : : performTypeChecking ( TranslationUnit * TU , unsigned StartElem , <nl> } <nl> } <nl> <nl> + / / Check for correct overriding in classes . We have to do this after the <nl> + / / first pass so we have valid types , but before the second pass because <nl> + / / it affects name lookup . The loop here is a bit complicated because we <nl> + / / can ' t check a class before we ' ve checked its base . <nl> + { <nl> + llvm : : SmallPtrSet < ClassDecl * , 16 > CheckedClasses ; <nl> + llvm : : SmallVector < ClassDecl * , 16 > QueuedClasses ; <nl> + for ( unsigned i = 0 , e = StartElem ; i ! = e ; + + i ) { <nl> + ClassDecl * CD = dyn_cast < ClassDecl > ( TU - > Decls [ i ] ) ; <nl> + if ( CD ) <nl> + CheckedClasses . insert ( CD ) ; <nl> + } <nl> + for ( unsigned i = StartElem , e = TU - > Decls . size ( ) ; i ! = e ; + + i ) { <nl> + ClassDecl * CD = dyn_cast < ClassDecl > ( TU - > Decls [ i ] ) ; <nl> + if ( ! CD ) <nl> + continue ; <nl> + if ( ! CheckedClasses . insert ( CD ) ) <nl> + continue ; <nl> + QueuedClasses . push_back ( CD ) ; <nl> + while ( ! QueuedClasses . empty ( ) ) { <nl> + CD = QueuedClasses . back ( ) ; <nl> + if ( CD - > hasBaseClass ( ) ) { <nl> + / / FIXME : Generic bases <nl> + ClassDecl * Base = CD - > getBaseClass ( ) - > castTo < ClassType > ( ) - > getDecl ( ) ; <nl> + if ( CheckedClasses . insert ( Base ) ) { <nl> + QueuedClasses . push_back ( Base ) ; <nl> + continue ; <nl> + } <nl> + } <nl> + checkClassOverrides ( TC , CD ) ; <nl> + QueuedClasses . pop_back ( ) ; <nl> + } <nl> + } <nl> + } <nl> + <nl> + / / At this point , we can perform general name lookup into any type . <nl> + <nl> / / We don ' t know the types of all the global declarations in the first <nl> / / pass , which means we can ' t completely analyze everything . Perform the <nl> / / second pass now . <nl> new file mode 100644 <nl> index 000000000000 . . 4e9270ca23ce <nl> mmm / dev / null <nl> ppp b / test / classes . swift <nl> <nl> + / / RUN : % swift - parse % s - verify - parse - as - library <nl> + <nl> + class B : A { <nl> + func f ( ) { } <nl> + func g ( ) - > ( B , B ) { return ( new B , new B ) } / / expected - error { { declaration cannot override more than one base class declaration } } <nl> + func h ( ) - > ( A , B ) { return ( new B , new B ) } <nl> + func h ( ) - > ( B , A ) { return ( new B , new B ) } / / expected - error { { declaration cannot be overridden by more than one derived class declaration } } <nl> + func i ( ) { } / / expected - error { { declarations from extensions cannot be overridden yet } } <nl> + subscript ( i : Int ) - > Int { get { } set { } } <nl> + } <nl> + class A { <nl> + func f ( ) { } <nl> + func g ( ) - > ( B , A ) { return ( new B , new B ) } <nl> + func g ( ) - > ( A , B ) { return ( new B , new B ) } <nl> + func h ( ) - > ( A , A ) { return ( new B , new B ) } <nl> + subscript ( i : Int ) - > Int { get { } set { } } <nl> + } <nl> + extension A { <nl> + func i ( ) { } <nl> + } <nl> + func f ( ) { <nl> + var x = new B <nl> + var y : ( ) = x . f ( ) <nl> + var z : Int = x [ 10 ] <nl> + } <nl>
Initial attempt at implementing semantic analysis of overriding for classes .
apple/swift
bef302d2ee3c768c2b86a7a825236df821d83965
2012-08-15T01:21:35Z
new file mode 100644 <nl> index 0000000000 . . 7bcec04055 <nl> mmm / dev / null <nl> ppp b / CONTRIBUTING . md <nl> <nl> + # Contributing Guidelines <nl> + <nl> + This doc is a work in progress ! Check back for updates . <nl> + <nl> + # # Running unit tests in Visual Studio <nl> + Before submitting a PR to React Native Windows , make sure the unit tests pass locally in Visual Studio . <nl> + <nl> + # # # # But how ? <nl> + ! [ Run All Tests ] ( img / RunTests . png ) <nl> + 1 . In the top toolbar , click " Test " <nl> + 2 . Select " Run " <nl> + 3 . Select " All Tests " <nl> + <nl> + # # # # Troubleshooting : <nl> + # # # # # Error : <nl> + ` ` ` <nl> + The build tools for v140 ( Platform Toolset = ' v140 ' ) cannot be found . To build using the v140 build tools , please install v140 build tools . Alternatively , you may upgrade to the current Visual Studio tools by selecting the Project menu or right - click the solution , and then selecting " Retarget solution " . <nl> + <nl> + ` ` ` <nl> + # # # # # Solution : <nl> + Retarget the solution to v141 : <nl> + 1 . Right click the ReactNative solution and click " Retarget Solution " <nl> + 2 . Make sure the Platform Toolset has Upgrade to v141 selected , and click " OK . " <nl> mmm a / README . md <nl> ppp b / README . md <nl> npm install <nl> ` ` ` <nl> - - * Note : * If you just want to get started with developing your own app , read [ Getting Started with App Development ] ( # GettingStarted ) . You only need to interact with ` npm ` to use for your app development . <nl> <nl> - For more information about contributing PRs and issues , see our [ Contribution Guidelines ] ( https : / / github . com / ReactWindows / react - native - windows / blob / master / CONTRIBUTING . md ) * * ( Coming Soon ) * * . <nl> + For more information about contributing PRs and issues , see our [ Contribution Guidelines ] ( https : / / github . com / ReactWindows / react - native - windows / blob / master / CONTRIBUTING . md ) <nl> <nl> [ Good First Task ] ( https : / / github . com / ReactWindows / react - native - windows / labels / Good % 20First % 20Task ) and [ help wanted ] ( https : / / github . com / ReactWindows / react - native - windows / labels / help % 20wanted ) are great starting points for PRs . <nl> <nl> - Each pull request has the unit tests , code analysis , and a [ Winium ] ( https : / / github . com / 2gis / Winium ) integration test run in the AppVeyor CI service . To shorten the feedback cycle , please be sure to run the unit tests in Visual Studio and verify they are passing before submitting pull requests . For extra credit , verify the examples in RNTester continue to work properly . <nl> + Each pull request has the unit tests , code analysis , and a [ Winium ] ( https : / / github . com / 2gis / Winium ) integration test run in the AppVeyor CI service . To shorten the feedback cycle , please be sure to [ run the unit tests in Visual Studio ] ( https : / / github . com / ReactWindows / react - native - windows / blob / master / CONTRIBUTING . md # running - unit - tests - in - visual - studio ) and verify they are passing before submitting pull requests . For extra credit , verify the examples in RNTester continue to work properly . <nl> <nl> # # # Examples <nl> <nl> new file mode 100644 <nl> index 0000000000 . . 85e8d63d54 <nl> Binary files / dev / null and b / docs / img / RunTests . png differ <nl>
Create contributing guidelines ( )
microsoft/react-native-windows
b82c07ab3bb4a989a42c601b084dc2c1ef815506
2017-10-17T21:26:53Z
mmm a / atom / browser / api / atom_api_web_contents . cc <nl> ppp b / atom / browser / api / atom_api_web_contents . cc <nl> <nl> # include " atom / common / native_mate_converters / string16_converter . h " <nl> # include " atom / common / native_mate_converters / value_converter . h " <nl> # include " atom / common / options_switches . h " <nl> + # include " base / process / process_handle . h " <nl> # include " base / strings / utf_string_conversions . h " <nl> # include " base / threading / thread_task_runner_handle . h " <nl> # include " brightray / browser / inspectable_web_contents . h " <nl> <nl> # include " chrome / browser / printing / print_preview_message_handler . h " <nl> # include " chrome / browser / printing / print_view_manager_basic . h " <nl> # include " chrome / browser / ssl / security_state_tab_helper . h " <nl> - # include " base / process / process_handle . h " <nl> # include " content / browser / frame_host / navigation_entry_impl . h " <nl> # include " content / browser / renderer_host / render_widget_host_impl . h " <nl> # include " content / browser / web_contents / web_contents_impl . h " <nl> <nl> # include " third_party / WebKit / public / web / WebFindOptions . h " <nl> # include " ui / display / screen . h " <nl> <nl> - <nl> # if ! defined ( OS_MACOSX ) <nl> # include " ui / aura / window . h " <nl> # endif <nl>
: shirt : alphabetical order
electron/electron
9aff17afeafb85a94860253f59a16a28d6c483fb
2017-04-18T11:44:31Z
mmm a / dbms / src / Parsers / ASTAlterQuery . cpp <nl> ppp b / dbms / src / Parsers / ASTAlterQuery . cpp <nl> void ASTAlterCommand : : formatImpl ( <nl> <nl> if ( type = = ASTAlterCommand : : ADD_COLUMN ) <nl> { <nl> - settings . ostr < < ( settings . hilite ? hilite_keyword : " " ) < < indent_str < < " ADD COLUMN " < < ( settings . hilite ? hilite_none : " " ) ; <nl> + settings . ostr < < ( settings . hilite ? hilite_keyword : " " ) < < indent_str < < " ADD COLUMN " < < ( if_not_exists ? " IF NOT EXISTS " : " " ) < < ( settings . hilite ? hilite_none : " " ) ; <nl> col_decl - > formatImpl ( settings , state , frame ) ; <nl> <nl> / / / AFTER <nl> void ASTAlterCommand : : formatImpl ( <nl> else if ( type = = ASTAlterCommand : : DROP_COLUMN ) <nl> { <nl> settings . ostr < < ( settings . hilite ? hilite_keyword : " " ) < < indent_str <nl> - < < ( clear_column ? " CLEAR " : " DROP " ) < < " COLUMN " < < ( settings . hilite ? hilite_none : " " ) ; <nl> + < < ( clear_column ? " CLEAR " : " DROP " ) < < " COLUMN " < < ( if_exists ? " IF EXISTS " : " " ) < < ( settings . hilite ? hilite_none : " " ) ; <nl> column - > formatImpl ( settings , state , frame ) ; <nl> if ( partition ) <nl> { <nl> void ASTAlterCommand : : formatImpl ( <nl> } <nl> else if ( type = = ASTAlterCommand : : MODIFY_COLUMN ) <nl> { <nl> - settings . ostr < < ( settings . hilite ? hilite_keyword : " " ) < < indent_str < < " MODIFY COLUMN " < < ( settings . hilite ? hilite_none : " " ) ; <nl> + settings . ostr < < ( settings . hilite ? hilite_keyword : " " ) < < indent_str < < " MODIFY COLUMN " < < ( if_exists ? " IF EXISTS " : " " ) < < ( settings . hilite ? hilite_none : " " ) ; <nl> col_decl - > formatImpl ( settings , state , frame ) ; <nl> } <nl> else if ( type = = ASTAlterCommand : : MODIFY_ORDER_BY ) <nl> mmm a / dbms / src / Parsers / ASTAlterQuery . h <nl> ppp b / dbms / src / Parsers / ASTAlterQuery . h <nl> class ASTAlterCommand : public IAST <nl> <nl> bool clear_column = false ; / / / for CLEAR COLUMN ( do not drop column from metadata ) <nl> <nl> + bool if_not_exists = false ; / / / option for ADD_COLUMN <nl> + <nl> + bool if_exists = false ; / / / option for DROP_COLUMN , MODIFY_COLUMN , COMMENT_COLUMN <nl> + <nl> / * * For FETCH PARTITION - the path in ZK to the shard , from which to download the partition . <nl> * / <nl> String from ; <nl> mmm a / dbms / src / Parsers / ParserAlterQuery . cpp <nl> ppp b / dbms / src / Parsers / ParserAlterQuery . cpp <nl> bool ParserAlterCommand : : parseImpl ( Pos & pos , ASTPtr & node , Expected & expected <nl> ParserKeyword s_partition ( " PARTITION " ) ; <nl> <nl> ParserKeyword s_after ( " AFTER " ) ; <nl> + ParserKeyword s_if_not_exists ( " IF NOT EXISTS " ) ; <nl> + ParserKeyword s_if_exists ( " IF EXISTS " ) ; <nl> ParserKeyword s_from ( " FROM " ) ; <nl> ParserKeyword s_in_partition ( " IN PARTITION " ) ; <nl> ParserKeyword s_with ( " WITH " ) ; <nl> bool ParserAlterCommand : : parseImpl ( Pos & pos , ASTPtr & node , Expected & expected <nl> <nl> if ( s_add_column . ignore ( pos , expected ) ) <nl> { <nl> + if ( s_if_not_exists . ignore ( pos , expected ) ) <nl> + command - > if_not_exists = true ; <nl> + <nl> if ( ! parser_col_decl . parse ( pos , command - > col_decl , expected ) ) <nl> return false ; <nl> <nl> bool ParserAlterCommand : : parseImpl ( Pos & pos , ASTPtr & node , Expected & expected <nl> } <nl> else if ( s_drop_column . ignore ( pos , expected ) ) <nl> { <nl> + if ( s_if_exists . ignore ( pos , expected ) ) <nl> + command - > if_exists = true ; <nl> + <nl> if ( ! parser_name . parse ( pos , command - > column , expected ) ) <nl> return false ; <nl> <nl> bool ParserAlterCommand : : parseImpl ( Pos & pos , ASTPtr & node , Expected & expected <nl> } <nl> else if ( s_clear_column . ignore ( pos , expected ) ) <nl> { <nl> + if ( s_if_exists . ignore ( pos , expected ) ) <nl> + command - > if_exists = true ; <nl> + <nl> if ( ! parser_name . parse ( pos , command - > column , expected ) ) <nl> return false ; <nl> <nl> bool ParserAlterCommand : : parseImpl ( Pos & pos , ASTPtr & node , Expected & expected <nl> } <nl> else if ( s_modify_column . ignore ( pos , expected ) ) <nl> { <nl> + if ( s_if_exists . ignore ( pos , expected ) ) <nl> + command - > if_exists = true ; <nl> + <nl> if ( ! parser_modify_col_decl . parse ( pos , command - > col_decl , expected ) ) <nl> return false ; <nl> <nl> bool ParserAlterCommand : : parseImpl ( Pos & pos , ASTPtr & node , Expected & expected <nl> } <nl> else if ( s_comment_column . ignore ( pos , expected ) ) <nl> { <nl> + if ( s_if_exists . ignore ( pos , expected ) ) <nl> + command - > if_exists = true ; <nl> + <nl> if ( ! parser_name . parse ( pos , command - > column , expected ) ) <nl> return false ; <nl> <nl> mmm a / dbms / src / Parsers / ParserAlterQuery . h <nl> ppp b / dbms / src / Parsers / ParserAlterQuery . h <nl> namespace DB <nl> <nl> / * * Query like this : <nl> * ALTER TABLE [ db . ] name [ ON CLUSTER cluster ] <nl> - * [ ADD COLUMN col_name type [ AFTER col_after ] , ] <nl> - * [ DROP COLUMN col_to_drop , . . . ] <nl> - * [ CLEAR COLUMN col_to_clear [ IN PARTITION partition ] , ] <nl> - * [ MODIFY COLUMN col_to_modify type , . . . ] <nl> + * [ ADD COLUMN [ IF NOT EXISTS ] col_name type [ AFTER col_after ] , ] <nl> + * [ DROP COLUMN [ IF EXISTS ] col_to_drop , . . . ] <nl> + * [ CLEAR COLUMN [ IF EXISTS ] col_to_clear [ IN PARTITION partition ] , ] <nl> + * [ MODIFY COLUMN [ IF EXISTS ] col_to_modify type , . . . ] <nl> * [ MODIFY PRIMARY KEY ( a , b , c . . . ) ] <nl> - * [ COMMENT COLUMN col_name string ] <nl> + * [ COMMENT COLUMN [ IF EXISTS ] col_name string ] <nl> * [ DROP | DETACH | ATTACH PARTITION | PART partition , . . . ] <nl> * [ FETCH PARTITION partition FROM . . . ] <nl> * [ FREEZE [ PARTITION ] [ WITH NAME name ] ] <nl> mmm a / dbms / src / Storages / AlterCommands . cpp <nl> ppp b / dbms / src / Storages / AlterCommands . cpp <nl> std : : optional < AlterCommand > AlterCommand : : parse ( const ASTAlterCommand * command_ <nl> if ( command_ast - > column ) <nl> command . after_column = typeid_cast < const ASTIdentifier & > ( * command_ast - > column ) . name ; <nl> <nl> + command . if_not_exists = command_ast - > if_not_exists ; <nl> + <nl> return command ; <nl> } <nl> else if ( command_ast - > type = = ASTAlterCommand : : DROP_COLUMN & & ! command_ast - > partition ) <nl> std : : optional < AlterCommand > AlterCommand : : parse ( const ASTAlterCommand * command_ <nl> AlterCommand command ; <nl> command . type = AlterCommand : : DROP_COLUMN ; <nl> command . column_name = typeid_cast < const ASTIdentifier & > ( * ( command_ast - > column ) ) . name ; <nl> + command . if_exists = command_ast - > if_exists ; <nl> return command ; <nl> } <nl> else if ( command_ast - > type = = ASTAlterCommand : : MODIFY_COLUMN ) <nl> std : : optional < AlterCommand > AlterCommand : : parse ( const ASTAlterCommand * command_ <nl> const auto & ast_comment = typeid_cast < ASTLiteral & > ( * ast_col_decl . comment ) ; <nl> command . comment = ast_comment . value . get < String > ( ) ; <nl> } <nl> + command . if_exists = command_ast - > if_exists ; <nl> <nl> return command ; <nl> } <nl> std : : optional < AlterCommand > AlterCommand : : parse ( const ASTAlterCommand * command_ <nl> command . column_name = ast_identifier . name ; <nl> const auto & ast_comment = typeid_cast < ASTLiteral & > ( * command_ast - > comment ) ; <nl> command . comment = ast_comment . value . get < String > ( ) ; <nl> + command . if_exists = command_ast - > if_exists ; <nl> return command ; <nl> } <nl> else if ( command_ast - > type = = ASTAlterCommand : : MODIFY_ORDER_BY ) <nl> void AlterCommands : : apply ( ColumnsDescription & columns_description , ASTPtr & ord <nl> auto new_primary_key_ast = primary_key_ast ; <nl> <nl> for ( const AlterCommand & command : * this ) <nl> - command . apply ( new_columns_description , new_order_by_ast , new_primary_key_ast ) ; <nl> + if ( ! command . ignore ) <nl> + command . apply ( new_columns_description , new_order_by_ast , new_primary_key_ast ) ; <nl> <nl> columns_description = std : : move ( new_columns_description ) ; <nl> order_by_ast = std : : move ( new_order_by_ast ) ; <nl> void AlterCommands : : validate ( const IStorage & table , const Context & context ) <nl> if ( command . type = = AlterCommand : : ADD_COLUMN ) <nl> { <nl> if ( std : : end ( all_columns ) ! = column_it ) <nl> - throw Exception { " Cannot add column " + column_name + " : column with this name already exists " , ErrorCodes : : ILLEGAL_COLUMN } ; <nl> + { <nl> + if ( command . if_not_exists ) <nl> + command . ignore = true ; <nl> + else <nl> + throw Exception { " Cannot add column " + column_name + " : column with this name already exists " , ErrorCodes : : ILLEGAL_COLUMN } ; <nl> + } <nl> } <nl> else if ( command . type = = AlterCommand : : MODIFY_COLUMN ) <nl> { <nl> <nl> if ( std : : end ( all_columns ) = = column_it ) <nl> - throw Exception { " Wrong column name . Cannot find column " + column_name + " to modify " , ErrorCodes : : ILLEGAL_COLUMN } ; <nl> + { <nl> + if ( command . if_exists ) <nl> + command . ignore = true ; <nl> + else <nl> + throw Exception { " Wrong column name . Cannot find column " + column_name + " to modify " , ErrorCodes : : ILLEGAL_COLUMN } ; <nl> + } <nl> <nl> - all_columns . erase ( column_it ) ; <nl> - defaults . erase ( column_name ) ; <nl> + if ( ! command . ignore ) <nl> + { <nl> + all_columns . erase ( column_it ) ; <nl> + defaults . erase ( column_name ) ; <nl> + } <nl> } <nl> <nl> - / / / we ' re creating dummy DataTypeUInt8 in order to prevent the NullPointerException in ExpressionActions <nl> - all_columns . emplace_back ( column_name , command . data_type ? command . data_type : std : : make_shared < DataTypeUInt8 > ( ) ) ; <nl> - <nl> - if ( command . default_expression ) <nl> + if ( ! command . ignore ) <nl> { <nl> - if ( command . data_type ) <nl> - { <nl> - const auto & final_column_name = column_name ; <nl> - const auto tmp_column_name = final_column_name + " _tmp " ; <nl> - const auto column_type_raw_ptr = command . data_type . get ( ) ; <nl> + / / / we ' re creating dummy DataTypeUInt8 in order to prevent the NullPointerException in ExpressionActions <nl> + all_columns . emplace_back ( column_name , command . data_type ? command . data_type : std : : make_shared < DataTypeUInt8 > ( ) ) ; <nl> <nl> - default_expr_list - > children . emplace_back ( setAlias ( <nl> - makeASTFunction ( " CAST " , std : : make_shared < ASTIdentifier > ( tmp_column_name ) , <nl> - std : : make_shared < ASTLiteral > ( column_type_raw_ptr - > getName ( ) ) ) , <nl> - final_column_name ) ) ; <nl> - <nl> - default_expr_list - > children . emplace_back ( setAlias ( command . default_expression - > clone ( ) , tmp_column_name ) ) ; <nl> - <nl> - defaulted_columns . emplace_back ( NameAndTypePair { column_name , command . data_type } , & command ) ; <nl> - } <nl> - else <nl> + if ( command . default_expression ) <nl> { <nl> - / / / no type explicitly specified , will deduce later <nl> - default_expr_list - > children . emplace_back ( <nl> - setAlias ( command . default_expression - > clone ( ) , column_name ) ) ; <nl> - <nl> - defaulted_columns . emplace_back ( NameAndTypePair { column_name , nullptr } , & command ) ; <nl> + if ( command . data_type ) <nl> + { <nl> + const auto & final_column_name = column_name ; <nl> + const auto tmp_column_name = final_column_name + " _tmp " ; <nl> + const auto column_type_raw_ptr = command . data_type . get ( ) ; <nl> + <nl> + default_expr_list - > children . emplace_back ( setAlias ( <nl> + makeASTFunction ( " CAST " , std : : make_shared < ASTIdentifier > ( tmp_column_name ) , <nl> + std : : make_shared < ASTLiteral > ( column_type_raw_ptr - > getName ( ) ) ) , <nl> + final_column_name ) ) ; <nl> + <nl> + default_expr_list - > children . emplace_back ( setAlias ( command . default_expression - > clone ( ) , tmp_column_name ) ) ; <nl> + <nl> + defaulted_columns . emplace_back ( NameAndTypePair { column_name , command . data_type } , & command ) ; <nl> + } <nl> + else <nl> + { <nl> + / / / no type explicitly specified , will deduce later <nl> + default_expr_list - > children . emplace_back ( <nl> + setAlias ( command . default_expression - > clone ( ) , column_name ) ) ; <nl> + <nl> + defaulted_columns . emplace_back ( NameAndTypePair { column_name , nullptr } , & command ) ; <nl> + } <nl> } <nl> } <nl> } <nl> void AlterCommands : : validate ( const IStorage & table , const Context & context ) <nl> } <nl> <nl> if ( ! found ) <nl> - throw Exception ( " Wrong column name . Cannot find column " + command . column_name + " to drop " , <nl> - ErrorCodes : : ILLEGAL_COLUMN ) ; <nl> + { <nl> + if ( command . if_exists ) <nl> + command . ignore = true ; <nl> + else <nl> + throw Exception ( " Wrong column name . Cannot find column " + command . column_name + " to drop " , <nl> + ErrorCodes : : ILLEGAL_COLUMN ) ; <nl> + } <nl> } <nl> else if ( command . type = = AlterCommand : : COMMENT_COLUMN ) <nl> { <nl> void AlterCommands : : validate ( const IStorage & table , const Context & context ) <nl> std : : bind ( namesEqual , std : : cref ( command . column_name ) , std : : placeholders : : _1 ) ) ; <nl> if ( column_it = = std : : end ( all_columns ) ) <nl> { <nl> - throw Exception { " Wrong column name . Cannot find column " + command . column_name + " to comment " , ErrorCodes : : ILLEGAL_COLUMN } ; <nl> + if ( command . if_exists ) <nl> + command . ignore = true ; <nl> + else <nl> + throw Exception { " Wrong column name . Cannot find column " + command . column_name + " to comment " , ErrorCodes : : ILLEGAL_COLUMN } ; <nl> } <nl> } <nl> } <nl> mmm a / dbms / src / Storages / AlterCommands . h <nl> ppp b / dbms / src / Storages / AlterCommands . h <nl> struct AlterCommand <nl> / / / For ADD - after which column to add a new one . If an empty string , add to the end . To add to the beginning now it is impossible . <nl> String after_column ; <nl> <nl> + / / / For DROP_COLUMN , MODIFY_COLUMN , COMMENT_COLUMN <nl> + bool if_exists ; <nl> + <nl> + / / / For ADD_COLUMN <nl> + bool if_not_exists ; <nl> + <nl> / / / For MODIFY_ORDER_BY <nl> ASTPtr order_by ; <nl> <nl> + / / / indicates that this command should not be applied , for example in case of if_exists = true and column doesn ' t exist . <nl> + bool ignore = false ; <nl> + <nl> AlterCommand ( ) = default ; <nl> AlterCommand ( const Type type , const String & column_name , const DataTypePtr & data_type , <nl> const ColumnDefaultKind default_kind , const ASTPtr & default_expression , <nl> - const String & after_column = String { } , const String & comment = " " ) / / TODO : Ρ€Π°Π·ΠΎΠ±Ρ€Π°Ρ‚ΡŒΡΡ здСсь с ΠΏΠ°Ρ€Π°ΠΌΠ΅Ρ‚Ρ€ΠΎΠΌ ΠΏΠΎ ΡƒΠΌΠΎΠ»Ρ‡Π°Π½ΠΈΡŽ <nl> + const String & after_column = String { } , const String & comment = " " , <nl> + const bool if_exists = false , const bool if_not_exists = false ) / / TODO : Ρ€Π°Π·ΠΎΠ±Ρ€Π°Ρ‚ΡŒΡΡ здСсь с ΠΏΠ°Ρ€Π°ΠΌΠ΅Ρ‚Ρ€ΠΎΠΌ ΠΏΠΎ ΡƒΠΌΠΎΠ»Ρ‡Π°Π½ΠΈΡŽ <nl> : type { type } , column_name { column_name } , data_type { data_type } , default_kind { default_kind } , <nl> - default_expression { default_expression } , comment ( comment ) , after_column { after_column } <nl> + default_expression { default_expression } , comment ( comment ) , after_column { after_column } , <nl> + if_exists ( if_exists ) , if_not_exists ( if_not_exists ) <nl> { } <nl> <nl> static std : : optional < AlterCommand > parse ( const ASTAlterCommand * command ) ; <nl> mmm a / dbms / tests / queries / 0_stateless / 00030_alter_table . sql <nl> ppp b / dbms / tests / queries / 0_stateless / 00030_alter_table . sql <nl> ALTER TABLE test . alter_test DROP COLUMN NestedColumn . S ; <nl> <nl> ALTER TABLE test . alter_test DROP COLUMN AddedNested1 . B ; <nl> <nl> + ALTER TABLE test . alter_test ADD COLUMN IF NOT EXISTS Added0 UInt32 ; <nl> + ALTER TABLE test . alter_test ADD COLUMN IF NOT EXISTS AddedNested1 Nested ( A UInt32 , B UInt64 ) ; <nl> + ALTER TABLE test . alter_test ADD COLUMN IF NOT EXISTS AddedNested1 . C Array ( String ) ; <nl> + ALTER TABLE test . alter_test MODIFY COLUMN IF EXISTS ToDrop UInt64 ; <nl> + ALTER TABLE test . alter_test DROP COLUMN IF EXISTS ToDrop ; <nl> + ALTER TABLE test . alter_test COMMENT COLUMN IF EXISTS ToDrop ' new comment ' ; <nl> + <nl> DESC TABLE test . alter_test ; <nl> <nl> SELECT * FROM test . alter_test ; <nl>
support for IF EXISTS / IF NOT EXISTS in ALTER TABLE ADD / DROP / CLEAR / MODIFY / COMMENT COLUMN
ClickHouse/ClickHouse
d776d1164a09e95bfdb24050ffc1df93b45dbbd5
2018-12-21T14:53:00Z
mmm a / dlib / dnn / loss . h <nl> ppp b / dlib / dnn / loss . h <nl> namespace dlib <nl> template < typename SUBNET > <nl> using loss_binary_log = add_loss_layer < loss_binary_log_ , SUBNET > ; <nl> <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> + <nl> + class loss_multiclass_log_ <nl> + { <nl> + public : <nl> + <nl> + const static unsigned int sample_expansion_factor = 1 ; <nl> + typedef unsigned long label_type ; <nl> + <nl> + template < <nl> + typename SUB_TYPE , <nl> + typename label_iterator <nl> + > <nl> + void to_label ( <nl> + const tensor & input_tensor , <nl> + const SUB_TYPE & sub , <nl> + label_iterator iter <nl> + ) const <nl> + { <nl> + const tensor & output_tensor = sub . get_output ( ) ; <nl> + DLIB_CASSERT ( output_tensor . nr ( ) = = 1 & & <nl> + output_tensor . nc ( ) = = 1 , " " ) ; <nl> + DLIB_CASSERT ( input_tensor . num_samples ( ) = = output_tensor . num_samples ( ) , " " ) ; <nl> + <nl> + <nl> + / / Note that output_tensor . k ( ) should match the number of labels . <nl> + <nl> + const float * out_data = output_tensor . host ( ) ; <nl> + for ( long i = 0 ; i < output_tensor . num_samples ( ) ; + + i ) <nl> + { <nl> + / / The index of the largest output for this sample is the label . <nl> + * iter + + = index_of_max ( rowm ( mat ( output_tensor ) , i ) ) ; <nl> + } <nl> + } <nl> + <nl> + <nl> + template < <nl> + typename const_label_iterator , <nl> + typename SUBNET <nl> + > <nl> + double compute_loss ( <nl> + const tensor & input_tensor , <nl> + const_label_iterator truth , <nl> + SUBNET & sub <nl> + ) const <nl> + { <nl> + const tensor & output_tensor = sub . get_output ( ) ; <nl> + tensor & grad = sub . get_gradient_input ( ) ; <nl> + <nl> + DLIB_CASSERT ( input_tensor . num_samples ( ) ! = 0 , " " ) ; <nl> + DLIB_CASSERT ( input_tensor . num_samples ( ) % sample_expansion_factor = = 0 , " " ) ; <nl> + DLIB_CASSERT ( input_tensor . num_samples ( ) = = grad . num_samples ( ) , " " ) ; <nl> + DLIB_CASSERT ( input_tensor . num_samples ( ) = = output_tensor . num_samples ( ) , " " ) ; <nl> + DLIB_CASSERT ( output_tensor . nr ( ) = = 1 & & <nl> + output_tensor . nc ( ) = = 1 , " " ) ; <nl> + DLIB_CASSERT ( grad . nr ( ) = = 1 & & <nl> + grad . nc ( ) = = 1 , " " ) ; <nl> + <nl> + tt : : softmax ( grad , output_tensor ) ; <nl> + <nl> + / / The loss we output is the average loss over the mini - batch . <nl> + const double scale = 1 . 0 / output_tensor . num_samples ( ) ; <nl> + double loss = 0 ; <nl> + float * g = grad . host ( ) ; <nl> + for ( long i = 0 ; i < output_tensor . num_samples ( ) ; + + i ) <nl> + { <nl> + const long y = ( long ) * truth + + ; <nl> + / / The network must produce a number of outputs that is equal to the number <nl> + / / of labels when using this type of loss . <nl> + DLIB_CASSERT ( y < output_tensor . k ( ) , " y : " < < y < < " , output_tensor . k ( ) : " < < output_tensor . k ( ) ) ; <nl> + for ( long k = 0 ; k < output_tensor . k ( ) ; + + k ) <nl> + { <nl> + const unsigned long idx = i * output_tensor . k ( ) + k ; <nl> + if ( k = = y ) <nl> + { <nl> + loss + = scale * - std : : log ( g [ idx ] ) ; <nl> + g [ idx ] = scale * ( g [ idx ] - 1 ) ; <nl> + } <nl> + else <nl> + { <nl> + g [ idx ] = scale * g [ idx ] ; <nl> + } <nl> + } <nl> + } <nl> + return loss ; <nl> + } <nl> + <nl> + friend void serialize ( const loss_multiclass_log_ & , std : : ostream & out ) <nl> + { <nl> + serialize ( " loss_multiclass_log_ " , out ) ; <nl> + } <nl> + <nl> + friend void deserialize ( loss_multiclass_log_ & , std : : istream & in ) <nl> + { <nl> + std : : string version ; <nl> + deserialize ( version , in ) ; <nl> + if ( version ! = " loss_multiclass_log_ " ) <nl> + throw serialization_error ( " Unexpected version found while deserializing dlib : : loss_multiclass_log_ . " ) ; <nl> + } <nl> + <nl> + } ; <nl> + <nl> + template < typename SUBNET > <nl> + using loss_multiclass_log = add_loss_layer < loss_multiclass_log_ , SUBNET > ; <nl> + <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> <nl> } <nl>
Added loss_multiclass_log_
davisking/dlib
351a6331e9501777387f7e96cae8948912fc9f9c
2015-12-13T17:21:54Z
mmm a / hphp / hack / src / decl / dune <nl> ppp b / hphp / hack / src / decl / dune <nl> <nl> ( name decl ) <nl> ( wrapped false ) <nl> ( libraries <nl> + ast_provider <nl> heap_global_storage <nl> naming <nl> naming_attributes <nl> mmm a / hphp / hack / src / dune <nl> ppp b / hphp / hack / src / dune <nl> <nl> sys_utils <nl> tast <nl> tast_typecheck <nl> + temp_file <nl> typed_positioned_syntax <nl> typing <nl> utils_core ) ) <nl> mmm a / hphp / hack / src / naming / dune <nl> ppp b / hphp / hack / src / naming / dune <nl> <nl> ( modules <nl> naming_heap_api ) <nl> ( libraries <nl> + ast_provider <nl> naming ) ) <nl> <nl> ( library <nl> <nl> namingGlobal ) <nl> ( libraries <nl> ast <nl> + ast_provider <nl> common <nl> naming_attributes <nl> nast <nl> mmm a / hphp / hack / src / parser / dune <nl> ppp b / hphp / hack / src / parser / dune <nl> <nl> hh_autoimport <nl> html_entities <nl> ide_parser_cache <nl> - parser_heap <nl> parser_return ) <nl> ( libraries <nl> ast <nl> <nl> ( modules <nl> parsing_service ) <nl> ( libraries <nl> + ast_provider <nl> parser_heap <nl> procs_procs ) ) <nl> new file mode 100644 <nl> index 00000000000 . . 913544dc146 <nl> mmm / dev / null <nl> ppp b / hphp / hack / src / providers / dune <nl> <nl> + ( library <nl> + ( name ast_provider ) <nl> + ( wrapped false ) <nl> + ( modules ast_provider ) <nl> + ( libraries <nl> + ast <nl> + heap_shared_mem <nl> + parser_heap <nl> + relative_path ) ) <nl> + <nl> + ( library <nl> + ( name decl_provider ) <nl> + ( wrapped false ) <nl> + ( modules decl_provider ) <nl> + ( libraries <nl> + typing_heap ) ) <nl> mmm a / hphp / hack / src / search / dune <nl> ppp b / hphp / hack / src / search / dune <nl> <nl> ( wrapped false ) <nl> ( libraries <nl> ast <nl> + ast_provider <nl> file_info <nl> heap_shared_mem <nl> naming <nl> mmm a / hphp / hack / src / typing / dune <nl> ppp b / hphp / hack / src / typing / dune <nl> <nl> utils_core ) <nl> ( preprocess ( pps ppx_deriving . std ) ) ) <nl> <nl> + ( library <nl> + ( name typing_heap ) <nl> + ( wrapped false ) <nl> + ( modules <nl> + typing_classes_heap <nl> + typing_heap <nl> + typing_lazy_heap ) <nl> + ( libraries <nl> + core_kernel <nl> + decl <nl> + typing_defs ) ) <nl> + <nl> ( library <nl> ( name tast ) <nl> ( wrapped false ) <nl> <nl> type_visitor <nl> typing_arrays <nl> typing_async <nl> - typing_classes_heap <nl> typing_coercion <nl> typing_continuations <nl> typing_deferred_members <nl> <nl> typing_expand <nl> typing_generic <nl> typing_generic_constraint <nl> - typing_heap <nl> - Decl_provider <nl> typing_lenv_cont <nl> typing_log <nl> typing_logic <nl> <nl> ( libraries <nl> common <nl> decl <nl> + decl_provider <nl> hackfmt_doc <nl> hackfmt_env <nl> hackfmt <nl>
fix dune build after introduction of ast / decl providers
facebook/hhvm
9067e10949b8a0fb6db2a9c4f42ea749ab694a32
2019-04-23T13:35:42Z
mmm a / tensorflow / python / training / learning_rate_decay . py <nl> ppp b / tensorflow / python / training / learning_rate_decay . py <nl> def piecewise_constant ( x , boundaries , values , name = None ) : <nl> # exclusive and exhaustive , but tf . case requires it . <nl> default = lambda : values [ 0 ] <nl> return control_flow_ops . case ( pred_fn_pairs , default , exclusive = True ) <nl> + <nl> + <nl> + def polynomial_decay ( learning_rate , global_step , decay_steps , <nl> + end_learning_rate = 0 . 0001 , power = 1 . 0 , <nl> + cycle = False , name = None ) : <nl> + " " " Applies a polynomial decay to the learning rate . <nl> + <nl> + It is commonly observed that a monotonically decreasing learning rate , whose <nl> + degree of change is carefully chosen , results in a better performing model . <nl> + This function applies a polynomial decay function to a provided initial <nl> + ` learning_rate ` to reach an ` end_learning_rate ` in the given ` decay_steps ` . <nl> + <nl> + It requires a ` global_step ` value to compute the decayed learning rate . You <nl> + can just pass a TensorFlow variable that you increment at each training step . <nl> + <nl> + The function returns the decayed learning rate . It is computed as : <nl> + <nl> + ` ` ` python <nl> + global_step = min ( global_step , decay_steps ) <nl> + decayed_learning_rate = ( learning_rate - end_learning_rate ) * <nl> + ( 1 - global_step / decay_steps ) ^ ( power ) + <nl> + end_learning_rate <nl> + <nl> + ` ` ` <nl> + <nl> + If ` cycle ` is True then a multiple of ` decay_steps ` is used , the first one <nl> + that is bigger than ` global_steps ` . <nl> + <nl> + ` ` ` python <nl> + decay_steps = decay_steps * ceil ( global_step / decay_steps ) <nl> + decayed_learning_rate = ( learning_rate - end_learning_rate ) * <nl> + ( 1 - global_step / decay_steps ) ^ ( power ) + <nl> + end_learning_rate <nl> + <nl> + ` ` ` <nl> + <nl> + Example : decay from 0 . 1 to 0 . 01 in 10000 steps using sqrt ( i . e . power = 0 . 5 ) : <nl> + <nl> + ` ` ` python <nl> + . . . <nl> + global_step = tf . Variable ( 0 , trainable = False ) <nl> + starter_learning_rate = 0 . 1 <nl> + end_learning_rate = 0 . 01 <nl> + decay_steps = 10000 <nl> + learning_rate = tf . train . polynomial_decay ( starter_learning_rate , global_step , <nl> + decay_steps , end_learning_rate , <nl> + power = 0 . 5 ) <nl> + # Passing global_step to minimize ( ) will increment it at each step . <nl> + learning_step = ( <nl> + tf . GradientDescentOptimizer ( learning_rate ) <nl> + . minimize ( . . . my loss . . . , global_step = global_step ) <nl> + ) <nl> + ` ` ` <nl> + <nl> + Args : <nl> + learning_rate : A scalar ` float32 ` or ` float64 ` ` Tensor ` or a <nl> + Python number . The initial learning rate . <nl> + global_step : A scalar ` int32 ` or ` int64 ` ` Tensor ` or a Python number . <nl> + Global step to use for the decay computation . Must not be negative . <nl> + decay_steps : A scalar ` int32 ` or ` int64 ` ` Tensor ` or a Python number . <nl> + Must be positive . See the decay computation above . <nl> + end_learning_rate : A scalar ` float32 ` or ` float64 ` ` Tensor ` or a <nl> + Python number . The minimal end learning rate . <nl> + power : A scalar ` float32 ` or ` float64 ` ` Tensor ` or a <nl> + Python number . The power of the polynomial . Defaults to sqrt , i . e . 0 . 5 . <nl> + cycle : A boolean , whether or not it should cycle beyond decay_steps . <nl> + name : String . Optional name of the operation . Defaults to ' PolynomialDecay ' <nl> + <nl> + Returns : <nl> + A scalar ` Tensor ` of the same type as ` learning_rate ` . The decayed <nl> + learning rate . <nl> + " " " <nl> + with ops . op_scope ( <nl> + [ learning_rate , global_step , decay_steps , end_learning_rate , power ] , <nl> + name , " PolynomialDecay " ) as name : <nl> + learning_rate = ops . convert_to_tensor ( learning_rate , name = " learning_rate " ) <nl> + dtype = learning_rate . dtype <nl> + global_step = math_ops . cast ( global_step , dtype ) <nl> + decay_steps = math_ops . cast ( decay_steps , dtype ) <nl> + end_learning_rate = math_ops . cast ( end_learning_rate , dtype ) <nl> + power = math_ops . cast ( power , dtype ) <nl> + if cycle : <nl> + # Find the first multiple of decay_steps that is bigger than global_step . <nl> + decay_steps = math_ops . mul ( decay_steps , <nl> + math_ops . ceil ( global_step / decay_steps ) ) <nl> + else : <nl> + # Make sure that the global_step used is not bigger than decay_steps . <nl> + global_step = math_ops . minimum ( global_step , decay_steps ) <nl> + <nl> + p = math_ops . div ( global_step , decay_steps ) <nl> + return math_ops . add ( math_ops . mul ( learning_rate - end_learning_rate , <nl> + math_ops . pow ( 1 - p , power ) ) , <nl> + end_learning_rate , name = name ) <nl> mmm a / tensorflow / python / training / learning_rate_decay_test . py <nl> ppp b / tensorflow / python / training / learning_rate_decay_test . py <nl> def testPiecewiseConstant ( self ) : <nl> assign_999 = x . assign ( 999 ) <nl> pc = learning_rate_decay . piecewise_constant ( x , [ 100 , 110 , 120 ] , <nl> [ 1 . 0 , 0 . 1 , 0 . 01 , 0 . 001 ] ) <nl> - <nl> + <nl> variables . initialize_all_variables ( ) . run ( ) <nl> self . assertAllClose ( pc . eval ( ) , 1 . 0 , 1e - 6 ) <nl> assign_100 . op . run ( ) <nl> def testPiecewiseConstant ( self ) : <nl> self . assertAllClose ( pc . eval ( ) , 0 . 01 , 1e - 6 ) <nl> assign_999 . op . run ( ) <nl> self . assertAllClose ( pc . eval ( ) , 0 . 001 , 1e - 6 ) <nl> - <nl> + <nl> def testPiecewiseConstantEdgeCases ( self ) : <nl> with self . test_session ( ) : <nl> with self . assertRaises ( ValueError ) : <nl> x_int = variables . Variable ( 0 , dtype = variables . dtypes . int32 ) <nl> boundaries , values = [ - 1 . 0 , 1 . 0 ] , [ 1 , 2 , 3 ] <nl> - pc = learning_rate_decay . piecewise_constant ( x_int , boundaries , values ) <nl> + learning_rate_decay . piecewise_constant ( x_int , boundaries , values ) <nl> with self . assertRaises ( ValueError ) : <nl> x = variables . Variable ( 0 . 0 ) <nl> boundaries , values = [ - 1 . 0 , 1 . 0 ] , [ 1 . 0 , 2 , 3 ] <nl> - pc = learning_rate_decay . piecewise_constant ( x , boundaries , values ) <nl> + learning_rate_decay . piecewise_constant ( x , boundaries , values ) <nl> + <nl> + <nl> + class LinearDecayTest ( test_util . TensorFlowTestCase ) : <nl> + <nl> + def testHalfWay ( self ) : <nl> + with self . test_session ( ) : <nl> + step = 5 <nl> + lr = 0 . 05 <nl> + end_lr = 0 . 0 <nl> + decayed_lr = learning_rate_decay . polynomial_decay ( lr , step , 10 , end_lr ) <nl> + expected = lr * 0 . 5 <nl> + self . assertAllClose ( decayed_lr . eval ( ) , expected , 1e - 6 ) <nl> + <nl> + def testEnd ( self ) : <nl> + with self . test_session ( ) : <nl> + step = 10 <nl> + lr = 0 . 05 <nl> + end_lr = 0 . 001 <nl> + decayed_lr = learning_rate_decay . polynomial_decay ( lr , step , 10 , end_lr ) <nl> + expected = end_lr <nl> + self . assertAllClose ( decayed_lr . eval ( ) , expected , 1e - 6 ) <nl> + <nl> + def testHalfWayWithEnd ( self ) : <nl> + with self . test_session ( ) : <nl> + step = 5 <nl> + lr = 0 . 05 <nl> + end_lr = 0 . 001 <nl> + decayed_lr = learning_rate_decay . polynomial_decay ( lr , step , 10 , end_lr ) <nl> + expected = ( lr + end_lr ) * 0 . 5 <nl> + self . assertAllClose ( decayed_lr . eval ( ) , expected , 1e - 6 ) <nl> + <nl> + def testBeyondEnd ( self ) : <nl> + with self . test_session ( ) : <nl> + step = 15 <nl> + lr = 0 . 05 <nl> + end_lr = 0 . 001 <nl> + decayed_lr = learning_rate_decay . polynomial_decay ( lr , step , 10 , end_lr ) <nl> + expected = end_lr <nl> + self . assertAllClose ( decayed_lr . eval ( ) , expected , 1e - 6 ) <nl> + <nl> + def testBeyondEndWithCycle ( self ) : <nl> + with self . test_session ( ) : <nl> + step = 15 <nl> + lr = 0 . 05 <nl> + end_lr = 0 . 001 <nl> + decayed_lr = learning_rate_decay . polynomial_decay ( lr , step , 10 , end_lr , <nl> + cycle = True ) <nl> + expected = ( lr - end_lr ) * 0 . 25 + end_lr <nl> + self . assertAllClose ( decayed_lr . eval ( ) , expected , 1e - 6 ) <nl> + <nl> + <nl> + class SqrtDecayTest ( test_util . TensorFlowTestCase ) : <nl> + <nl> + def testHalfWay ( self ) : <nl> + with self . test_session ( ) : <nl> + step = 5 <nl> + lr = 0 . 05 <nl> + end_lr = 0 . 0 <nl> + power = 0 . 5 <nl> + decayed_lr = learning_rate_decay . polynomial_decay ( lr , step , 10 , end_lr , <nl> + power = power ) <nl> + expected = lr * 0 . 5 * * power <nl> + self . assertAllClose ( decayed_lr . eval ( ) , expected , 1e - 6 ) <nl> + <nl> + def testEnd ( self ) : <nl> + with self . test_session ( ) : <nl> + step = 10 <nl> + lr = 0 . 05 <nl> + end_lr = 0 . 001 <nl> + power = 0 . 5 <nl> + decayed_lr = learning_rate_decay . polynomial_decay ( lr , step , 10 , end_lr , <nl> + power = power ) <nl> + expected = end_lr <nl> + self . assertAllClose ( decayed_lr . eval ( ) , expected , 1e - 6 ) <nl> + <nl> + def testHalfWayWithEnd ( self ) : <nl> + with self . test_session ( ) : <nl> + step = 5 <nl> + lr = 0 . 05 <nl> + end_lr = 0 . 001 <nl> + power = 0 . 5 <nl> + decayed_lr = learning_rate_decay . polynomial_decay ( lr , step , 10 , end_lr , <nl> + power = power ) <nl> + expected = ( lr - end_lr ) * 0 . 5 * * power + end_lr <nl> + self . assertAllClose ( decayed_lr . eval ( ) , expected , 1e - 6 ) <nl> + <nl> + def testBeyondEnd ( self ) : <nl> + with self . test_session ( ) : <nl> + step = 15 <nl> + lr = 0 . 05 <nl> + end_lr = 0 . 001 <nl> + power = 0 . 5 <nl> + decayed_lr = learning_rate_decay . polynomial_decay ( lr , step , 10 , end_lr , <nl> + power = power ) <nl> + expected = end_lr <nl> + self . assertAllClose ( decayed_lr . eval ( ) , expected , 1e - 6 ) <nl> + <nl> + def testBeyondEndWithCycle ( self ) : <nl> + with self . test_session ( ) : <nl> + step = 15 <nl> + lr = 0 . 05 <nl> + end_lr = 0 . 001 <nl> + power = 0 . 5 <nl> + decayed_lr = learning_rate_decay . polynomial_decay ( lr , step , 10 , end_lr , <nl> + power = power , cycle = True ) <nl> + expected = ( lr - end_lr ) * 0 . 25 * * power + end_lr <nl> + self . assertAllClose ( decayed_lr . eval ( ) , expected , 1e - 6 ) <nl> <nl> <nl> if __name__ = = " __main__ " : <nl>
Added polynomial learning_rate_decay .
tensorflow/tensorflow
264d1afd43c7c75d507744b815198c43b3a2126b
2016-06-14T00:17:56Z
mmm a / local - cli / runWindows / utils / deploy . js <nl> ppp b / local - cli / runWindows / utils / deploy . js <nl> function getWindowsStoreAppUtils ( options ) { <nl> } <nl> <nl> function getAppxManifest ( options ) { <nl> - const appxPath = glob . sync ( path . join ( options . root , ' windows / * / bin / * / * / AppxManifest . xml ' ) ) [ 0 ] ; <nl> + const configuration = options . debug ? ' Debug ' : ' Release ' ; <nl> + const appxPath = glob . sync ( path . join ( options . root , ` windows / * / bin / $ { options . arch } / $ { configuration } / AppxManifest . xml ` ) ) [ 0 ] ; <nl> return parse ( fs . readFileSync ( appxPath , ' utf8 ' ) ) ; <nl> } <nl> <nl> function deployToDevice ( options ) { <nl> <nl> function deployToDesktop ( options ) { <nl> const appPackageFolder = getAppPackage ( options ) ; <nl> - <nl> - const windowsStoreAppUtils = getWindowsStoreAppUtils ( ) ; <nl> + const windowsStoreAppUtils = getWindowsStoreAppUtils ( options ) ; <nl> const appxManifest = getAppxManifest ( options ) ; <nl> const identity = appxManifest . root . children . filter ( function ( x ) { return x . name = = = ' Identity ' ; } ) [ 0 ] ; <nl> const appName = identity . attributes . Name ; <nl>
fix ( runWindows ) : Fixes deployToDesktop method for runWindows CLI ( )
microsoft/react-native-windows
c124d890d9bb67dfb4b8b6f38acd02aeac276caf
2016-06-23T20:40:31Z
mmm a / tensorflow / compiler / tests / ternary_ops_test . py <nl> ppp b / tensorflow / compiler / tests / ternary_ops_test . py <nl> def testSelect ( self ) : <nl> np . array ( 7 , dtype = np . float32 ) , <nl> expected = np . array ( 7 , dtype = np . float32 ) ) <nl> <nl> + self . _testTernary ( <nl> + array_ops . where , <nl> + np . array ( 1 , dtype = np . bool ) , <nl> + np . array ( [ 1 , 2 , 3 , 4 ] , dtype = np . float32 ) , <nl> + np . array ( [ 5 , 6 , 7 , 8 ] , dtype = np . float32 ) , <nl> + expected = np . array ( [ 1 , 2 , 3 , 4 ] , dtype = np . float32 ) ) <nl> + <nl> + self . _testTernary ( <nl> + array_ops . where , <nl> + np . array ( 0 , dtype = np . bool ) , <nl> + np . array ( [ [ 1 , 2 ] , [ 3 , 4 ] , [ 5 , 6 ] ] , dtype = np . float32 ) , <nl> + np . array ( [ [ 7 , 8 ] , [ 9 , 10 ] , [ 11 , 12 ] ] , dtype = np . float32 ) , <nl> + expected = np . array ( [ [ 7 , 8 ] , [ 9 , 10 ] , [ 11 , 12 ] ] , dtype = np . float32 ) ) <nl> + <nl> self . _testTernary ( <nl> array_ops . where , <nl> np . array ( [ 0 , 1 , 1 , 0 ] , dtype = np . bool ) , <nl> mmm a / tensorflow / compiler / tf2xla / kernels / select_op . cc <nl> ppp b / tensorflow / compiler / tf2xla / kernels / select_op . cc <nl> class SelectOp : public XlaOpKernel { <nl> " ' then ' and ' else ' must have the same size . but received : " , <nl> then_shape . DebugString ( ) , " vs . " , else_shape . DebugString ( ) ) ) ; <nl> <nl> + xla : : ComputationBuilder * builder = ctx - > builder ( ) ; <nl> + <nl> + auto cond_handle = ctx - > Input ( 0 ) ; <nl> + auto then_handle = ctx - > Input ( 1 ) ; <nl> + auto else_handle = ctx - > Input ( 2 ) ; <nl> + <nl> bool broadcasting = ! cond_shape . IsSameSize ( then_shape ) ; <nl> - if ( broadcasting ) { <nl> - OP_REQUIRES ( <nl> - ctx , TensorShapeUtils : : IsVector ( cond_shape ) , <nl> - errors : : InvalidArgument ( " ' cond ' must be a vector , but saw shape : " , <nl> - cond_shape . DebugString ( ) ) ) ; <nl> + bool cond_is_scalar = TensorShapeUtils : : IsScalar ( cond_shape ) ; <nl> + if ( broadcasting & & ! cond_is_scalar ) { <nl> + OP_REQUIRES ( ctx , TensorShapeUtils : : IsVector ( cond_shape ) , <nl> + errors : : InvalidArgument ( <nl> + " ' cond ' must be a scalar or a vector , but saw shape : " , <nl> + cond_shape . DebugString ( ) ) ) ; <nl> OP_REQUIRES ( ctx , TensorShapeUtils : : IsVectorOrHigher ( then_shape ) , <nl> errors : : InvalidArgument ( <nl> " ' then ' must be at least a vector , but saw shape : " , <nl> class SelectOp : public XlaOpKernel { <nl> " match size of ' cond ' , but saw : " , <nl> then_shape . dim_size ( 0 ) , " vs . " , <nl> cond_shape . num_elements ( ) ) ) ; <nl> - } <nl> - <nl> - xla : : ComputationBuilder * builder = ctx - > builder ( ) ; <nl> - <nl> - auto cond_handle = ctx - > Input ( 0 ) ; <nl> - auto then_handle = ctx - > Input ( 1 ) ; <nl> - auto else_handle = ctx - > Input ( 2 ) ; <nl> <nl> - if ( broadcasting ) { <nl> / / TODO ( phawkins ) : broadcasting on the right seems pretty awkward in <nl> / / XLA . It seems we have to broadcast on the left and then Reshape <nl> / / to get the dimensions in the right order . <nl>
Fix tf2xla for select ops with scalar ' cond ' .
tensorflow/tensorflow
b875419c9455e6d1d1b3e757fa159011487da2bd
2017-02-15T18:30:05Z
mmm a / test / functional / p2p_invalid_messages . py <nl> ppp b / test / functional / p2p_invalid_messages . py <nl> def run_test ( self ) : <nl> msg_at_size = msg_unrecognized ( " b " * valid_data_limit ) <nl> assert len ( msg_at_size . serialize ( ) ) = = msg_limit <nl> <nl> - with node . assert_memory_usage_stable ( perc_increase_allowed = 0 . 03 ) : <nl> + with node . assert_memory_usage_stable ( perc_increase_allowed = 0 . 5 ) : <nl> self . log . info ( <nl> " Sending a bunch of large , junk messages to test " <nl> " memory exhaustion . May take a bit . . . " ) <nl>
qa : fix p2p_invalid_messages on macOS
bitcoin/bitcoin
0cf1632f03cec7ab1f2bfc83315d52ea06c210be
2018-11-26T20:14:03Z
mmm a / contrib / macdeploy / macdeployqtplus <nl> ppp b / contrib / macdeploy / macdeployqtplus <nl> def copyFramework ( framework , path , verbose ) : <nl> <nl> if not framework . isDylib ( ) : # Copy resources for real frameworks <nl> <nl> - linkfrom = os . path . join ( path , " Contents / Frameworks / " , framework . frameworkName , framework . binaryName ) <nl> - linkto = os . path . join ( framework . binaryPath ) <nl> + linkfrom = os . path . join ( path , " Contents " , " Frameworks " , framework . frameworkName , " Versions " , " Current " ) <nl> + linkto = framework . version <nl> if not os . path . exists ( linkfrom ) : <nl> os . symlink ( linkto , linkfrom ) <nl> if verbose > = 2 : <nl> def copyFramework ( framework , path , verbose ) : <nl> toContentsDir = os . path . join ( path , framework . destinationVersionContentsDirectory ) <nl> shutil . copytree ( fromContentsDir , toContentsDir ) <nl> contentslinkfrom = os . path . join ( path , framework . destinationContentsDirectory ) <nl> - if not os . path . exists ( contentslinkfrom ) : <nl> - contentslinkto = os . path . join ( " Versions / " , framework . version , " Contents " ) <nl> - os . symlink ( contentslinkto , contentslinkfrom ) <nl> - if verbose > = 3 : <nl> - print " Linked : " , contentslinkfrom , " - > " , contentslinkto <nl> if verbose > = 3 : <nl> print " Copied Contents : " , fromContentsDir <nl> print " to : " , toContentsDir <nl>
Merge pull request
bitcoin/bitcoin
437634a79eda03dc46bd1c637733a6cdab71a6c5
2014-10-01T07:00:45Z
mmm a / cocos / editor - support / cocostudio / CCSGUIReader . cpp <nl> ppp b / cocos / editor - support / cocostudio / CCSGUIReader . cpp <nl> Widget * WidgetPropertiesReader0300 : : createWidget ( const rapidjson : : Value & data , c <nl> { <nl> <nl> stExpCocoNode * tpChildArray = pCocoNode - > GetChildArray ( ) ; <nl> - for ( int i = 0 ; i < pCocoNode - > GetChildNum ( ) ; + + i ) { <nl> - const char * value = tpChildArray [ i ] . GetName ( pCocoLoader ) ; <nl> - CCLOG ( " % s " , value ) ; <nl> - } <nl> - int texturesCount = tpChildArray [ 6 ] . GetChildNum ( ) ; <nl> - for ( int i = 0 ; i < texturesCount ; i + + ) <nl> - { <nl> - const char * file = nullptr ; <nl> - stExpCocoNode * textureCountsArray = tpChildArray [ 6 ] . GetChildArray ( ) ; <nl> - file = textureCountsArray [ i ] . GetValue ( ) ; <nl> - SpriteFrameCache : : getInstance ( ) - > addSpriteFramesWithFile ( file ) ; <nl> - } <nl> - <nl> - <nl> - float fileDesignWidth = atof ( tpChildArray [ 5 ] . GetValue ( ) ) ; <nl> - <nl> - float fileDesignHeight = atof ( tpChildArray [ 4 ] . GetValue ( ) ) ; <nl> - <nl> - if ( fileDesignWidth < = 0 | | fileDesignHeight < = 0 ) { <nl> - CCLOGERROR ( " Read design size error ! \ n " ) ; <nl> - Size winSize = Director : : getInstance ( ) - > getWinSize ( ) ; <nl> - GUIReader : : getInstance ( ) - > storeFileDesignSize ( fileName , winSize ) ; <nl> - } <nl> - else <nl> - { <nl> - GUIReader : : getInstance ( ) - > storeFileDesignSize ( fileName , Size ( fileDesignWidth , fileDesignHeight ) ) ; <nl> - } <nl> + float fileDesignWidth ; <nl> + float fileDesignHeight ; <nl> <nl> - stExpCocoNode * widgetTreeNode = & tpChildArray [ 8 ] ; <nl> - rapidjson : : Type tType = tpChildArray [ 8 ] . GetType ( pCocoLoader ) ; <nl> - <nl> Widget * widget = nullptr ; <nl> <nl> - if ( rapidjson : : kObjectType = = tType ) <nl> - { <nl> - / / convert this function ! ! ! <nl> - widget = widgetFromBinary ( pCocoLoader , widgetTreeNode ) ; <nl> + for ( int i = 0 ; i < pCocoNode - > GetChildNum ( ) ; + + i ) { <nl> + std : : string key = tpChildArray [ i ] . GetName ( pCocoLoader ) ; <nl> + <nl> + if ( key = = " textures " ) { <nl> + int texturesCount = tpChildArray [ i ] . GetChildNum ( ) ; <nl> + for ( int j = 0 ; j < texturesCount ; j + + ) <nl> + { <nl> + std : : string file ; <nl> + stExpCocoNode * textureCountsArray = tpChildArray [ i ] . GetChildArray ( ) ; <nl> + file = textureCountsArray [ j ] . GetValue ( ) ; <nl> + SpriteFrameCache : : getInstance ( ) - > addSpriteFramesWithFile ( file ) ; <nl> + } <nl> + } else if ( key = = " designWidth " ) { <nl> + fileDesignWidth = atof ( tpChildArray [ i ] . GetValue ( ) ) ; <nl> + } else if ( key = = " designHeight " ) { <nl> + fileDesignHeight = atof ( tpChildArray [ i ] . GetValue ( ) ) ; <nl> + } else if ( key = = " widgetTree " ) { <nl> + <nl> + if ( fileDesignWidth < = 0 | | fileDesignHeight < = 0 ) { <nl> + CCLOGERROR ( " Read design size error ! \ n " ) ; <nl> + Size winSize = Director : : getInstance ( ) - > getWinSize ( ) ; <nl> + GUIReader : : getInstance ( ) - > storeFileDesignSize ( fileName , winSize ) ; <nl> + } <nl> + else <nl> + { <nl> + GUIReader : : getInstance ( ) - > storeFileDesignSize ( fileName , Size ( fileDesignWidth , fileDesignHeight ) ) ; <nl> + } <nl> + <nl> + <nl> + stExpCocoNode * widgetTreeNode = & tpChildArray [ i ] ; <nl> + rapidjson : : Type tType = tpChildArray [ i ] . GetType ( pCocoLoader ) ; <nl> + <nl> + if ( rapidjson : : kObjectType = = tType ) <nl> + { <nl> + widget = widgetFromBinary ( pCocoLoader , widgetTreeNode ) ; <nl> + } <nl> + <nl> + if ( widget - > getContentSize ( ) . equals ( Size : : ZERO ) ) <nl> + { <nl> + Layout * rootWidget = dynamic_cast < Layout * > ( widget ) ; <nl> + rootWidget - > setSize ( Size ( fileDesignWidth , fileDesignHeight ) ) ; <nl> + } <nl> + } <nl> } <nl> <nl> - / * * * * * * * * * * temp * * * * * * * * * * / <nl> - if ( widget - > getContentSize ( ) . equals ( Size : : ZERO ) ) <nl> - { <nl> - Layout * rootWidget = dynamic_cast < Layout * > ( widget ) ; <nl> - rootWidget - > setSize ( Size ( fileDesignWidth , fileDesignHeight ) ) ; <nl> - } <nl> / * * * * * * * * * * * * * * * * * * * * * * * * / <nl> - <nl> + / / TODO : <nl> / / / / widget - > setFileDesignSize ( Size ( fileDesignWidth , fileDesignHeight ) ) ; <nl> / / const rapidjson : : Value & actions = DICTOOL - > getSubDictionary_json ( data , " animation " ) ; <nl> / / / * * * * * * * * * * temp * * * * * * * * * * / <nl>
improve parser
cocos2d/cocos2d-x
f50263402af193b0edc8795eab051888cef51f07
2014-06-11T06:56:12Z
mmm a / src / rss . h <nl> ppp b / src / rss . h <nl> public slots : <nl> void processDownloadedFile ( QString file_path ) { <nl> filePath = file_path ; <nl> downloadFailure = false ; <nl> + lastRefresh . start ( ) ; <nl> if ( openRss ( ) > = 0 ) { <nl> - lastRefresh . start ( ) ; <nl> refreshed = true ; <nl> + } else { <nl> + qDebug ( " OpenRss : Feed update Failed " ) ; <nl> } <nl> } <nl> <nl> void setDownloadFailed ( ) { <nl> public : <nl> RssStream ( bittorrent * BTSession , QString _url ) : BTSession ( BTSession ) , url ( _url ) , alias ( " " ) , iconPath ( " : / Icons / rss16 . png " ) , refreshed ( false ) , downloadFailure ( false ) , currently_loading ( false ) { <nl> qDebug ( " RSSStream constructed " ) ; <nl> + QSettings qBTRSS ( " qBittorrent " , " qBittorrent - rss " ) ; <nl> + QHash < QString , QVariant > all_old_items = qBTRSS . value ( " old_items " , QHash < QString , QVariant > ( ) ) . toHash ( ) ; <nl> + QVariantList old_items = all_old_items . value ( url , QVariantList ( ) ) . toList ( ) ; <nl> + qDebug ( " Loading % d old items for feed % s " , old_items . size ( ) , getAliasOrUrl ( ) . toLocal8Bit ( ) . data ( ) ) ; <nl> + foreach ( const QVariant & var_it , old_items ) { <nl> + QHash < QString , QVariant > item = var_it . toHash ( ) ; <nl> + RssItem * rss_item = RssItem : : fromHash ( item ) ; <nl> + if ( rss_item - > isValid ( ) ) <nl> + listItem < < rss_item ; <nl> + } <nl> } <nl> <nl> ~ RssStream ( ) { <nl> QString getIconUrl ( ) { <nl> private : <nl> / / read and create items from a rss document <nl> short readDoc ( const QDomDocument & doc ) { <nl> - if ( ! refreshed ) { <nl> - QSettings qBTRSS ( " qBittorrent " , " qBittorrent - rss " ) ; <nl> - QHash < QString , QVariant > all_old_items = qBTRSS . value ( " old_items " , QHash < QString , QVariant > ( ) ) . toHash ( ) ; <nl> - QVariantList old_items = all_old_items . value ( url , QVariantList ( ) ) . toList ( ) ; <nl> - qDebug ( " Loading % d old items for feed % s " , old_items . size ( ) , getAliasOrUrl ( ) . toLocal8Bit ( ) . data ( ) ) ; <nl> - foreach ( const QVariant & var_it , old_items ) { <nl> - QHash < QString , QVariant > item = var_it . toHash ( ) ; <nl> - RssItem * rss_item = RssItem : : fromHash ( item ) ; <nl> - if ( rss_item - > isValid ( ) ) <nl> - listItem < < rss_item ; <nl> - } <nl> - } <nl> / / is it a rss file ? <nl> QDomElement root = doc . documentElement ( ) ; <nl> if ( root . tagName ( ) = = QString : : fromUtf8 ( " html " ) ) { <nl> void refreshAll ( ) { <nl> } <nl> <nl> void refresh ( QString url ) { <nl> + qDebug ( " Refreshing feed : % s " , url . toLocal8Bit ( ) . data ( ) ) ; <nl> Q_ASSERT ( streams . contains ( url ) ) ; <nl> RssStream * stream = streams [ url ] ; <nl> if ( stream - > isLoading ( ) ) return ; <nl> mmm a / src / rss_imp . cpp <nl> ppp b / src / rss_imp . cpp <nl> void RSSImp : : on_actionMark_all_as_read_triggered ( ) { <nl> item - > setData ( 0 , Qt : : DisplayRole , feed - > getAliasOrUrl ( ) + QString : : fromUtf8 ( " ( 0 ) " ) ) ; <nl> } <nl> if ( selectedItems . size ( ) ) <nl> - refreshNewsList ( selectedItems . last ( ) , 0 ) ; <nl> + refreshNewsList ( selectedItems . last ( ) ) ; <nl> } <nl> <nl> / / right - click somewhere , refresh all the streams <nl> void RSSImp : : updateLastRefreshedTimeForStreams ( ) { <nl> } <nl> <nl> / / fills the newsList <nl> - void RSSImp : : refreshNewsList ( QTreeWidgetItem * item , int ) { <nl> + void RSSImp : : refreshNewsList ( QTreeWidgetItem * item ) { <nl> + if ( ! item ) return ; <nl> selectedFeedUrl = item - > text ( 1 ) ; <nl> RssStream * stream = rssmanager - > getFeed ( selectedFeedUrl ) ; <nl> qDebug ( " Getting the list of news " ) ; <nl> void RSSImp : : updateFeedInfos ( QString url , QString aliasOrUrl , unsigned int nbUnr <nl> item - > setToolTip ( 0 , QString : : fromUtf8 ( " < b > " ) + tr ( " Description : " ) + QString : : fromUtf8 ( " < / b > " ) + stream - > getDescription ( ) + QString : : fromUtf8 ( " < br / > < b > " ) + tr ( " url : " ) + QString : : fromUtf8 ( " < / b > " ) + stream - > getUrl ( ) + QString : : fromUtf8 ( " < br / > < b > " ) + tr ( " Last refresh : " ) + QString : : fromUtf8 ( " < / b > " ) + stream - > getLastRefreshElapsedString ( ) ) ; <nl> / / If the feed is selected , update the displayed news <nl> if ( selectedFeedUrl = = url ) { <nl> - refreshNewsList ( getTreeItemFromUrl ( url ) , 0 ) ; <nl> + refreshNewsList ( item ) ; <nl> } <nl> } <nl> <nl> RSSImp : : RSSImp ( bittorrent * BTSession ) : QWidget ( ) , BTSession ( BTSession ) { <nl> connect ( actionOpen_news_URL , SIGNAL ( triggered ( ) ) , this , SLOT ( openNewsUrl ( ) ) ) ; <nl> connect ( actionDownload_torrent , SIGNAL ( triggered ( ) ) , this , SLOT ( downloadTorrent ( ) ) ) ; <nl> <nl> - connect ( listStreams , SIGNAL ( itemClicked ( QTreeWidgetItem * , int ) ) , this , SLOT ( refreshNewsList ( QTreeWidgetItem * , int ) ) ) ; <nl> + connect ( listStreams , SIGNAL ( currentItemChanged ( QTreeWidgetItem * , QTreeWidgetItem * ) ) , this , SLOT ( refreshNewsList ( QTreeWidgetItem * ) ) ) ; <nl> connect ( listNews , SIGNAL ( itemClicked ( QListWidgetItem * ) ) , this , SLOT ( refreshTextBrowser ( QListWidgetItem * ) ) ) ; <nl> connect ( listNews , SIGNAL ( itemDoubleClicked ( QListWidgetItem * ) ) , this , SLOT ( downloadTorrent ( ) ) ) ; <nl> refreshTimeTimer = new QTimer ( this ) ; <nl> mmm a / src / rss_imp . h <nl> ppp b / src / rss_imp . h <nl> class RSSImp : public QWidget , public Ui : : RSS { <nl> void copySelectedFeedsURL ( ) ; <nl> void createStream ( ) ; <nl> void refreshAllStreams ( ) ; <nl> - void refreshNewsList ( QTreeWidgetItem * item , int ) ; <nl> + void refreshNewsList ( QTreeWidgetItem * item ) ; <nl> void refreshTextBrowser ( QListWidgetItem * ) ; <nl> void updateLastRefreshedTimeForStreams ( ) ; <nl> void updateFeedIcon ( QString url , QString icon_path ) ; <nl>
- Slightly improved RSS feeds loading : Saved news can be displayed before the Feed is effectively updated
qbittorrent/qBittorrent
2cbbd6ef50d012fece84e9fbef0620db4d123674
2009-08-21T14:48:33Z
mmm a / atom . gyp <nl> ppp b / atom . gyp <nl> <nl> ' atom / common / api / object_life_monitor . h ' , <nl> ' atom / common / asar / archive . cc ' , <nl> ' atom / common / asar / archive . h ' , <nl> + ' atom / common / asar / asar_util . cc ' , <nl> + ' atom / common / asar / asar_util . h ' , <nl> ' atom / common / asar / scoped_temporary_file . cc ' , <nl> ' atom / common / asar / scoped_temporary_file . h ' , <nl> ' atom / common / common_message_generator . cc ' , <nl> mmm a / atom / browser / net / asar / asar_protocol_handler . cc <nl> ppp b / atom / browser / net / asar / asar_protocol_handler . cc <nl> <nl> <nl> # include " atom / browser / net / asar / url_request_asar_job . h " <nl> # include " atom / common / asar / archive . h " <nl> + # include " atom / common / asar / asar_util . h " <nl> # include " net / base / filename_util . h " <nl> # include " net / base / net_errors . h " <nl> # include " net / url_request / url_request_error_job . h " <nl> <nl> <nl> namespace asar { <nl> <nl> - namespace { <nl> - <nl> - const base : : FilePath : : CharType kAsarExtension [ ] = FILE_PATH_LITERAL ( " . asar " ) ; <nl> - <nl> - / / Get the relative path in asar archive . <nl> - bool GetAsarPath ( const base : : FilePath & full_path , <nl> - base : : FilePath * asar_path , <nl> - base : : FilePath * relative_path ) { <nl> - base : : FilePath iter = full_path ; <nl> - while ( true ) { <nl> - base : : FilePath dirname = iter . DirName ( ) ; <nl> - if ( iter . MatchesExtension ( kAsarExtension ) ) <nl> - break ; <nl> - else if ( iter = = dirname ) <nl> - return false ; <nl> - iter = dirname ; <nl> - } <nl> - <nl> - base : : FilePath tail ; <nl> - if ( ! iter . AppendRelativePath ( full_path , & tail ) ) <nl> - return false ; <nl> - <nl> - * asar_path = iter ; <nl> - * relative_path = tail ; <nl> - return true ; <nl> - } <nl> - <nl> - } / / namespace <nl> - <nl> AsarProtocolHandler : : AsarProtocolHandler ( <nl> const scoped_refptr < base : : TaskRunner > & file_task_runner ) <nl> : file_task_runner_ ( file_task_runner ) { } <nl> AsarProtocolHandler : : AsarProtocolHandler ( <nl> AsarProtocolHandler : : ~ AsarProtocolHandler ( ) { <nl> } <nl> <nl> - Archive * AsarProtocolHandler : : GetOrCreateAsarArchive ( <nl> - const base : : FilePath & path ) const { <nl> - if ( ! archives_ . contains ( path ) ) { <nl> - scoped_ptr < Archive > archive ( new Archive ( path ) ) ; <nl> - if ( ! archive - > Init ( ) ) <nl> - return nullptr ; <nl> - <nl> - archives_ . set ( path , archive . Pass ( ) ) ; <nl> - } <nl> - <nl> - return archives_ . get ( path ) ; <nl> - } <nl> - <nl> net : : URLRequestJob * AsarProtocolHandler : : MaybeCreateJob ( <nl> net : : URLRequest * request , <nl> net : : NetworkDelegate * network_delegate ) const { <nl> net : : URLRequestJob * AsarProtocolHandler : : MaybeCreateJob ( <nl> / / Create asar : / / job when the path contains " xxx . asar / " , otherwise treat the <nl> / / URL request as file : / / . <nl> base : : FilePath asar_path , relative_path ; <nl> - if ( ! GetAsarPath ( full_path , & asar_path , & relative_path ) ) <nl> + if ( ! GetAsarArchivePath ( full_path , & asar_path , & relative_path ) ) <nl> return new net : : URLRequestFileJob ( request , network_delegate , full_path , <nl> file_task_runner_ ) ; <nl> <nl> - Archive * archive = GetOrCreateAsarArchive ( asar_path ) ; <nl> + std : : shared_ptr < Archive > archive = GetOrCreateAsarArchive ( asar_path ) ; <nl> if ( ! archive ) <nl> return new net : : URLRequestErrorJob ( request , network_delegate , <nl> net : : ERR_FILE_NOT_FOUND ) ; <nl> mmm a / atom / browser / net / asar / asar_protocol_handler . h <nl> ppp b / atom / browser / net / asar / asar_protocol_handler . h <nl> <nl> # ifndef ATOM_BROWSER_NET_ASAR_ASAR_PROTOCOL_HANDLER_H_ <nl> # define ATOM_BROWSER_NET_ASAR_ASAR_PROTOCOL_HANDLER_H_ <nl> <nl> - # include " base / containers / scoped_ptr_hash_map . h " <nl> - # include " base / files / file_path . h " <nl> # include " base / memory / ref_counted . h " <nl> # include " net / url_request / url_request_job_factory . h " <nl> <nl> class TaskRunner ; <nl> <nl> namespace asar { <nl> <nl> - class Archive ; <nl> - <nl> class AsarProtocolHandler : public net : : URLRequestJobFactory : : ProtocolHandler { <nl> public : <nl> explicit AsarProtocolHandler ( <nl> const scoped_refptr < base : : TaskRunner > & file_task_runner ) ; <nl> virtual ~ AsarProtocolHandler ( ) ; <nl> <nl> - Archive * GetOrCreateAsarArchive ( const base : : FilePath & path ) const ; <nl> - <nl> / / net : : URLRequestJobFactory : : ProtocolHandler : <nl> net : : URLRequestJob * MaybeCreateJob ( <nl> net : : URLRequest * request , <nl> class AsarProtocolHandler : public net : : URLRequestJobFactory : : ProtocolHandler { <nl> private : <nl> const scoped_refptr < base : : TaskRunner > file_task_runner_ ; <nl> <nl> - mutable base : : ScopedPtrHashMap < base : : FilePath , Archive > archives_ ; <nl> - <nl> DISALLOW_COPY_AND_ASSIGN ( AsarProtocolHandler ) ; <nl> } ; <nl> <nl> mmm a / atom / browser / net / asar / url_request_asar_job . cc <nl> ppp b / atom / browser / net / asar / url_request_asar_job . cc <nl> namespace asar { <nl> URLRequestAsarJob : : URLRequestAsarJob ( <nl> net : : URLRequest * request , <nl> net : : NetworkDelegate * network_delegate , <nl> - Archive * archive , <nl> + std : : shared_ptr < Archive > archive , <nl> const base : : FilePath & file_path , <nl> const scoped_refptr < base : : TaskRunner > & file_task_runner ) <nl> : net : : URLRequestJob ( request , network_delegate ) , <nl> mmm a / atom / browser / net / asar / url_request_asar_job . h <nl> ppp b / atom / browser / net / asar / url_request_asar_job . h <nl> <nl> # ifndef ATOM_BROWSER_NET_ASAR_URL_REQUEST_ASAR_JOB_H_ <nl> # define ATOM_BROWSER_NET_ASAR_URL_REQUEST_ASAR_JOB_H_ <nl> <nl> + # include < memory > <nl> # include < string > <nl> <nl> # include " atom / common / asar / archive . h " <nl> class URLRequestAsarJob : public net : : URLRequestJob { <nl> public : <nl> URLRequestAsarJob ( net : : URLRequest * request , <nl> net : : NetworkDelegate * network_delegate , <nl> - Archive * archive , <nl> + std : : shared_ptr < Archive > archive , <nl> const base : : FilePath & file_path , <nl> const scoped_refptr < base : : TaskRunner > & file_task_runner ) ; <nl> <nl> class URLRequestAsarJob : public net : : URLRequestJob { <nl> / / Callback after data is asynchronously read from the file into | buf | . <nl> void DidRead ( scoped_refptr < net : : IOBuffer > buf , int result ) ; <nl> <nl> - Archive * archive_ ; <nl> + std : : shared_ptr < Archive > archive_ ; <nl> Archive : : FileInfo file_info_ ; <nl> base : : FilePath file_path_ ; <nl> <nl> mmm a / atom / common / api / atom_api_native_image . cc <nl> ppp b / atom / common / api / atom_api_native_image . cc <nl> <nl> # include < string > <nl> # include < vector > <nl> <nl> + # include " atom / common / asar / asar_util . h " <nl> # include " atom / common / native_mate_converters / file_path_converter . h " <nl> # include " atom / common / native_mate_converters / gfx_converter . h " <nl> # include " atom / common / native_mate_converters / gurl_converter . h " <nl> # include " base / base64 . h " <nl> - # include " base / files / file_util . h " <nl> # include " base / strings / string_util . h " <nl> # include " native_mate / dictionary . h " <nl> # include " native_mate / object_template_builder . h " <nl> bool AddImageSkiaRep ( gfx : : ImageSkia * image , <nl> const base : : FilePath & path , <nl> double scale_factor ) { <nl> std : : string file_contents ; <nl> - if ( ! base : : ReadFileToString ( path , & file_contents ) ) <nl> + if ( ! asar : : ReadFileToString ( path , & file_contents ) ) <nl> return false ; <nl> <nl> const unsigned char * data = <nl> new file mode 100644 <nl> index 000000000000 . . 43e2601ac456 <nl> mmm / dev / null <nl> ppp b / atom / common / asar / asar_util . cc <nl> <nl> + / / Copyright ( c ) 2015 GitHub , Inc . <nl> + / / Use of this source code is governed by the MIT license that can be <nl> + / / found in the LICENSE file . <nl> + <nl> + # include " atom / common / asar / asar_util . h " <nl> + <nl> + # include < map > <nl> + # include < string > <nl> + <nl> + # include " atom / common / asar / archive . h " <nl> + # include " base / files / file_path . h " <nl> + # include " base / files / file_util . h " <nl> + # include " base / lazy_instance . h " <nl> + # include " base / stl_util . h " <nl> + <nl> + namespace asar { <nl> + <nl> + namespace { <nl> + <nl> + / / The global instance of ArchiveMap , will be destroyed on exit . <nl> + typedef std : : map < base : : FilePath , std : : shared_ptr < Archive > > ArchiveMap ; <nl> + static base : : LazyInstance < ArchiveMap > g_archive_map = LAZY_INSTANCE_INITIALIZER ; <nl> + <nl> + const base : : FilePath : : CharType kAsarExtension [ ] = FILE_PATH_LITERAL ( " . asar " ) ; <nl> + <nl> + } / / namespace <nl> + <nl> + std : : shared_ptr < Archive > GetOrCreateAsarArchive ( const base : : FilePath & path ) { <nl> + ArchiveMap & archive_map = * g_archive_map . Pointer ( ) ; <nl> + if ( ! ContainsKey ( archive_map , path ) ) { <nl> + std : : shared_ptr < Archive > archive ( new Archive ( path ) ) ; <nl> + if ( ! archive - > Init ( ) ) <nl> + return nullptr ; <nl> + archive_map [ path ] = archive ; <nl> + } <nl> + return archive_map [ path ] ; <nl> + } <nl> + <nl> + bool GetAsarArchivePath ( const base : : FilePath & full_path , <nl> + base : : FilePath * asar_path , <nl> + base : : FilePath * relative_path ) { <nl> + base : : FilePath iter = full_path ; <nl> + while ( true ) { <nl> + base : : FilePath dirname = iter . DirName ( ) ; <nl> + if ( iter . MatchesExtension ( kAsarExtension ) ) <nl> + break ; <nl> + else if ( iter = = dirname ) <nl> + return false ; <nl> + iter = dirname ; <nl> + } <nl> + <nl> + base : : FilePath tail ; <nl> + if ( ! iter . AppendRelativePath ( full_path , & tail ) ) <nl> + return false ; <nl> + <nl> + * asar_path = iter ; <nl> + * relative_path = tail ; <nl> + return true ; <nl> + } <nl> + <nl> + bool ReadFileToString ( const base : : FilePath & path , std : : string * contents ) { <nl> + base : : FilePath asar_path , relative_path ; <nl> + if ( ! GetAsarArchivePath ( path , & asar_path , & relative_path ) ) <nl> + return base : : ReadFileToString ( path , contents ) ; <nl> + <nl> + std : : shared_ptr < Archive > archive = GetOrCreateAsarArchive ( asar_path ) ; <nl> + if ( ! archive ) <nl> + return false ; <nl> + <nl> + Archive : : FileInfo info ; <nl> + if ( ! archive - > GetFileInfo ( relative_path , & info ) ) <nl> + return false ; <nl> + <nl> + base : : File src ( asar_path , base : : File : : FLAG_OPEN | base : : File : : FLAG_READ ) ; <nl> + if ( ! src . IsValid ( ) ) <nl> + return false ; <nl> + <nl> + contents - > resize ( info . size ) ; <nl> + return static_cast < int > ( info . size ) = = src . Read ( <nl> + info . offset , const_cast < char * > ( contents - > data ( ) ) , contents - > size ( ) ) ; <nl> + } <nl> + <nl> + } / / namespace asar <nl> new file mode 100644 <nl> index 000000000000 . . 4cb5b88e0483 <nl> mmm / dev / null <nl> ppp b / atom / common / asar / asar_util . h <nl> <nl> + / / Copyright ( c ) 2015 GitHub , Inc . <nl> + / / Use of this source code is governed by the MIT license that can be <nl> + / / found in the LICENSE file . <nl> + <nl> + # ifndef ATOM_COMMON_ASAR_ASAR_UTIL_H_ <nl> + # define ATOM_COMMON_ASAR_ASAR_UTIL_H_ <nl> + <nl> + # include < memory > <nl> + # include < string > <nl> + <nl> + namespace base { <nl> + class FilePath ; <nl> + } <nl> + <nl> + namespace asar { <nl> + <nl> + class Archive ; <nl> + <nl> + / / Gets or creates a new Archive from the path . <nl> + std : : shared_ptr < Archive > GetOrCreateAsarArchive ( const base : : FilePath & path ) ; <nl> + <nl> + / / Separates the path to Archive out . <nl> + bool GetAsarArchivePath ( const base : : FilePath & full_path , <nl> + base : : FilePath * asar_path , <nl> + base : : FilePath * relative_path ) ; <nl> + <nl> + / / Same with base : : ReadFileToString but supports asar Archive . <nl> + bool ReadFileToString ( const base : : FilePath & path , std : : string * contents ) ; <nl> + <nl> + } / / namespace asar <nl> + <nl> + # endif / / ATOM_COMMON_ASAR_ASAR_UTIL_H_ <nl> mmm a / spec / asar - spec . coffee <nl> ppp b / spec / asar - spec . coffee <nl> describe ' asar package ' , - > <nl> <nl> it ' does not touch global fs object ' , - > <nl> assert . notEqual fs . readdir , gfs . readdir <nl> + <nl> + describe ' native - image ' , - > <nl> + it ' reads image from asar archive ' , - > <nl> + p = path . join fixtures , ' asar ' , ' logo . asar ' , ' logo . png ' <nl> + logo = require ( ' native - image ' ) . createFromPath p <nl> + assert . deepEqual logo . getSize ( ) , { width : 55 , height : 55 } <nl> new file mode 100644 <nl> index 000000000000 . . fe21fd9ab7b3 <nl> Binary files / dev / null and b / spec / fixtures / asar / logo . asar differ <nl>
Merge pull request from atom / asar - image
electron/electron
afd4052bde769187567f6ba2b41e5001c5dd9d88
2015-02-12T13:04:34Z
mmm a / build - unix . txt <nl> ppp b / build - unix . txt <nl> make <nl> sudo su <nl> make install <nl> ldconfig <nl> + su < username > <nl> + cd . . <nl> + mkdir buildbase <nl> + cd buildbase <nl> + . . / configure - - disable - gui - - enable - debug - - disable - shared - - enable - monolithic <nl> + make <nl> + sudo su <nl> + make install <nl> + ldconfig <nl> <nl> <nl> Boost <nl>
added instructions to build - unix . txt for building wxBase , which is needed to compile bitcoind
bitcoin/bitcoin
2adc9062d873935ef201236ebb8aadf420503f5d
2010-06-23T22:51:31Z
mmm a / packaging / msi / FDBInstaller . wxs <nl> ppp b / packaging / msi / FDBInstaller . wxs <nl> <nl> <nl> < Wix xmlns = ' http : / / schemas . microsoft . com / wix / 2006 / wi ' > <nl> < Product Name = ' $ ( var . Title ) ' <nl> - Id = ' { 6BAF0715 - 4FDE - 4F0D - 8CA7 - E4CAD53519B8 } ' <nl> + Id = ' { 72CE09C5 - 30F1 - 44B0 - 9F1C - E4F494745FF2 } ' <nl> UpgradeCode = ' { A95EA002 - 686E - 4164 - 8356 - C715B7F8B1C8 } ' <nl> Version = ' $ ( var . Version ) ' <nl> Manufacturer = ' $ ( var . Manufacturer ) ' <nl>
update installer WIX GUID following release
apple/foundationdb
e2ad63698eaa40e1997a1f65c7c9d0a83a4eab16
2019-09-30T21:42:16Z
mmm a / hphp / runtime / base / program - functions . cpp <nl> ppp b / hphp / runtime / base / program - functions . cpp <nl> static void set_stack_size ( ) { <nl> struct rlimit rlim ; <nl> if ( getrlimit ( RLIMIT_STACK , & rlim ) ! = 0 ) return ; <nl> <nl> - if ( rlim . rlim_cur < AsyncFuncImpl : : kStackSizeMinimum ) { <nl> + if ( rlim . rlim_cur < AsyncFuncImpl : : kStackSizeMinimum <nl> + # ifndef __CYGWIN__ <nl> + | | rlim . rlim_cur = = RLIM_INFINITY <nl> + # endif <nl> + ) { <nl> # ifdef __CYGWIN__ <nl> Logger : : Error ( " stack limit too small , use peflags - x to increase % zd \ n " , <nl> AsyncFuncImpl : : kStackSizeMinimum ) ; <nl> mmm a / hphp / util / alloc . cpp <nl> ppp b / hphp / util / alloc . cpp <nl> <nl> <nl> # include < atomic > <nl> <nl> + # include < sys / time . h > <nl> + # include < sys / resource . h > <nl> # include < sys / mman . h > <nl> # include < stdlib . h > <nl> # include < errno . h > <nl> static NEVER_INLINE uintptr_t get_stack_top ( ) { <nl> void init_stack_limits ( pthread_attr_t * attr ) { <nl> size_t stacksize , guardsize ; <nl> void * stackaddr ; <nl> + struct rlimit rlim ; <nl> <nl> # ifndef __APPLE__ <nl> if ( pthread_attr_getstack ( attr , & stackaddr , & stacksize ) ! = 0 ) { <nl> void init_stack_limits ( pthread_attr_t * attr ) { <nl> assert ( stacksize > = PTHREAD_STACK_MIN ) ; <nl> s_stackLimit = uintptr_t ( stackaddr ) + guardsize ; <nl> s_stackSize = stacksize - guardsize ; <nl> + <nl> + / / The main thread ' s native stack may be larger than desired if <nl> + / / set_stack_size ( ) failed . Make sure that even if the native stack is <nl> + / / extremely large ( in which case anonymous mmap ( ) could map some of the <nl> + / / " stack space " ) , we can differentiate between the part of the native stack <nl> + / / that could conceivably be used in practice and all anonymous mmap ( ) memory . <nl> + if ( getrlimit ( RLIMIT_STACK , & rlim ) = = 0 & & rlim . rlim_cur = = RLIM_INFINITY & & <nl> + s_stackSize > AsyncFuncImpl : : kStackSizeMinimum ) { <nl> + s_stackLimit + = s_stackSize - AsyncFuncImpl : : kStackSizeMinimum ; <nl> + s_stackSize = AsyncFuncImpl : : kStackSizeMinimum ; <nl> + } <nl> } <nl> <nl> void flush_thread_stack ( ) { <nl>
Fix JIT crash related to stack size limits .
facebook/hhvm
1981ccd0301ee8dc4418e0e789607de17daff62e
2014-12-16T01:00:26Z
mmm a / swoole_redis_coro . cc <nl> ppp b / swoole_redis_coro . cc <nl> enum swRedisError <nl> SW_REDIS_ERR_ALLOC = - 8 , <nl> } ; <nl> <nl> - enum swRedisOption <nl> - { <nl> - SW_REDIS_OPT_SERIALIZER = 1 , <nl> - SW_REDIS_OPT_PREFIX = 2 , <nl> - SW_REDIS_OPT_READ_TIMEOUT = 3 , <nl> - SW_REDIS_OPT_SCAN = 4 , <nl> - SW_REDIS_OPT_FAILOVER = 5 , <nl> - SW_REDIS_OPT_TCP_KEEPALIVE = 6 , <nl> - SW_REDIS_OPT_COMPRESSION = 7 , <nl> - SW_REDIS_OPT_CONNECT_TIMEOUT = 8 , <nl> - } ; <nl> - <nl> / * Extended SET argument detection * / <nl> # define IS_EX_ARG ( a ) \ <nl> ( ( a [ 0 ] = = ' e ' | | a [ 0 ] = = ' E ' ) & & ( a [ 1 ] = = ' x ' | | a [ 1 ] = = ' X ' ) & & a [ 2 ] = = ' \ 0 ' ) <nl> ZEND_BEGIN_ARG_INFO_EX ( arginfo_swoole_redis_coro_connect , 0 , 0 , 1 ) <nl> ZEND_ARG_INFO ( 0 , serialize ) <nl> ZEND_END_ARG_INFO ( ) <nl> <nl> - ZEND_BEGIN_ARG_INFO_EX ( arginfo_swoole_redis_coro_setOption , 0 , 0 , 2 ) <nl> - ZEND_ARG_INFO ( 0 , name ) <nl> - ZEND_ARG_INFO ( 0 , value ) <nl> + ZEND_BEGIN_ARG_INFO_EX ( arginfo_swoole_redis_coro_setOptions , 0 , 0 , 1 ) <nl> + ZEND_ARG_INFO ( 0 , options ) <nl> ZEND_END_ARG_INFO ( ) <nl> <nl> ZEND_BEGIN_ARG_INFO_EX ( arginfo_swoole_redis_coro_void , 0 , 0 , 0 ) <nl> static sw_inline void sw_redis_command_key_str_str ( INTERNAL_FUNCTION_PARAMETERS , <nl> static PHP_METHOD ( swoole_redis_coro , __construct ) ; <nl> static PHP_METHOD ( swoole_redis_coro , __destruct ) ; <nl> static PHP_METHOD ( swoole_redis_coro , connect ) ; <nl> - static PHP_METHOD ( swoole_redis_coro , setOption ) ; <nl> + static PHP_METHOD ( swoole_redis_coro , setOptions ) ; <nl> static PHP_METHOD ( swoole_redis_coro , setDefer ) ; <nl> static PHP_METHOD ( swoole_redis_coro , getDefer ) ; <nl> static PHP_METHOD ( swoole_redis_coro , recv ) ; <nl> static const zend_function_entry swoole_redis_coro_methods [ ] = <nl> PHP_ME ( swoole_redis_coro , __construct , arginfo_swoole_redis_coro_construct , ZEND_ACC_PUBLIC ) <nl> PHP_ME ( swoole_redis_coro , __destruct , arginfo_swoole_redis_coro_void , ZEND_ACC_PUBLIC ) <nl> PHP_ME ( swoole_redis_coro , connect , arginfo_swoole_redis_coro_connect , ZEND_ACC_PUBLIC ) <nl> - PHP_ME ( swoole_redis_coro , setOption , arginfo_swoole_redis_coro_setOption , ZEND_ACC_PUBLIC ) <nl> + PHP_ME ( swoole_redis_coro , setOptions , arginfo_swoole_redis_coro_setOptions , ZEND_ACC_PUBLIC ) <nl> PHP_ME ( swoole_redis_coro , setDefer , NULL , ZEND_ACC_PUBLIC ) <nl> PHP_ME ( swoole_redis_coro , getDefer , NULL , ZEND_ACC_PUBLIC ) <nl> PHP_ME ( swoole_redis_coro , recv , NULL , ZEND_ACC_PUBLIC ) <nl> void swoole_redis_coro_init ( int module_number ) <nl> SWOOLE_DEFINE ( REDIS_ERR_CLOSED ) ; <nl> SWOOLE_DEFINE ( REDIS_ERR_NOAUTH ) ; <nl> SWOOLE_DEFINE ( REDIS_ERR_ALLOC ) ; <nl> - <nl> - / / just support timeout and serialize <nl> - SWOOLE_DEFINE ( REDIS_OPT_READ_TIMEOUT ) ; <nl> - SWOOLE_DEFINE ( REDIS_OPT_SERIALIZER ) ; <nl> - SWOOLE_DEFINE ( REDIS_OPT_CONNECT_TIMEOUT ) ; <nl> } <nl> <nl> static PHP_METHOD ( swoole_redis_coro , __construct ) <nl> static PHP_METHOD ( swoole_redis_coro , connect ) <nl> } <nl> } <nl> <nl> - static PHP_METHOD ( swoole_redis_coro , setOption ) <nl> + static PHP_METHOD ( swoole_redis_coro , setOptions ) <nl> { <nl> swRedisClient * redis = swoole_get_redis_client ( getThis ( ) ) ; <nl> - zend_long zname ; <nl> - zval * zvalue ; <nl> + zval * zoptions ; <nl> <nl> - ZEND_PARSE_PARAMETERS_START ( 2 , 2 ) <nl> - Z_PARAM_LONG ( zname ) <nl> - Z_PARAM_ZVAL ( zvalue ) <nl> + ZEND_PARSE_PARAMETERS_START ( 1 , 1 ) <nl> + Z_PARAM_ARRAY ( zoptions ) <nl> ZEND_PARSE_PARAMETERS_END_EX ( RETURN_FALSE ) ; <nl> <nl> - switch ( zname ) <nl> + HashTable * vht = Z_ARRVAL_P ( zoptions ) ; <nl> + zval * v ; <nl> + <nl> + if ( php_swoole_array_get_value ( vht , " connect_timeout " , v ) ) <nl> { <nl> - case SW_REDIS_OPT_CONNECT_TIMEOUT : <nl> - convert_to_double ( zvalue ) ; <nl> - redis - > connect_timeout = ( double ) Z_DVAL_P ( zvalue ) ; <nl> + convert_to_double ( v ) ; <nl> + redis - > connect_timeout = ( double ) Z_DVAL_P ( v ) ; <nl> if ( redis - > connect_timeout < = 0 ) <nl> { <nl> redis - > connect_timeout = ZEND_LONG_MAX ; <nl> } <nl> - break ; <nl> - case SW_REDIS_OPT_READ_TIMEOUT : <nl> - convert_to_double ( zvalue ) ; <nl> - redis - > timeout = ( double ) Z_DVAL_P ( zvalue ) ; <nl> + } <nl> + if ( php_swoole_array_get_value ( vht , " timeout " , v ) ) <nl> + { <nl> + convert_to_double ( v ) ; <nl> + redis - > timeout = ( double ) Z_DVAL_P ( v ) ; <nl> if ( redis - > timeout < = 0 ) <nl> { <nl> redis - > timeout = ZEND_LONG_MAX ; <nl> static PHP_METHOD ( swoole_redis_coro , setOption ) <nl> socket - > set_timeout ( redis - > timeout ) ; <nl> } <nl> } <nl> - break ; <nl> - case SW_REDIS_OPT_SERIALIZER : <nl> - convert_to_boolean ( zvalue ) ; <nl> - redis - > serialize = Z_BVAL_P ( zvalue ) ; <nl> - break ; <nl> - default : <nl> - swoole_php_error ( E_WARNING , " unknown options " ZEND_LONG_FMT " . " , zname ) ; <nl> + } <nl> + if ( php_swoole_array_get_value ( vht , " serialize " , v ) ) <nl> + { <nl> + convert_to_boolean ( v ) ; <nl> + redis - > serialize = Z_BVAL_P ( v ) ; <nl> } <nl> <nl> RETURN_TRUE ; <nl> mmm a / tests / swoole_redis_coro / psubscribe_eof . phpt <nl> ppp b / tests / swoole_redis_coro / psubscribe_eof . phpt <nl> <nl> - - TEST - - <nl> swoole_redis_coro : redis psubscribe <nl> - - SKIPIF - - <nl> - < ? php require __DIR__ . ' / . . / include / skipif . inc ' ; ? > <nl> + < ? php require __DIR__ . ' / . . / include / skipif . inc ' ; ? > <nl> - - FILE - - <nl> < ? php <nl> - require __DIR__ . ' / . . / include / bootstrap . php ' ; <nl> - <nl> - use Swoole \ Coroutine as co ; <nl> + require __DIR__ . ' / . . / include / bootstrap . php ' ; <nl> <nl> const N = 100 ; <nl> <nl> $ info = $ sock - > getsockname ( ) ; <nl> $ port = $ info [ ' port ' ] ; <nl> <nl> go ( <nl> - function ( ) use ( $ sock ) <nl> - { <nl> + function ( ) use ( $ sock ) { <nl> $ sock - > listen ( ) ; <nl> for ( $ i = 0 ; $ i < N ; $ i + + ) { <nl> $ client = $ sock - > accept ( ) ; <nl> go ( <nl> ) ; <nl> <nl> go ( <nl> - function ( ) use ( $ port ) <nl> - { <nl> - $ redis = new co \ Redis ( ) ; <nl> + function ( ) use ( $ port ) { <nl> + $ redis = new Swoole \ Coroutine \ Redis ( ) ; <nl> $ redis - > connect ( ' 127 . 0 . 0 . 1 ' , $ port ) ; <nl> for ( $ i = 0 ; $ i < N ; $ i + + ) { <nl> $ val = $ redis - > psubscribe ( [ ' test . * ' ] ) ; <nl> mmm a / tests / swoole_redis_coro / setOption . phpt <nl> ppp b / tests / swoole_redis_coro / setOption . phpt <nl> go ( function ( ) { <nl> $ redis - > connect ( REDIS_SERVER_HOST , REDIS_SERVER_PORT ) ; <nl> <nl> / / read time out <nl> - $ redis - > setOption ( SWOOLE_REDIS_OPT_READ_TIMEOUT , 0 . 001 ) ; <nl> + $ redis - > setOptions ( [ ' timeout ' = > 0 . 001 ] ) ; <nl> $ s = microtime ( true ) ; <nl> $ ret = $ redis - > brpoplpush ( ' test ' , ' test2 ' , 1 ) ; <nl> $ s = microtime ( true ) - $ s ; <nl> go ( function ( ) { <nl> assert ( ! $ ret ) ; <nl> <nl> / / read ok ( after internal auto connect ) <nl> - $ redis - > setOption ( SWOOLE_REDIS_OPT_READ_TIMEOUT , 1 ) ; <nl> + $ redis - > setOptions ( [ ' timeout ' = > 1 ] ) ; <nl> $ ret = $ redis - > set ( ' foo ' , ' bar ' ) ; <nl> assert ( $ ret ) ; <nl> assert ( $ redis - > errCode = = = 0 ) ; <nl> go ( function ( ) { <nl> assert ( ! $ redis - > connected ) ; <nl> <nl> / / connect timeout <nl> - $ redis - > setOption ( SWOOLE_REDIS_OPT_CONNECT_TIMEOUT , 0 . 001 ) ; <nl> + $ redis - > setOptions ( [ ' connect_timeout ' = > 0 . 001 ] ) ; <nl> $ redis - > connect ( ' www . google . com ' , 80 ) ; <nl> assert ( $ redis - > errCode = = = SOCKET_ETIMEDOUT ) ; <nl> } ) ; <nl>
Make setOptions API become swoole style .
swoole/swoole-src
ff5f941abe43c63cb4142fa257548ff7faaa9df9
2018-12-10T03:42:58Z
mmm a / lib / libdvd / libdvdcss / src / libdvdcss . c <nl> ppp b / lib / libdvd / libdvdcss / src / libdvdcss . c <nl> LIBDVDCSS_EXPORT dvdcss_t dvdcss_open ( char * psz_target ) <nl> <nl> sprintf ( psz_debug , " using CSS key cache dir : % s " , <nl> dvdcss - > psz_cachefile ) ; <nl> - print_debug ( dvdcss , psz_debug ) ; <nl> + print_debug ( dvdcss , " % s " , psz_debug ) ; <nl> } <nl> nocache : <nl> <nl>
Fix format string which causes compilation error when - - enable - dvdcss is set on Ubuntu
xbmc/xbmc
54d67df53d7ee8784c19de78cd16c5ee2b38f1a7
2013-01-27T09:54:04Z
mmm a / third_party / fbgemm <nl> ppp b / third_party / fbgemm <nl> @ @ - 1 + 1 @ @ <nl> - Subproject commit 7acd9b86d2f5842ba97d6813f3119bcea0e50e83 <nl> + Subproject commit 8fee33907fde9e5e2a90f73a785177c5a0f06c95 <nl>
Updating submodules
pytorch/pytorch
f362ae1f72525138b0b5e6240fc480f72148712f
2019-11-08T20:54:41Z
mmm a / CMakeLists . txt <nl> ppp b / CMakeLists . txt <nl> endif ( ) <nl> # declares the swift - stdlib - * set of targets . These targets will then <nl> # implicitly depend on any targets declared with IS_STDLIB . <nl> # <nl> + # One such library that declares IS_STDLIB is SwiftSyntax , living in <nl> + # tools / SwiftSyntax . If we include stdlib / after tools / , <nl> + # the swift - stdlib - * set of targets will not have been generated yet , <nl> + # causing the implicit dependency for SwiftSyntax to silently not be <nl> + # created . This then will cause SwiftSyntax to fail to build . <nl> + # <nl> # https : / / bugs . swift . org / browse / SR - 5975 <nl> if ( SWIFT_BUILD_STDLIB ) <nl> add_subdirectory ( stdlib ) <nl> add_subdirectory ( include ) <nl> <nl> if ( SWIFT_INCLUDE_TOOLS ) <nl> add_subdirectory ( lib ) <nl> - <nl> + <nl> # Always include this after including stdlib / ! <nl> # Refer to the large comment above the add_subdirectory ( stdlib ) call . <nl> # https : / / bugs . swift . org / browse / SR - 5975 <nl> mmm a / benchmark / scripts / test_Benchmark_Driver . py <nl> ppp b / benchmark / scripts / test_Benchmark_Driver . py <nl> <nl> import os <nl> import time <nl> import unittest <nl> + <nl> from StringIO import StringIO <nl> from imp import load_source <nl> <nl> mmm a / benchmark / scripts / test_utils . py <nl> ppp b / benchmark / scripts / test_utils . py <nl> <nl> <nl> import logging <nl> import sys <nl> + <nl> from StringIO import StringIO <nl> from contextlib import contextmanager <nl> <nl> mmm a / lib / ClangImporter / ClangImporter . cpp <nl> ppp b / lib / ClangImporter / ClangImporter . cpp <nl> EffectiveClangContext ClangImporter : : Implementation : : getEffectiveClangContext ( <nl> / / / FIXME : Other type declarations should also be okay ? <nl> } <nl> } <nl> + <nl> + / / For source compatibility reasons , fall back to the Swift name . <nl> + / / <nl> + / / This is how people worked around not being able to import - as - member onto <nl> + / / Swift types by their ObjC name before the above code to handle ObjCAttr <nl> + / / was added . <nl> + if ( name ! = nominal - > getName ( ) ) <nl> + clangName = exportName ( nominal - > getName ( ) ) ; <nl> + <nl> + lookupResult . clear ( ) ; <nl> + lookupResult . setLookupName ( clangName ) ; <nl> + / / FIXME : This loop is duplicated from above , but doesn ' t obviously factor <nl> + / / out in a nice way . <nl> + if ( sema . LookupName ( lookupResult , / * Scope = * / nullptr ) ) { <nl> + / / FIXME : Filter based on access path ? C + + access control ? <nl> + for ( auto clangDecl : lookupResult ) { <nl> + if ( auto objcClass = dyn_cast < clang : : ObjCInterfaceDecl > ( clangDecl ) ) <nl> + return EffectiveClangContext ( objcClass ) ; <nl> + <nl> + / / / FIXME : Other type declarations should also be okay ? <nl> + } <nl> + } <nl> } <nl> <nl> return EffectiveClangContext ( ) ; <nl> mmm a / lib / ClangImporter / ImportDecl . cpp <nl> ppp b / lib / ClangImporter / ImportDecl . cpp <nl> namespace { <nl> const auto & languageVersion = <nl> Impl . SwiftContext . LangOpts . EffectiveLanguageVersion ; <nl> <nl> - auto isMatch = [ & ] ( const T * singleResult , bool baseNameMatches ) - > bool { <nl> + auto isMatch = [ & ] ( const T * singleResult , bool baseNameMatches , <nl> + bool allowObjCMismatch ) - > bool { <nl> const DeclAttributes & attrs = singleResult - > getAttrs ( ) ; <nl> <nl> / / Skip versioned variants . <nl> if ( attrs . isUnavailableInSwiftVersion ( languageVersion ) ) <nl> return false ; <nl> <nl> - / / Skip if type not exposed to Objective - C . <nl> - / / If the base name doesn ' t match , then a matching <nl> - / / custom name in an @ objc attribute is required . <nl> - if ( baseNameMatches & & ! singleResult - > isObjC ( ) ) <nl> - return false ; <nl> - <nl> - / / If Clang decl has a custom Swift name , then we know that <nl> - / / ` name ` is the base name we ' re looking for . <nl> - if ( hasKnownSwiftName ) <nl> - return baseNameMatches ; <nl> + / / If Clang decl has a custom Swift name , then we know that the name we <nl> + / / did direct lookup for is correct . <nl> + / / ' allowObjCMismatch ' shouldn ' t exist , but we need it for source <nl> + / / compatibility where a previous version of the compiler didn ' t check <nl> + / / @ objc - ness at all . <nl> + if ( hasKnownSwiftName | | allowObjCMismatch ) { <nl> + assert ( baseNameMatches ) ; <nl> + return allowObjCMismatch | | singleResult - > isObjC ( ) ; <nl> + } <nl> <nl> / / Skip if a different name is used for Objective - C . <nl> if ( auto objcAttr = attrs . getAttribute < ObjCAttr > ( ) ) <nl> if ( auto objcName = objcAttr - > getName ( ) ) <nl> return objcName - > getSimpleName ( ) = = name ; <nl> <nl> - return baseNameMatches ; <nl> + return baseNameMatches & & singleResult - > isObjC ( ) ; <nl> } ; <nl> <nl> / / First look at Swift types with the same name . <nl> - SmallVector < ValueDecl * , 4 > results ; <nl> - overlay - > lookupValue ( name , NLKind : : QualifiedLookup , results ) ; <nl> + SmallVector < ValueDecl * , 4 > swiftDeclsByName ; <nl> + overlay - > lookupValue ( name , NLKind : : QualifiedLookup , swiftDeclsByName ) ; <nl> T * found = nullptr ; <nl> - for ( auto result : results ) { <nl> + for ( auto result : swiftDeclsByName ) { <nl> if ( auto singleResult = dyn_cast < T > ( result ) ) { <nl> - if ( isMatch ( singleResult , / * baseNameMatches = * / true ) ) { <nl> + if ( isMatch ( singleResult , / * baseNameMatches = * / true , <nl> + / * allowObjCMismatch = * / false ) ) { <nl> if ( found ) <nl> return nullptr ; <nl> found = singleResult ; <nl> namespace { <nl> } <nl> } <nl> <nl> - if ( ! found & & ! hasKnownSwiftName ) { <nl> + if ( ! found & & hasKnownSwiftName ) <nl> + return nullptr ; <nl> + <nl> + if ( ! found ) { <nl> / / Try harder to find a match looking at just custom Objective - C names . <nl> - SmallVector < Decl * , 64 > results ; <nl> - overlay - > getTopLevelDecls ( results ) ; <nl> - for ( auto result : results ) { <nl> + SmallVector < Decl * , 64 > allTopLevelDecls ; <nl> + overlay - > getTopLevelDecls ( allTopLevelDecls ) ; <nl> + for ( auto result : allTopLevelDecls ) { <nl> if ( auto singleResult = dyn_cast < T > ( result ) ) { <nl> / / The base name _could_ match but it ' s irrelevant here . <nl> - if ( isMatch ( singleResult , / * baseNameMatches = * / false ) ) { <nl> + if ( isMatch ( singleResult , / * baseNameMatches = * / false , <nl> + / * allowObjCMismatch = * / false ) ) { <nl> + if ( found ) <nl> + return nullptr ; <nl> + found = singleResult ; <nl> + } <nl> + } <nl> + } <nl> + } <nl> + <nl> + if ( ! found ) { <nl> + / / Go back to the first list and find classes with matching Swift names <nl> + / / * even if the ObjC name doesn ' t match . * <nl> + / / This shouldn ' t be allowed but we need it for source compatibility ; <nl> + / / people used ` @ class SwiftNameOfClass ` as a workaround for not <nl> + / / having the previous loop , and it " worked " . <nl> + for ( auto result : swiftDeclsByName ) { <nl> + if ( auto singleResult = dyn_cast < T > ( result ) ) { <nl> + if ( isMatch ( singleResult , / * baseNameMatches = * / true , <nl> + / * allowObjCMismatch = * / true ) ) { <nl> if ( found ) <nl> return nullptr ; <nl> found = singleResult ; <nl> mmm a / test / ClangImporter / MixedSource / Inputs / import - as - member - swift . h <nl> ppp b / test / ClangImporter / MixedSource / Inputs / import - as - member - swift . h <nl> <nl> @ class Outer ; <nl> - <nl> - struct Nested { <nl> - int value ; <nl> + struct NestedInOuter { <nl> + int a ; <nl> } __attribute ( ( swift_name ( " Outer . Nested " ) ) ) ; <nl> + <nl> + @ class OuterByObjCName_ObjC ; <nl> + struct NestedInOuterByObjCName { <nl> + int b ; <nl> + } __attribute ( ( swift_name ( " OuterByObjCName_ObjC . Nested " ) ) ) ; <nl> + <nl> + @ class OuterBySwiftName_Swift ; <nl> + struct NestedInOuterBySwiftName { <nl> + int c ; <nl> + } __attribute ( ( swift_name ( " OuterBySwiftName_Swift . Nested " ) ) ) ; <nl> mmm a / test / ClangImporter / MixedSource / Inputs / mixed - framework / Mixed . framework / Headers / Mixed . h <nl> ppp b / test / ClangImporter / MixedSource / Inputs / mixed - framework / Mixed . framework / Headers / Mixed . h <nl> void consumeObjCForwardNativeTypeHasDifferentCustomNameClass ( ObjCForwardNativeTy <nl> @ class ForwardNativeTypeIsNonObjCClass ; <nl> void consumeForwardNativeTypeIsNonObjCClass ( ForwardNativeTypeIsNonObjCClass * _Nonnull obj ) ; <nl> <nl> + @ class ForwardNativeTypeIsUnambiguouslyNonObjCClass ; <nl> + void consumeForwardNativeTypeIsUnambiguouslyNonObjCClass ( ForwardNativeTypeIsUnambiguouslyNonObjCClass * _Nonnull obj ) ; <nl> + <nl> SWIFT_CLASS ( " BOGUS " ) <nl> @ interface BogusClass <nl> @ end <nl> mmm a / test / ClangImporter / MixedSource / Inputs / mixed - framework / Mixed . swift <nl> ppp b / test / ClangImporter / MixedSource / Inputs / mixed - framework / Mixed . swift <nl> public class ForwardNativeTypeIsNonObjCClass { <nl> public class SwiftForwardNativeTypeIsNonObjCClass { <nl> public init ( ) { } <nl> } <nl> + <nl> + public class ForwardNativeTypeIsUnambiguouslyNonObjCClass { <nl> + public init ( ) { } <nl> + } <nl> mmm a / test / ClangImporter / MixedSource / import - as - member - swift . swift <nl> ppp b / test / ClangImporter / MixedSource / import - as - member - swift . swift <nl> <nl> <nl> @ objc internal class Outer { } <nl> <nl> - _ = Outer . Nested ( ) <nl> + @ objc ( OuterByObjCName_ObjC ) <nl> + internal class OuterByObjCName_Swift { } <nl> + <nl> + @ objc ( OuterBySwiftName_ObjC ) <nl> + internal class OuterBySwiftName_Swift { } <nl> + <nl> + _ = Outer . Nested ( a : 1 ) <nl> + _ = OuterByObjCName_Swift . Nested ( b : 2 ) <nl> + _ = OuterBySwiftName_Swift . Nested ( c : 3 ) <nl> mmm a / test / ClangImporter / MixedSource / import - mixed - framework . swift <nl> ppp b / test / ClangImporter / MixedSource / import - mixed - framework . swift <nl> consumeObjCForwardNativeTypeHasDifferentCustomNameClass ( SwiftForwardNativeTypeHa <nl> <nl> consumeForwardNativeTypeIsNonObjCClass ( SwiftForwardNativeTypeIsNonObjCClass ( ) ) <nl> consumeForwardNativeTypeIsNonObjCClass ( ForwardNativeTypeIsNonObjCClass ( ) ) / / expected - error { { cannot convert value of type ' ForwardNativeTypeIsNonObjCClass ' to expected argument type ' SwiftForwardNativeTypeIsNonObjCClass ' } } <nl> + <nl> + consumeForwardNativeTypeIsUnambiguouslyNonObjCClass ( ForwardNativeTypeIsUnambiguouslyNonObjCClass ( ) ) <nl> mmm a / utils / build - script <nl> ppp b / utils / build - script <nl> class BuildScriptInvocation ( object ) : <nl> " - - libicu - build - type " , args . libicu_build_variant , <nl> " - - xctest - build - type " , args . build_variant , <nl> " - - swiftpm - build - type " , args . build_variant , <nl> + " - - swiftsyntax - build - type " , args . build_variant , <nl> " - - llbuild - build - type " , args . build_variant , <nl> " - - swift - enable - assertions " , str ( args . swift_assertions ) . lower ( ) , <nl> " - - swift - stdlib - enable - assertions " , str ( <nl> class BuildScriptInvocation ( object ) : <nl> impl_args + = [ " - - skip - build - libicu " ] <nl> if not args . build_swiftpm : <nl> impl_args + = [ " - - skip - build - swiftpm " ] <nl> + if not args . build_swiftsyntax : <nl> + impl_args + = [ " - - skip - build - swiftsyntax " ] <nl> if not args . build_playgroundsupport : <nl> impl_args + = [ " - - skip - build - playgroundsupport " ] <nl> if args . build_swift_dynamic_stdlib : <nl> class BuildScriptInvocation ( object ) : <nl> " - - skip - test - lldb " , <nl> " - - skip - test - llbuild " , <nl> " - - skip - test - swiftpm " , <nl> + " - - skip - test - swiftsyntax " , <nl> " - - skip - test - xctest " , <nl> " - - skip - test - foundation " , <nl> " - - skip - test - libdispatch " , <nl> class BuildScriptInvocation ( object ) : <nl> build_dir = self . workspace . build_dir ( <nl> host_target , product_name ) ) <nl> if product . should_build ( host_target ) : <nl> - print ( " mmm Building % s mmm " % product_name ) <nl> product . build ( host_target ) <nl> if product . should_test ( host_target ) : <nl> - print ( " mmm Running tests for % s mmm " % product_name ) <nl> product . test ( host_target ) <nl> - print ( " mmm Finished tests for % s mmm " % product_name ) <nl> if product . should_install ( host_target ) : <nl> - print ( " mmm Installing % s mmm " % product_name ) <nl> product . install ( host_target ) <nl> <nl> # Extract symbols . . . <nl> mmm a / utils / build - script - impl <nl> ppp b / utils / build - script - impl <nl> KNOWN_SETTINGS = ( <nl> playgroundsupport - build - type " Debug " " the build variant for PlaygroundSupport " <nl> xctest - build - type " Debug " " the build variant for xctest " <nl> swiftpm - build - type " Debug " " the build variant for swiftpm " <nl> + swiftsyntax - build - type " Debug " " the build variant for swiftSyntax " <nl> + # When this flag is set , the build - script will only build / install the swift - syntax parser <nl> + # This is a temporary workaround of having a separate build product for swift - syntax parser <nl> + skip - swiftsyntax - swiftside " " " skip building / installing the swift side of swiftsyntax " <nl> llbuild - enable - assertions " 1 " " enable assertions in llbuild " <nl> enable - asan " " " enable Address Sanitizer " <nl> enable - ubsan " " " enable Undefined Behavior Sanitizer " <nl> KNOWN_SETTINGS = ( <nl> installable - package " " " the path to the archive of the installation directory " <nl> test - installable - package " " " whether to run post - packaging tests on the produced package " <nl> reconfigure " " " force a CMake configuration run even if CMakeCache . txt already exists " <nl> + build - libparser - only " " " only build libSwiftSyntaxParser " <nl> + libparser - ver " " " current version of libSwiftSyntaxParser " <nl> skip - reconfigure " " " set to skip reconfigure " <nl> swift - primary - variant - sdk " " " default SDK for target binaries " <nl> swift - primary - variant - arch " " " default arch for target binaries " <nl> KNOWN_SETTINGS = ( <nl> skip - build - llbuild " " " set to skip building llbuild " <nl> skip - build - libcxx " " " set to skip building libcxx " <nl> skip - build - swiftpm " " " set to skip building swiftpm " <nl> + skip - build - swiftsyntax " " " set to skip building swiftSyntax " <nl> skip - build - xctest " " " set to skip building xctest " <nl> skip - build - foundation " " " set to skip building foundation " <nl> skip - build - libdispatch " " " set to skip building libdispatch " <nl> KNOWN_SETTINGS = ( <nl> skip - test - swift " " " set to skip testing Swift " <nl> skip - test - llbuild " " " set to skip testing llbuild " <nl> skip - test - swiftpm " " " set to skip testing swiftpm " <nl> + skip - test - swiftsyntax " " " set to skip testing swiftSyntax " <nl> skip - test - xctest " " " set to skip testing xctest " <nl> skip - test - foundation " " " set to skip testing foundation " <nl> skip - test - libdispatch " " " set to skip testing libdispatch " <nl> KNOWN_SETTINGS = ( <nl> install - lldb " " " whether to install LLDB " <nl> install - llbuild " " " whether to install llbuild " <nl> install - swiftpm " " " whether to install swiftpm " <nl> + install - swiftsyntax " " " whether to install swiftsyntax " <nl> + skip - install - swiftsyntax - module " " " set to skip installing swiftsyntax modules " <nl> + swiftsyntax - verify - generated - files " " " set to verify that the generated files in the source tree match the ones that would be generated from current master " <nl> install - xctest " " " whether to install xctest " <nl> install - foundation " " " whether to install foundation " <nl> install - libcxx " " " whether to install libc + + " <nl> CMARK_SOURCE_DIR = " $ { WORKSPACE } / cmark " <nl> LLDB_SOURCE_DIR = " $ { WORKSPACE } / lldb " <nl> LLBUILD_SOURCE_DIR = " $ { WORKSPACE } / llbuild " <nl> SWIFTPM_SOURCE_DIR = " $ { WORKSPACE } / swiftpm " <nl> + SWIFTSYNTAX_SOURCE_DIR = " $ { WORKSPACE } / swift - syntax " <nl> STRESSTEST_PACKAGE_DIR = " $ { WORKSPACE } / swift - stress - tester " <nl> XCTEST_SOURCE_DIR = " $ { WORKSPACE } / swift - corelibs - xctest " <nl> FOUNDATION_SOURCE_DIR = " $ { WORKSPACE } / swift - corelibs - foundation " <nl> PRODUCTS = ( " $ { PRODUCTS [ @ ] } " swift ) <nl> if [ [ ! " $ { SKIP_BUILD_LLDB } " ] ] ; then <nl> PRODUCTS = ( " $ { PRODUCTS [ @ ] } " lldb ) <nl> fi <nl> - # LLBuild , SwiftPM and XCTest are dependent on Foundation , so Foundation must <nl> - # be added to the list of build products first . <nl> + # LLBuild , SwiftPM , SwiftSyntax and XCTest are dependent on Foundation , so <nl> + # Foundation must be added to the list of build products first . <nl> if [ [ ! " $ { SKIP_BUILD_LIBDISPATCH } " ] ] ; then <nl> PRODUCTS = ( " $ { PRODUCTS [ @ ] } " libdispatch ) <nl> if [ [ - z " $ { SKIP_BUILD_SWIFT_STATIC_LIBDISPATCH } " ] ] ; then <nl> fi <nl> if [ [ ! " $ { SKIP_BUILD_PLAYGROUNDSUPPORT } " ] ] ; then <nl> PRODUCTS = ( " $ { PRODUCTS [ @ ] } " playgroundsupport ) <nl> fi <nl> - # SwiftPM is dependent on XCTest , so XCTest must be added to the list of build <nl> - # products first . <nl> + # SwiftPM and SwiftSyntax are dependent on XCTest , so XCTest must be added to <nl> + # the list of build products first . <nl> if [ [ ! " $ { SKIP_BUILD_XCTEST } " ] ] ; then <nl> PRODUCTS = ( " $ { PRODUCTS [ @ ] } " xctest ) <nl> fi <nl> + # SwiftSyntax is dependent on SwiftPM , so SwiftPM must be added to the list of <nl> + # build products first . <nl> if [ [ ! " $ { SKIP_BUILD_SWIFTPM } " ] ] ; then <nl> PRODUCTS = ( " $ { PRODUCTS [ @ ] } " swiftpm ) <nl> fi <nl> + if [ [ ! " $ { SKIP_BUILD_SWIFTSYNTAX } " ] ] ; then <nl> + PRODUCTS = ( " $ { PRODUCTS [ @ ] } " swiftsyntax ) <nl> + fi <nl> <nl> # Checks if a given product is enabled ( i . e . part of $ PRODUCTS array ) <nl> function contains_product ( ) { <nl> function build_directory_bin ( ) { <nl> swiftpm ) <nl> echo " $ { root } / $ { SWIFTPM_BUILD_TYPE } / bin " <nl> ; ; <nl> + swiftsyntax ) <nl> + echo " $ { root } / $ { SWIFTSYNTAX_BUILD_TYPE } / bin " <nl> + ; ; <nl> xctest ) <nl> echo " $ { root } / $ { XCTEST_BUILD_TYPE } / bin " <nl> ; ; <nl> function cmake_config_opt ( ) { <nl> swiftpm ) <nl> echo " - - config $ { SWIFTPM_BUILD_TYPE } " <nl> ; ; <nl> + swiftsyntax ) <nl> + echo " - - config $ { SWIFTSYNTAX_BUILD_TYPE } " <nl> + ; ; <nl> xctest ) <nl> echo " - - config $ { XCTEST_BUILD_TYPE } " <nl> ; ; <nl> function set_swiftpm_bootstrap_command ( ) { <nl> <nl> function swiftpm_find_tool ( ) { <nl> tool = $ 1 <nl> - if [ [ " $ { SKIP_BUILD_SWIFTPM } " ] ] ; then <nl> + if [ [ " $ { SKIP_BUILD_SWIFTPM } " | | " $ { BUILD_LIBPARSER_ONLY } " ] ] ; then <nl> echo " $ ( xcrun_find_tool $ { tool } ) " <nl> else <nl> echo " $ ( build_directory_bin $ { LOCAL_HOST } swiftpm ) / $ { tool } " <nl> fi <nl> } <nl> <nl> + function set_swiftsyntax_build_command ( ) { <nl> + if [ " $ { BUILD_LIBPARSER_ONLY } " ] ; then <nl> + # we don ' t have a compiler built so we have to use the one in the environment . <nl> + SWIFTC_BIN = " $ ( xcrun_find_tool swiftc ) " <nl> + else <nl> + SWIFTC_BIN = " $ ( build_directory_bin $ { LOCAL_HOST } swift ) / swiftc " <nl> + fi <nl> + <nl> + swiftsyntax_build_command = ( " $ { SWIFTSYNTAX_SOURCE_DIR } / build - script . py " ) <nl> + # Add - - release if we have to build in release mode . <nl> + if [ [ $ ( is_cmake_release_build_type " $ { SWIFTSYNTAX_BUILD_TYPE } " ) ] ] ; then <nl> + swiftsyntax_build_command + = ( - - release ) <nl> + fi <nl> + if [ [ " $ { VERBOSE_BUILD } " ] ] ; then <nl> + swiftsyntax_build_command + = ( - v ) <nl> + fi <nl> + swiftsyntax_build_command + = ( <nl> + - - build - dir = " $ ( build_directory $ { host } swiftsyntax ) " <nl> + - - swift - build - exec = " $ ( swiftpm_find_tool swift - build ) " <nl> + - - swift - test - exec = " $ ( swiftpm_find_tool swift - test ) " <nl> + - - swiftc - exec = " $ { SWIFTC_BIN } " <nl> + - - syntax - parser - header - dir = " $ { SWIFT_SOURCE_DIR } / include / swift - c / SyntaxParser " <nl> + - - syntax - parser - lib - dir = " $ ( build_directory $ { host } swift ) / lib " <nl> + - - swift - syntax - test - exec = " $ ( build_directory_bin $ { LOCAL_HOST } swift ) / swift - syntax - test " <nl> + - - filecheck - exec = " $ ( build_directory_bin $ { LOCAL_HOST } llvm ) / FileCheck " ) <nl> + if [ [ " $ { SWIFTSYNTAX_VERIFY_GENERATED_FILES } " ] ] ; then <nl> + swiftsyntax_build_command + = ( - - verify - generated - files ) <nl> + fi <nl> + } <nl> + <nl> # <nl> # Configure and build each product <nl> # <nl> for host in " $ { ALL_HOSTS [ @ ] } " ; do <nl> build_targets = ( " $ { build_targets [ @ ] } " <nl> " $ { SWIFT_BENCHMARK_TARGETS [ @ ] } " ) <nl> fi <nl> + if [ " $ { BUILD_LIBPARSER_ONLY } " ] ; then <nl> + build_targets = ( libSwiftSyntaxParser ) <nl> + if [ " $ { LIBPARSER_VER } " ] ; then <nl> + cmake_options = ( <nl> + " $ { cmake_options [ @ ] } " <nl> + - DSWIFT_LIBPARSER_VER : STRING = " $ { LIBPARSER_VER } " <nl> + ) <nl> + fi <nl> + fi <nl> skip_build = $ { SKIP_BUILD_SWIFT } <nl> ; ; <nl> lldb ) <nl> for host in " $ { ALL_HOSTS [ @ ] } " ; do <nl> call " $ { swiftpm_bootstrap_command [ @ ] } " <nl> <nl> # swiftpm installs itself with a bootstrap method . No further cmake building is performed . <nl> + continue <nl> + ; ; <nl> + swiftsyntax ) <nl> + if [ [ " $ { SKIP_SWIFTSYNTAX_SWIFTSIDE } " ] ] ; then <nl> + continue <nl> + fi <nl> + set_swiftsyntax_build_command <nl> + call " $ { swiftsyntax_build_command [ @ ] } " <nl> + <nl> continue <nl> ; ; <nl> xctest ) <nl> for host in " $ { ALL_HOSTS [ @ ] } " ; do <nl> # As swiftpm tests itself , we break early here . <nl> continue <nl> ; ; <nl> + swiftsyntax ) <nl> + if [ [ " $ { SKIP_TEST_SWIFTSYNTAX } " ] ] ; then <nl> + continue <nl> + fi <nl> + echo " mmm Running tests for $ { product } mmm " <nl> + set_swiftsyntax_build_command <nl> + call " $ { swiftsyntax_build_command [ @ ] } " - t <nl> + # As swiftSyntax tests itself , we break early here . <nl> + continue <nl> + ; ; <nl> xctest ) <nl> if [ [ " $ { SKIP_TEST_XCTEST } " ] ] ; then <nl> continue <nl> for host in " $ { ALL_HOSTS [ @ ] } " ; do <nl> continue <nl> fi <nl> INSTALL_TARGETS = install - swift - components <nl> + # Swift syntax parser is currently a sub - product of Swift ; <nl> + # We need to specify the install target separately here . <nl> + if [ " $ { BUILD_LIBPARSER_ONLY } " ] ; then <nl> + INSTALL_TARGETS = tools / libSwiftSyntaxParser / install <nl> + fi <nl> ; ; <nl> llbuild ) <nl> if [ [ - z " $ { INSTALL_LLBUILD } " ] ] ; then <nl> for host in " $ { ALL_HOSTS [ @ ] } " ; do <nl> set_swiftpm_bootstrap_command <nl> call " $ { swiftpm_bootstrap_command [ @ ] } " - - prefix = " $ { host_install_destdir } $ { host_install_prefix } " install <nl> # As swiftpm bootstraps the installation itself , we break early here . <nl> + continue <nl> + ; ; <nl> + swiftsyntax ) <nl> + if [ [ - z " $ { INSTALL_SWIFTSYNTAX } " ] ] ; then <nl> + continue <nl> + fi <nl> + if [ [ - z " $ { INSTALL_DESTDIR } " ] ] ; then <nl> + echo " - - install - destdir is required to install products . " <nl> + exit 1 <nl> + fi <nl> + echo " mmm Installing $ { product } mmm " <nl> + if [ " $ { BUILD_LIBPARSER_ONLY } " ] ; then <nl> + # We don ' t have a toolchain so we should install to the specified dir <nl> + DYLIB_DIR = " $ { INSTALL_DESTDIR } " <nl> + MODULE_DIR = " $ { INSTALL_DESTDIR } / $ { product } . swiftmodule " <nl> + # Create the install dir if it doesn ' t exist <nl> + call mkdir - p " $ { INSTALL_DESTDIR } " <nl> + # Install libParser is necessary <nl> + rsync - a " $ ( build_directory $ { host } swift ) / lib / lib_InternalSwiftSyntaxParser . dylib " " $ { INSTALL_DESTDIR } " <nl> + # Install module map of libParser so client can import SwiftSyntax <nl> + rsync - a " $ { SWIFT_SOURCE_DIR } / include / swift - c / SyntaxParser " " $ { INSTALL_DESTDIR } " <nl> + else <nl> + # We have a toolchain so install to the toolchain <nl> + DYLIB_DIR = " $ { host_install_destdir } $ { host_install_prefix } / lib / swift / $ { SWIFT_HOST_VARIANT } " <nl> + MODULE_DIR = " $ { DYLIB_DIR } / $ { product } . swiftmodule " <nl> + fi <nl> + if [ [ " $ { SKIP_SWIFTSYNTAX_SWIFTSIDE } " ] ] ; then <nl> + continue <nl> + fi <nl> + set_swiftsyntax_build_command <nl> + if [ [ - z " $ { SKIP_INSTALL_SWIFTSYNTAX_MODULE } " ] ] ; then <nl> + mkdir - p " $ { MODULE_DIR } " <nl> + call " $ { swiftsyntax_build_command [ @ ] } " - - dylib - dir = " $ { DYLIB_DIR } " - - swiftmodule - base - name " $ { MODULE_DIR } / $ { SWIFT_HOST_VARIANT_ARCH } " - - install <nl> + else <nl> + call " $ { swiftsyntax_build_command [ @ ] } " - - dylib - dir = " $ { DYLIB_DIR } " - - install <nl> + fi <nl> + <nl> continue <nl> ; ; <nl> xctest ) <nl> mmm a / utils / build_swift / driver_arguments . py <nl> ppp b / utils / build_swift / driver_arguments . py <nl> def _apply_default_arguments ( args ) : <nl> args . test_tvos = False <nl> args . test_watchos = False <nl> args . test_android = False <nl> - args . test_swiftsyntax = False <nl> args . test_indexstoredb = False <nl> args . test_sourcekitlsp = False <nl> args . test_skstresstester = False <nl> def create_argument_parser ( ) : <nl> help = ' build IndexStoreDB ' ) <nl> option ( [ ' - - sourcekit - lsp ' ] , toggle_true ( ' build_sourcekitlsp ' ) , <nl> help = ' build SourceKitLSP ' ) <nl> - option ( ' - - install - swiftsyntax ' , toggle_true ( ' install_swiftsyntax ' ) , <nl> - help = ' install SwiftSyntax ' ) <nl> - option ( ' - - skip - install - swiftsyntax - module ' , <nl> - toggle_true ( ' skip_install_swiftsyntax_module ' ) , <nl> - help = ' skip installing the SwiftSyntax modules ' ) <nl> - option ( ' - - swiftsyntax - verify - generated - files ' , <nl> - toggle_true ( ' swiftsyntax_verify_generated_files ' ) , <nl> - help = ' set to verify that the generated files in the source tree ' <nl> - ' match the ones that would be generated from current master ' ) <nl> option ( [ ' - - install - sourcekit - lsp ' ] , toggle_true ( ' install_sourcekitlsp ' ) , <nl> help = ' install SourceKitLSP ' ) <nl> option ( [ ' - - install - skstresstester ' ] , toggle_true ( ' install_skstresstester ' ) , <nl> def create_argument_parser ( ) : <nl> help = ' skip testing Android device targets on the host machine ( the ' <nl> ' phone itself ) ' ) <nl> <nl> - option ( ' - - skip - test - swiftsyntax ' , toggle_false ( ' test_swiftsyntax ' ) , <nl> - help = ' skip testing SwiftSyntax ' ) <nl> option ( ' - - skip - test - indexstore - db ' , toggle_false ( ' test_indexstoredb ' ) , <nl> help = ' skip testing indexstore - db ' ) <nl> option ( ' - - skip - test - sourcekit - lsp ' , toggle_false ( ' test_sourcekitlsp ' ) , <nl> mmm a / utils / build_swift / tests / expected_options . py <nl> ppp b / utils / build_swift / tests / expected_options . py <nl> <nl> ' build_swiftevolve ' : False , <nl> ' build_indexstoredb ' : False , <nl> ' build_sourcekitlsp ' : False , <nl> - ' install_swiftsyntax ' : False , <nl> - ' skip_install_swiftsyntax_module ' : False , <nl> - ' swiftsyntax_verify_generated_files ' : False , <nl> ' install_sourcekitlsp ' : False , <nl> ' install_skstresstester ' : False , <nl> ' install_swiftevolve ' : False , <nl> <nl> ' test_watchos ' : False , <nl> ' test_watchos_host ' : False , <nl> ' test_watchos_simulator ' : False , <nl> - ' test_swiftsyntax ' : False , <nl> ' test_indexstoredb ' : False , <nl> ' test_sourcekitlsp ' : False , <nl> ' test_skstresstester ' : False , <nl> class BuildScriptImplOption ( _BaseOption ) : <nl> EnableOption ( ' - - libicu ' , dest = ' build_libicu ' ) , <nl> EnableOption ( ' - - indexstore - db ' , dest = ' build_indexstoredb ' ) , <nl> EnableOption ( ' - - sourcekit - lsp ' , dest = ' build_sourcekitlsp ' ) , <nl> - EnableOption ( ' - - install - swiftsyntax ' , dest = ' install_swiftsyntax ' ) , <nl> - EnableOption ( ' - - skip - install - swiftsyntax - module ' , <nl> - dest = ' skip_install_swiftsyntax_module ' ) , <nl> - EnableOption ( ' - - swiftsyntax - verify - generated - files ' , <nl> - dest = ' swiftsyntax_verify_generated_files ' ) , <nl> EnableOption ( ' - - install - sourcekit - lsp ' , dest = ' install_sourcekitlsp ' ) , <nl> EnableOption ( ' - - install - skstresstester ' , dest = ' install_skstresstester ' ) , <nl> EnableOption ( ' - - install - swiftevolve ' , dest = ' install_swiftevolve ' ) , <nl> class BuildScriptImplOption ( _BaseOption ) : <nl> DisableOption ( ' - - skip - test - watchos - host ' , dest = ' test_watchos_host ' ) , <nl> DisableOption ( ' - - skip - test - watchos - simulator ' , <nl> dest = ' test_watchos_simulator ' ) , <nl> - DisableOption ( ' - - skip - test - swiftsyntax ' , dest = ' test_swiftsyntax ' ) , <nl> DisableOption ( ' - - skip - test - indexstore - db ' , dest = ' test_indexstoredb ' ) , <nl> DisableOption ( ' - - skip - test - sourcekit - lsp ' , dest = ' test_sourcekitlsp ' ) , <nl> DisableOption ( ' - - skip - test - skstresstester ' , dest = ' test_skstresstester ' ) , <nl> mmm a / utils / gyb_syntax_support / Node . py <nl> ppp b / utils / gyb_syntax_support / Node . py <nl> <nl> from __future__ import print_function <nl> import sys # noqa : I201 <nl> - <nl> from kinds import SYNTAX_BASE_KINDS , kind_to_type , lowercase_first_word <nl> <nl> <nl> mmm a / utils / gyb_syntax_support / __init__ . py <nl> ppp b / utils / gyb_syntax_support / __init__ . py <nl> <nl> from DeclNodes import DECL_NODES # noqa : I201 <nl> from ExprNodes import EXPR_NODES # noqa : I201 <nl> from GenericNodes import GENERIC_NODES # noqa : I201 <nl> - <nl> from NodeSerializationCodes import SYNTAX_NODE_SERIALIZATION_CODES , \ <nl> get_serialization_code , \ <nl> verify_syntax_node_serialization_codes <nl> <nl> from PatternNodes import PATTERN_NODES # noqa : I201 <nl> from StmtNodes import STMT_NODES # noqa : I201 <nl> - <nl> import Token <nl> from Trivia import TRIVIAS # noqa : I201 <nl> from TypeNodes import TYPE_NODES # noqa : I201 <nl> mmm a / utils / run - test <nl> ppp b / utils / run - test <nl> from swift_build_support . swift_build_support import ( <nl> arguments , <nl> shell <nl> ) <nl> + <nl> from swift_build_support . swift_build_support . SwiftBuildSupport import \ <nl> SWIFT_SOURCE_ROOT <nl> + <nl> from swift_build_support . swift_build_support . targets import \ <nl> StdlibDeploymentTarget <nl> <nl> mmm a / utils / scale - test <nl> ppp b / utils / scale - test <nl> import shutil <nl> import subprocess <nl> import sys <nl> import tempfile <nl> + <nl> from collections import namedtuple <nl> from operator import attrgetter <nl> <nl> mmm a / utils / swift_build_support / swift_build_support / products / indexstoredb . py <nl> ppp b / utils / swift_build_support / swift_build_support / products / indexstoredb . py <nl> def run_build_script_helper ( action , host_target , product , args ) : <nl> toolchain_path = targets . toolchain_path ( args . install_destdir , <nl> args . install_prefix ) <nl> <nl> - is_release = product . is_release ( ) <nl> - configuration = ' release ' if is_release else ' debug ' <nl> + configuration = ' debug ' if args . build_variant = = ' Debug ' else ' release ' <nl> helper_cmd = [ <nl> script_path , <nl> action , <nl> + ' - - verbose ' , <nl> ' - - package - path ' , product . source_dir , <nl> ' - - build - path ' , product . build_dir , <nl> ' - - configuration ' , configuration , <nl> ' - - toolchain ' , toolchain_path , <nl> ' - - ninja - bin ' , product . toolchain . ninja , <nl> ] <nl> - if args . verbose_build : <nl> - helper_cmd . append ( ' - - verbose ' ) <nl> - <nl> shell . call ( helper_cmd ) <nl> mmm a / utils / swift_build_support / swift_build_support / products / product . py <nl> ppp b / utils / swift_build_support / swift_build_support / products / product . py <nl> <nl> import abc <nl> <nl> from . . import cmake <nl> - from . . import targets <nl> - <nl> - <nl> - def is_release_variant ( build_variant ) : <nl> - return build_variant in [ ' Release ' , ' RelWithDebInfo ' ] <nl> <nl> <nl> class Product ( object ) : <nl> def __init__ ( self , args , toolchain , source_dir , build_dir ) : <nl> self . build_dir = build_dir <nl> self . cmake_options = cmake . CMakeOptions ( ) <nl> <nl> - def is_release ( self ) : <nl> - " " " is_release ( ) - > Bool <nl> - <nl> - Whether or not this target is built as a release variant <nl> - " " " <nl> - return is_release_variant ( self . args . build_variant ) <nl> - <nl> - def install_toolchain_path ( self ) : <nl> - " " " toolchain_path ( ) - > string <nl> - <nl> - Returns the path to the toolchain that is being created as part of this <nl> - build . <nl> - " " " <nl> - return targets . toolchain_path ( self . args . install_destdir , <nl> - self . args . install_prefix ) <nl> - <nl> <nl> class ProductBuilder ( object ) : <nl> " " " <nl> mmm a / utils / swift_build_support / swift_build_support / products / skstresstester . py <nl> ppp b / utils / swift_build_support / swift_build_support / products / skstresstester . py <nl> <nl> <nl> from . import product <nl> from . . import shell <nl> + from . . import targets <nl> <nl> <nl> class SKStressTester ( product . Product ) : <nl> def run_build_script_helper ( self , action , additional_params = [ ] ) : <nl> script_path = os . path . join ( <nl> self . source_dir , ' build - script - helper . py ' ) <nl> <nl> - configuration = ' release ' if self . is_release ( ) else ' debug ' <nl> + toolchain_path = targets . toolchain_path ( self . args . install_destdir , <nl> + self . args . install_prefix ) <nl> + <nl> + configuration = ' debug ' if self . args . build_variant = = ' Debug ' else \ <nl> + ' release ' <nl> <nl> helper_cmd = [ <nl> script_path , <nl> action , <nl> ' - - package - dir ' , self . package_name ( ) , <nl> - ' - - toolchain ' , self . install_toolchain_path ( ) , <nl> + ' - - toolchain ' , toolchain_path , <nl> ' - - config ' , configuration , <nl> ' - - build - dir ' , self . build_dir , <nl> ] <nl> mmm a / utils / swift_build_support / swift_build_support / products / swiftsyntax . py <nl> ppp b / utils / swift_build_support / swift_build_support / products / swiftsyntax . py <nl> <nl> # <nl> # mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> <nl> - import os <nl> - <nl> from . import product <nl> - from . . import shell <nl> - from . . import targets <nl> <nl> <nl> class SwiftSyntax ( product . Product ) : <nl> def product_source_name ( cls ) : <nl> The name of the source code directory of this product . <nl> " " " <nl> return " swift - syntax " <nl> - <nl> - def run_swiftsyntax_build_script ( self , target , additional_params = [ ] ) : <nl> - llvm_build_dir = os . path . join ( self . build_dir , ' . . ' , ' llvm - ' + target ) <nl> - llvm_build_dir = os . path . realpath ( llvm_build_dir ) <nl> - <nl> - script_path = os . path . join ( self . source_dir , ' build - script . py ' ) <nl> - <nl> - build_cmd = [ <nl> - script_path , <nl> - ' - - build - dir ' , self . build_dir , <nl> - ' - - toolchain ' , self . install_toolchain_path ( ) , <nl> - ' - - filecheck - exec ' , os . path . join ( llvm_build_dir , ' bin ' , <nl> - ' FileCheck ' ) , <nl> - ] <nl> - <nl> - if self . is_release ( ) : <nl> - build_cmd . append ( ' - - release ' ) <nl> - <nl> - if self . args . swiftsyntax_verify_generated_files : <nl> - build_cmd . append ( ' - - verify - generated - files ' ) <nl> - <nl> - build_cmd . extend ( additional_params ) <nl> - <nl> - if self . args . verbose_build : <nl> - build_cmd . append ( ' - - verbose ' ) <nl> - <nl> - shell . call ( build_cmd ) <nl> - <nl> - @ classmethod <nl> - def is_build_script_impl_product ( cls ) : <nl> - return False <nl> - <nl> - def should_build ( self , host_target ) : <nl> - return True <nl> - <nl> - def build ( self , host_target ) : <nl> - self . run_swiftsyntax_build_script ( target = host_target ) <nl> - <nl> - def should_test ( self , host_target ) : <nl> - return self . args . test_swiftsyntax <nl> - <nl> - def test ( self , host_target ) : <nl> - self . run_swiftsyntax_build_script ( target = host_target , <nl> - additional_params = [ ' - - test ' ] ) <nl> - <nl> - def should_install ( self , host_target ) : <nl> - return self . args . install_swiftsyntax <nl> - <nl> - def install ( self , target_name ) : <nl> - target = \ <nl> - targets . StdlibDeploymentTarget . get_target_for_name ( target_name ) <nl> - install_prefix = self . args . install_destdir + self . args . install_prefix <nl> - <nl> - dylib_dir = os . path . join ( install_prefix , ' lib ' , ' swift ' , <nl> - target . platform . name ) <nl> - module_dir = os . path . join ( dylib_dir , ' SwiftSyntax . swiftmodule ' ) <nl> - <nl> - additional_params = [ <nl> - ' - - dylib - dir ' , dylib_dir , <nl> - ' - - install ' <nl> - ] <nl> - <nl> - if not self . args . skip_install_swiftsyntax_module : <nl> - if not os . path . exists ( module_dir ) : <nl> - os . makedirs ( module_dir ) <nl> - module_base_name = os . path . join ( module_dir , target . arch ) <nl> - additional_params . extend ( [ <nl> - ' - - swiftmodule - base - name ' , module_base_name <nl> - ] ) <nl> - <nl> - self . run_swiftsyntax_build_script ( target = target_name , <nl> - additional_params = additional_params ) <nl> mmm a / utils / vim / swift - indent . py <nl> ppp b / utils / vim / swift - indent . py <nl> def main ( argc , argv ) : <nl> lines = stdout . decode ( encoding ) . split ( ' \ n ' ) <nl> sequence = difflib . SequenceMatcher ( None , buf , lines ) <nl> for op in reversed ( sequence . get_opcodes ( ) ) : <nl> - if op [ 0 ] ! = ' equal ' : <nl> + if op [ 0 ] is not ' equal ' : <nl> vim . current . buffer [ op [ 1 ] : op [ 2 ] ] = lines [ op [ 3 ] : op [ 4 ] ] <nl> <nl> <nl>
Merge remote - tracking branch ' origin / master ' into master - next
apple/swift
ec9c7e39b36ecc03bd84031c2656c337a8cf94ac
2019-10-29T17:10:11Z
mmm a / tools / cmgen / src / cmgen . cpp <nl> ppp b / tools / cmgen / src / cmgen . cpp <nl> void sphericalHarmonics ( const utils : : Path & iname , const Cubemap & inputCubemap ) { <nl> sh = CubemapSH : : computeSH ( inputCubemap , g_sh_compute , g_sh_irradiance ) ; <nl> } <nl> <nl> - if ( g_sh_output ) { <nl> + if ( ! g_quiet & & g_sh_output ) { <nl> outputSh ( std : : cout , sh , g_sh_compute ) ; <nl> } <nl> <nl>
added quiet flag
google/filament
44bfac85e9b70dc57205269a8aefe44e2758e0a0
2019-01-29T19:04:58Z
mmm a / jstests / free_mon / free_mon_rs_register . js <nl> ppp b / jstests / free_mon / free_mon_rs_register . js <nl> load ( " jstests / free_mon / libs / free_mon . js " ) ; <nl> assert . eq ( isUUID ( last_register . payload . uuid [ ' local . oplog . rs ' ] ) , true ) ; <nl> <nl> / / Restart the secondary <nl> - / / Now we ' re going to shut down all nodes <nl> var s1 = rst . _slaves [ 0 ] ; <nl> var s1Id = rst . getNodeId ( s1 ) ; <nl> <nl> load ( " jstests / free_mon / libs / free_mon . js " ) ; <nl> <nl> mock_web . waitRegisters ( 3 ) ; <nl> <nl> + / / Now disable it <nl> + assert . commandWorked ( rst . getPrimary ( ) . adminCommand ( { setFreeMonitoring : 1 , action : " disable " } ) ) ; <nl> + <nl> + WaitForUnRegistration ( rst . getPrimary ( ) ) ; <nl> + WaitForUnRegistration ( rst . getSecondary ( ) ) ; <nl> + <nl> + assert . eq ( FreeMonGetServerStatus ( rst . getPrimary ( ) ) . state , ' disabled ' ) ; <nl> + assert . eq ( FreeMonGetServerStatus ( rst . getSecondary ( ) ) . state , ' disabled ' ) ; <nl> + <nl> + / / Restart the secondary with it disabled <nl> + var s1 = rst . _slaves [ 0 ] ; <nl> + var s1Id = rst . getNodeId ( s1 ) ; <nl> + <nl> + rst . stop ( s1Id ) ; <nl> + rst . waitForState ( s1 , ReplSetTest . State . DOWN ) ; <nl> + <nl> + rst . restart ( s1Id ) ; <nl> + <nl> + / / Make sure it is disabled <nl> + assert . eq ( FreeMonGetServerStatus ( rst . getPrimary ( ) ) . state , ' disabled ' ) ; <nl> + assert . eq ( FreeMonGetServerStatus ( rst . getSecondary ( ) ) . state , ' disabled ' ) ; <nl> + <nl> rst . stopSet ( ) ; <nl> <nl> mock_web . stop ( ) ; <nl> mmm a / jstests / free_mon / libs / free_mon . js <nl> ppp b / jstests / free_mon / libs / free_mon . js <nl> class FreeMonWebServer { <nl> * Wait for registration information to be populated in the database . <nl> * <nl> * @ param { object } conn <nl> + * @ param { string } state <nl> * / <nl> - function WaitForRegistration ( conn ) { <nl> + function WaitForDiskState ( conn , state ) { <nl> ' use strict ' ; <nl> <nl> const admin = conn . getDB ( " admin " ) ; <nl> function WaitForRegistration ( conn ) { <nl> assert . soon ( function ( ) { <nl> const docs = admin . system . version . find ( { _id : " free_monitoring " } ) ; <nl> const da = docs . toArray ( ) ; <nl> - return da . length = = = 1 & & da [ 0 ] . state = = = " enabled " ; <nl> - } , " Failed to register " , 60 * 1000 ) ; <nl> + return da . length = = = 1 & & da [ 0 ] . state = = = state ; <nl> + } , " Failed to disk state " , 60 * 1000 ) ; <nl> + } <nl> + <nl> + / * * <nl> + * Wait for registration information to be populated in the database . <nl> + * <nl> + * @ param { object } conn <nl> + * / <nl> + function WaitForRegistration ( conn ) { <nl> + WaitForDiskState ( conn , ' enabled ' ) ; <nl> + } <nl> + <nl> + / * * <nl> + * Wait for unregistration information to be populated in the database . <nl> + * <nl> + * @ param { object } conn <nl> + * / <nl> + function WaitForUnRegistration ( conn ) { <nl> + WaitForDiskState ( conn , ' disabled ' ) ; <nl> } <nl> <nl> / * * <nl> mmm a / src / mongo / db / free_mon / free_mon_processor . cpp <nl> ppp b / src / mongo / db / free_mon / free_mon_processor . cpp <nl> void FreeMonProcessor : : doServerRegister ( <nl> if ( ! state . is_initialized ( ) ) { <nl> _registerOnTransitionToPrimary = regType ; <nl> } else { <nl> - / / We are standalone , if we have a registration id , then send a registration <nl> - / / notification , else wait for the user to register us <nl> + / / We are standalone or secondary , if we have a registration id , then send a <nl> + / / registration notification , else wait for the user to register us . <nl> if ( state . get ( ) . getState ( ) = = StorageStateEnum : : enabled ) { <nl> enqueue ( FreeMonRegisterCommandMessage : : createNow ( msg - > getPayload ( ) . second ) ) ; <nl> } <nl> } <nl> + <nl> + / / Ensure we read the state once . <nl> + / / This is important on a disabled secondary so that the in - memory state knows we are <nl> + / / disabled . <nl> + readState ( optCtx . get ( ) ) ; <nl> } <nl> } <nl> <nl>
SERVER - 40112 db . disableFreeMonitoring ( ) returns ' not master ' on secondary after restart
mongodb/mongo
b5883226855662d54f990ebb7dcfd952c037a11c
2019-04-05T19:50:14Z
mmm a / src / mongo / db / repl / session_update_tracker . cpp <nl> ppp b / src / mongo / db / repl / session_update_tracker . cpp <nl> <nl> * it in the license file . <nl> * / <nl> <nl> + # define MONGO_LOG_DEFAULT_COMPONENT : : mongo : : logger : : LogComponent : : kReplication <nl> + <nl> # include " mongo / platform / basic . h " <nl> <nl> # include " mongo / db / repl / session_update_tracker . h " <nl> <nl> # include " mongo / db / session . h " <nl> # include " mongo / db / session_txn_record_gen . h " <nl> # include " mongo / util / assert_util . h " <nl> + # include " mongo / util / log . h " <nl> <nl> namespace mongo { <nl> namespace repl { <nl> boost : : optional < repl : : OplogEntry > createMatchingTransactionTableUpdate ( <nl> <nl> boost : : optional < std : : vector < OplogEntry > > SessionUpdateTracker : : updateOrFlush ( <nl> const OplogEntry & entry ) { <nl> - auto ns = entry . getNss ( ) ; <nl> + const auto & ns = entry . getNss ( ) ; <nl> + <nl> if ( ns = = NamespaceString : : kSessionTransactionsTableNamespace | | <nl> ( ns . isConfigDB ( ) & & ns . isCommand ( ) ) ) { <nl> - return flush ( entry ) ; <nl> + return _flush ( entry ) ; <nl> } <nl> <nl> _updateSessionInfo ( entry ) ; <nl> boost : : optional < std : : vector < OplogEntry > > SessionUpdateTracker : : updateOrFlush ( <nl> } <nl> <nl> void SessionUpdateTracker : : _updateSessionInfo ( const OplogEntry & entry ) { <nl> - auto sessionInfo = entry . getOperationSessionInfo ( ) ; <nl> + const auto & sessionInfo = entry . getOperationSessionInfo ( ) ; <nl> <nl> if ( ! sessionInfo . getTxnNumber ( ) ) { <nl> return ; <nl> } <nl> <nl> - auto lsid = sessionInfo . getSessionId ( ) ; <nl> - fassert ( 50842 , lsid . is_initialized ( ) ) ; <nl> + const auto & lsid = sessionInfo . getSessionId ( ) ; <nl> + invariant ( lsid ) ; <nl> <nl> auto iter = _sessionsToUpdate . find ( lsid - > getId ( ) ) ; <nl> if ( iter = = _sessionsToUpdate . end ( ) ) { <nl> void SessionUpdateTracker : : _updateSessionInfo ( const OplogEntry & entry ) { <nl> return ; <nl> } <nl> <nl> - auto existingSessionInfo = iter - > second . getOperationSessionInfo ( ) ; <nl> - fassert ( 50843 , * sessionInfo . getTxnNumber ( ) > = * existingSessionInfo . getTxnNumber ( ) ) ; <nl> - iter - > second = entry ; <nl> + const auto & existingSessionInfo = iter - > second . getOperationSessionInfo ( ) ; <nl> + if ( * sessionInfo . getTxnNumber ( ) > = * existingSessionInfo . getTxnNumber ( ) ) { <nl> + iter - > second = entry ; <nl> + return ; <nl> + } <nl> + <nl> + severe ( ) < < " Entry for session " < < lsid - > getId ( ) < < " has txnNumber " <nl> + < < * sessionInfo . getTxnNumber ( ) < < " < " < < * existingSessionInfo . getTxnNumber ( ) ; <nl> + severe ( ) < < " New oplog entry : " < < redact ( entry . toString ( ) ) ; <nl> + severe ( ) < < " Existing oplog entry : " < < redact ( iter - > second . toString ( ) ) ; <nl> + <nl> + fassertFailedNoTrace ( 50843 ) ; <nl> } <nl> <nl> - std : : vector < OplogEntry > SessionUpdateTracker : : flush ( const OplogEntry & entry ) { <nl> + std : : vector < OplogEntry > SessionUpdateTracker : : _flush ( const OplogEntry & entry ) { <nl> switch ( entry . getOpType ( ) ) { <nl> case OpTypeEnum : : kInsert : <nl> case OpTypeEnum : : kNoop : <nl> mmm a / src / mongo / db / repl / session_update_tracker . h <nl> ppp b / src / mongo / db / repl / session_update_tracker . h <nl> class SessionUpdateTracker { <nl> * / <nl> boost : : optional < std : : vector < OplogEntry > > updateOrFlush ( const OplogEntry & entry ) ; <nl> <nl> - / * * <nl> - * Analyzes the given oplog entry and determines which transactions stored so far needs to be <nl> - * converted to oplog writes . <nl> - * <nl> - * Note : should only be called when oplog entry ' s ns target config . transactions or config . $ cmd . <nl> - * / <nl> - std : : vector < OplogEntry > flush ( const OplogEntry & entry ) ; <nl> - <nl> / * * <nl> * Converts all stored transaction infos to oplog writes to config . transactions . <nl> * Can return an empty vector if there is nothing to flush . <nl> class SessionUpdateTracker { <nl> std : : vector < OplogEntry > flushAll ( ) ; <nl> <nl> private : <nl> + / * * <nl> + * Analyzes the given oplog entry and determines which transactions stored so far needs to be <nl> + * converted to oplog writes . <nl> + * <nl> + * Note : should only be called when oplog entry ' s ns target config . transactions or config . $ cmd . <nl> + * / <nl> + std : : vector < OplogEntry > _flush ( const OplogEntry & entry ) ; <nl> + <nl> / * * <nl> * Converts stored transaction infos that has a matching transcation id with the given <nl> * query predicate . Can return an empty vector if there is nothing to flush . <nl> mmm a / src / mongo / db / repl / sync_tail . cpp <nl> ppp b / src / mongo / db / repl / sync_tail . cpp <nl> void fillWriterVectors ( OperationContext * opCtx , <nl> } <nl> } <nl> <nl> - } / / namespace <nl> - <nl> - namespace { <nl> void tryToGoLiveAsASecondary ( OperationContext * opCtx , <nl> ReplicationCoordinator * replCoord , <nl> OpTime minValid ) { <nl> void tryToGoLiveAsASecondary ( OperationContext * opCtx , <nl> < < " . Current state : " < < replCoord - > getMemberState ( ) < < causedBy ( status ) ; <nl> } <nl> } <nl> - } <nl> + <nl> + } / / namespace <nl> <nl> class SyncTail : : OpQueueBatcher { <nl> MONGO_DISALLOW_COPYING ( OpQueueBatcher ) ; <nl> mmm a / src / mongo / db / s / config / sharding_catalog_manager_collection_operations . cpp <nl> ppp b / src / mongo / db / s / config / sharding_catalog_manager_collection_operations . cpp <nl> using std : : set ; <nl> <nl> namespace { <nl> <nl> - const Seconds kDefaultFindHostMaxWaitTime ( 20 ) ; <nl> - <nl> const ReadPreferenceSetting kConfigReadSelector ( ReadPreference : : Nearest , TagSet { } ) ; <nl> const WriteConcernOptions kNoWaitWriteConcern ( 1 , WriteConcernOptions : : SyncMode : : UNSET , Seconds ( 0 ) ) ; <nl> const char kWriteConcernField [ ] = " writeConcern " ; <nl>
SERVER - 37657 Report the offending oplog entries if a batch contains non - increasing transaction numbers
mongodb/mongo
16e139c29350840b1b026164c71e998b71ada2be
2018-10-22T15:36:31Z
mmm a / CNTK . sln <nl> ppp b / CNTK . sln <nl> EndProject <nl> Project ( " { 8BC9CEB8 - 8B4A - 11D0 - 8D11 - 00A0C91BC942 } " ) = " ComputationNetworkLib " , " Source \ ComputationNetworkLib \ ComputationNetworkLib . vcxproj " , " { 928ABD1B - 4D3B - 4017 - AEF1 - 0FA1B4467513 } " <nl> EndProject <nl> Project ( " { 8BC9CEB8 - 8B4A - 11D0 - 8D11 - 00A0C91BC942 } " ) = " SGDLib " , " Source \ SGDLib \ SGDLib . vcxproj " , " { DE3C54E5 - D7D0 - 47AF - A783 - DFDCE59E7937 } " <nl> + ProjectSection ( ProjectDependencies ) = postProject <nl> + { 16F14058 - B116 - 49D9 - 8BA0 - 209F3AFFE849 } = { 16F14058 - B116 - 49D9 - 8BA0 - 209F3AFFE849 } <nl> + EndProjectSection <nl> EndProject <nl> Project ( " { 2150E333 - 8FDC - 42A3 - 9474 - 1A3956D46DE8 } " ) = " ParallelTraining " , " ParallelTraining " , " { 5E666C53 - 2D82 - 49C9 - 9127 - 3FDDC321C741 } " <nl> ProjectSection ( SolutionItems ) = preProject <nl> Project ( " { 8BC9CEB8 - 8B4A - 11D0 - 8D11 - 00A0C91BC942 } " ) = " V2LibraryDistributionTests " <nl> { E5606ECE - 48CA - 4464 - BB12 - 09D81D02B9EF } = { E5606ECE - 48CA - 4464 - BB12 - 09D81D02B9EF } <nl> EndProjectSection <nl> EndProject <nl> + Project ( " { 8BC9CEB8 - 8B4A - 11D0 - 8D11 - 00A0C91BC942 } " ) = " Multiverso " , " Source \ Multiverso \ src \ Multiverso . vcxproj " , " { 16F14058 - B116 - 49D9 - 8BA0 - 209F3AFFE849 } " <nl> + EndProject <nl> + Project ( " { 8BC9CEB8 - 8B4A - 11D0 - 8D11 - 00A0C91BC942 } " ) = " MultiversoTests " , " Source \ Multiverso \ Test \ unittests \ MultiversoTests . vcxproj " , " { EC7157E9 - A51F - 4702 - A5FD - 8DAF88C7029F } " <nl> + EndProject <nl> Global <nl> GlobalSection ( SolutionConfigurationPlatforms ) = preSolution <nl> Debug_CpuOnly | Any CPU = Debug_CpuOnly | Any CPU <nl> Global <nl> { F4CCAAB2 - 0DB2 - 4281 - 929A - 2E68E30F0F6E } . Release | Mixed Platforms . Build . 0 = Release | x64 <nl> { F4CCAAB2 - 0DB2 - 4281 - 929A - 2E68E30F0F6E } . Release | x64 . ActiveCfg = Release | x64 <nl> { F4CCAAB2 - 0DB2 - 4281 - 929A - 2E68E30F0F6E } . Release | x64 . Build . 0 = Release | x64 <nl> + { 16F14058 - B116 - 49D9 - 8BA0 - 209F3AFFE849 } . Debug_CpuOnly | Any CPU . ActiveCfg = Debug_CpuOnly | x64 <nl> + { 16F14058 - B116 - 49D9 - 8BA0 - 209F3AFFE849 } . Debug_CpuOnly | Mixed Platforms . ActiveCfg = Debug_CpuOnly | x64 <nl> + { 16F14058 - B116 - 49D9 - 8BA0 - 209F3AFFE849 } . Debug_CpuOnly | Mixed Platforms . Build . 0 = Debug_CpuOnly | x64 <nl> + { 16F14058 - B116 - 49D9 - 8BA0 - 209F3AFFE849 } . Debug_CpuOnly | x64 . ActiveCfg = Debug_CpuOnly | x64 <nl> + { 16F14058 - B116 - 49D9 - 8BA0 - 209F3AFFE849 } . Debug_CpuOnly | x64 . Build . 0 = Debug_CpuOnly | x64 <nl> + { 16F14058 - B116 - 49D9 - 8BA0 - 209F3AFFE849 } . Debug | Any CPU . ActiveCfg = debug | x64 <nl> + { 16F14058 - B116 - 49D9 - 8BA0 - 209F3AFFE849 } . Debug | Mixed Platforms . ActiveCfg = debug | x64 <nl> + { 16F14058 - B116 - 49D9 - 8BA0 - 209F3AFFE849 } . Debug | Mixed Platforms . Build . 0 = debug | x64 <nl> + { 16F14058 - B116 - 49D9 - 8BA0 - 209F3AFFE849 } . Debug | x64 . ActiveCfg = debug | x64 <nl> + { 16F14058 - B116 - 49D9 - 8BA0 - 209F3AFFE849 } . Debug | x64 . Build . 0 = debug | x64 <nl> + { 16F14058 - B116 - 49D9 - 8BA0 - 209F3AFFE849 } . Release_CpuOnly | Any CPU . ActiveCfg = Release_CpuOnly | x64 <nl> + { 16F14058 - B116 - 49D9 - 8BA0 - 209F3AFFE849 } . Release_CpuOnly | Mixed Platforms . ActiveCfg = Release_CpuOnly | x64 <nl> + { 16F14058 - B116 - 49D9 - 8BA0 - 209F3AFFE849 } . Release_CpuOnly | Mixed Platforms . Build . 0 = Release_CpuOnly | x64 <nl> + { 16F14058 - B116 - 49D9 - 8BA0 - 209F3AFFE849 } . Release_CpuOnly | x64 . ActiveCfg = Release_CpuOnly | x64 <nl> + { 16F14058 - B116 - 49D9 - 8BA0 - 209F3AFFE849 } . Release_CpuOnly | x64 . Build . 0 = Release_CpuOnly | x64 <nl> + { 16F14058 - B116 - 49D9 - 8BA0 - 209F3AFFE849 } . Release_NoOpt | Any CPU . ActiveCfg = Release_CpuOnly | x64 <nl> + { 16F14058 - B116 - 49D9 - 8BA0 - 209F3AFFE849 } . Release_NoOpt | Mixed Platforms . ActiveCfg = Release_CpuOnly | x64 <nl> + { 16F14058 - B116 - 49D9 - 8BA0 - 209F3AFFE849 } . Release_NoOpt | Mixed Platforms . Build . 0 = Release_CpuOnly | x64 <nl> + { 16F14058 - B116 - 49D9 - 8BA0 - 209F3AFFE849 } . Release_NoOpt | x64 . ActiveCfg = Release_CpuOnly | x64 <nl> + { 16F14058 - B116 - 49D9 - 8BA0 - 209F3AFFE849 } . Release_NoOpt | x64 . Build . 0 = Release_CpuOnly | x64 <nl> + { 16F14058 - B116 - 49D9 - 8BA0 - 209F3AFFE849 } . Release | Any CPU . ActiveCfg = release | x64 <nl> + { 16F14058 - B116 - 49D9 - 8BA0 - 209F3AFFE849 } . Release | Mixed Platforms . ActiveCfg = release | x64 <nl> + { 16F14058 - B116 - 49D9 - 8BA0 - 209F3AFFE849 } . Release | Mixed Platforms . Build . 0 = release | x64 <nl> + { 16F14058 - B116 - 49D9 - 8BA0 - 209F3AFFE849 } . Release | x64 . ActiveCfg = release | x64 <nl> + { 16F14058 - B116 - 49D9 - 8BA0 - 209F3AFFE849 } . Release | x64 . Build . 0 = release | x64 <nl> + { EC7157E9 - A51F - 4702 - A5FD - 8DAF88C7029F } . Debug_CpuOnly | Any CPU . ActiveCfg = Debug_CpuOnly | x64 <nl> + { EC7157E9 - A51F - 4702 - A5FD - 8DAF88C7029F } . Debug_CpuOnly | Mixed Platforms . ActiveCfg = Debug_CpuOnly | x64 <nl> + { EC7157E9 - A51F - 4702 - A5FD - 8DAF88C7029F } . Debug_CpuOnly | Mixed Platforms . Build . 0 = Debug_CpuOnly | x64 <nl> + { EC7157E9 - A51F - 4702 - A5FD - 8DAF88C7029F } . Debug_CpuOnly | x64 . ActiveCfg = Debug_CpuOnly | x64 <nl> + { EC7157E9 - A51F - 4702 - A5FD - 8DAF88C7029F } . Debug_CpuOnly | x64 . Build . 0 = Debug_CpuOnly | x64 <nl> + { EC7157E9 - A51F - 4702 - A5FD - 8DAF88C7029F } . Debug | Any CPU . ActiveCfg = Debug | x64 <nl> + { EC7157E9 - A51F - 4702 - A5FD - 8DAF88C7029F } . Debug | Mixed Platforms . ActiveCfg = Debug | x64 <nl> + { EC7157E9 - A51F - 4702 - A5FD - 8DAF88C7029F } . Debug | Mixed Platforms . Build . 0 = Debug | x64 <nl> + { EC7157E9 - A51F - 4702 - A5FD - 8DAF88C7029F } . Debug | x64 . ActiveCfg = Debug | x64 <nl> + { EC7157E9 - A51F - 4702 - A5FD - 8DAF88C7029F } . Debug | x64 . Build . 0 = Debug | x64 <nl> + { EC7157E9 - A51F - 4702 - A5FD - 8DAF88C7029F } . Release_CpuOnly | Any CPU . ActiveCfg = Release_CpuOnly | x64 <nl> + { EC7157E9 - A51F - 4702 - A5FD - 8DAF88C7029F } . Release_CpuOnly | Mixed Platforms . ActiveCfg = Release_CpuOnly | x64 <nl> + { EC7157E9 - A51F - 4702 - A5FD - 8DAF88C7029F } . Release_CpuOnly | Mixed Platforms . Build . 0 = Release_CpuOnly | x64 <nl> + { EC7157E9 - A51F - 4702 - A5FD - 8DAF88C7029F } . Release_CpuOnly | x64 . ActiveCfg = Release_CpuOnly | x64 <nl> + { EC7157E9 - A51F - 4702 - A5FD - 8DAF88C7029F } . Release_CpuOnly | x64 . Build . 0 = Release_CpuOnly | x64 <nl> + { EC7157E9 - A51F - 4702 - A5FD - 8DAF88C7029F } . Release_NoOpt | Any CPU . ActiveCfg = Release_CpuOnly | x64 <nl> + { EC7157E9 - A51F - 4702 - A5FD - 8DAF88C7029F } . Release_NoOpt | Mixed Platforms . ActiveCfg = Release_CpuOnly | x64 <nl> + { EC7157E9 - A51F - 4702 - A5FD - 8DAF88C7029F } . Release_NoOpt | Mixed Platforms . Build . 0 = Release_CpuOnly | x64 <nl> + { EC7157E9 - A51F - 4702 - A5FD - 8DAF88C7029F } . Release_NoOpt | x64 . ActiveCfg = Release_CpuOnly | x64 <nl> + { EC7157E9 - A51F - 4702 - A5FD - 8DAF88C7029F } . Release_NoOpt | x64 . Build . 0 = Release_CpuOnly | x64 <nl> + { EC7157E9 - A51F - 4702 - A5FD - 8DAF88C7029F } . Release | Any CPU . ActiveCfg = Release | x64 <nl> + { EC7157E9 - A51F - 4702 - A5FD - 8DAF88C7029F } . Release | Mixed Platforms . ActiveCfg = Release | x64 <nl> + { EC7157E9 - A51F - 4702 - A5FD - 8DAF88C7029F } . Release | Mixed Platforms . Build . 0 = Release | x64 <nl> + { EC7157E9 - A51F - 4702 - A5FD - 8DAF88C7029F } . Release | x64 . ActiveCfg = Release | x64 <nl> + { EC7157E9 - A51F - 4702 - A5FD - 8DAF88C7029F } . Release | x64 . Build . 0 = Release | x64 <nl> EndGlobalSection <nl> GlobalSection ( SolutionProperties ) = preSolution <nl> HideSolutionNode = FALSE <nl> Global <nl> { E844AB9A - A48F - 4A99 - 9625 - F528C5C46D83 } = { 8656B71D - E24C - 4AC2 - 8BE4 - C07B415A3E15 } <nl> { CD721536 - CFD3 - 413E - A3D7 - FB0FAF989635 } = { DD043083 - 71A4 - 409A - AA91 - F9C548DCF7EC } <nl> { F4CCAAB2 - 0DB2 - 4281 - 929A - 2E68E30F0F6E } = { 6F19321A - 65E7 - 4829 - B00C - 3886CD6C6EDE } <nl> + { 16F14058 - B116 - 49D9 - 8BA0 - 209F3AFFE849 } = { DD043083 - 71A4 - 409A - AA91 - F9C548DCF7EC } <nl> + { EC7157E9 - A51F - 4702 - A5FD - 8DAF88C7029F } = { 6F19321A - 65E7 - 4829 - B00C - 3886CD6C6EDE } <nl> EndGlobalSection <nl> EndGlobal <nl>
Add Multiverso to the project
microsoft/CNTK
9776a03147907b9905e2456e7dbf3cb10440f7f6
2016-11-01T07:52:47Z
mmm a / modules / gpustereo / doc / stereo . rst <nl> ppp b / modules / gpustereo / doc / stereo . rst <nl> Stereo Correspondence <nl> <nl> <nl> <nl> - gpu : : StereoBM_GPU <nl> mmmmmmmmmmmmmmmmmm <nl> - . . ocv : class : : gpu : : StereoBM_GPU <nl> + gpu : : StereoBM <nl> + mmmmmmmmmmmm - <nl> + . . ocv : class : : gpu : : StereoBM : public cv : : StereoBM <nl> <nl> Class computing stereo correspondence ( disparity map ) using the block matching algorithm . : : <nl> <nl> - class StereoBM_GPU <nl> - { <nl> - public : <nl> - enum { BASIC_PRESET = 0 , PREFILTER_XSOBEL = 1 } ; <nl> - <nl> - enum { DEFAULT_NDISP = 64 , DEFAULT_WINSZ = 19 } ; <nl> - <nl> - StereoBM_GPU ( ) ; <nl> - StereoBM_GPU ( int preset , int ndisparities = DEFAULT_NDISP , <nl> - int winSize = DEFAULT_WINSZ ) ; <nl> - <nl> - void operator ( ) ( const GpuMat & left , const GpuMat & right , <nl> - GpuMat & disparity , Stream & stream = Stream : : Null ( ) ) ; <nl> - <nl> - static bool checkIfGpuCallReasonable ( ) ; <nl> - <nl> - int preset ; <nl> - int ndisp ; <nl> - int winSize ; <nl> - <nl> - float avergeTexThreshold ; <nl> - <nl> - . . . <nl> - } ; <nl> - <nl> - <nl> - The class also performs pre - and post - filtering steps : Sobel pre - filtering ( if ` ` PREFILTER_XSOBEL ` ` flag is set ) and low textureness filtering ( if ` ` averageTexThreshols > 0 ` ` ) . If ` ` avergeTexThreshold = 0 ` ` , low textureness filtering is disabled . Otherwise , the disparity is set to 0 in each point ` ` ( x , y ) ` ` , where for the left image <nl> - <nl> - . . math : : <nl> - \ sum HorizontalGradiensInWindow ( x , y , winSize ) < ( winSize \ cdot winSize ) \ cdot avergeTexThreshold <nl> - <nl> - This means that the input left image is low textured . <nl> - <nl> - <nl> - <nl> - gpu : : StereoBM_GPU : : StereoBM_GPU <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> - Enables : ocv : class : ` gpu : : StereoBM_GPU ` constructors . <nl> + . . seealso : : : ocv : class : ` StereoBM ` <nl> <nl> - . . ocv : function : : gpu : : StereoBM_GPU : : StereoBM_GPU ( ) <nl> <nl> - . . ocv : function : : gpu : : StereoBM_GPU : : StereoBM_GPU ( int preset , int ndisparities = DEFAULT_NDISP , int winSize = DEFAULT_WINSZ ) <nl> <nl> - : param preset : Parameter presetting : <nl> + gpu : : createStereoBM <nl> + mmmmmmmmmmmmmmmmmm - <nl> + Creates StereoBM object . <nl> <nl> - * * * BASIC_PRESET * * Basic mode without pre - processing . <nl> + . . ocv : function : : Ptr < gpu : : StereoBM > gpu : : createStereoBM ( int numDisparities = 64 , int blockSize = 19 ) <nl> <nl> - * * * PREFILTER_XSOBEL * * Sobel pre - filtering mode . <nl> + : param numDisparities : the disparity search range . For each pixel algorithm will find the best disparity from 0 ( default minimum disparity ) to ` ` numDisparities ` ` . The search range can then be shifted by changing the minimum disparity . <nl> <nl> - : param ndisparities : Number of disparities . It must be a multiple of 8 and less or equal to 256 . <nl> - <nl> - : param winSize : Block size . <nl> - <nl> - <nl> - <nl> - gpu : : StereoBM_GPU : : operator ( ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> - Enables the stereo correspondence operator that finds the disparity for the specified rectified stereo pair . <nl> - <nl> - . . ocv : function : : void gpu : : StereoBM_GPU : : operator ( ) ( const GpuMat & left , const GpuMat & right , GpuMat & disparity , Stream & stream = Stream : : Null ( ) ) <nl> - <nl> - : param left : Left image . Only ` ` CV_8UC1 ` ` type is supported . <nl> - <nl> - : param right : Right image with the same size and the same type as the left one . <nl> - <nl> - : param disparity : Output disparity map . It is a ` ` CV_8UC1 ` ` image with the same size as the input images . <nl> - <nl> - : param stream : Stream for the asynchronous version . <nl> - <nl> - <nl> - <nl> - gpu : : StereoBM_GPU : : checkIfGpuCallReasonable <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> - Uses a heuristic method to estimate whether the current GPU is faster than the CPU in this algorithm . It queries the currently active device . <nl> - <nl> - . . ocv : function : : bool gpu : : StereoBM_GPU : : checkIfGpuCallReasonable ( ) <nl> + : param blockSize : the linear size of the blocks compared by the algorithm . The size should be odd ( as the block is centered at the current pixel ) . Larger block size implies smoother , though less accurate disparity map . Smaller block size gives more detailed disparity map , but there is higher chance for algorithm to find a wrong correspondence . <nl> <nl> <nl> <nl> gpu : : StereoBeliefPropagation <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> - . . ocv : class : : gpu : : StereoBeliefPropagation <nl> + . . ocv : class : : gpu : : StereoBeliefPropagation : public cv : : StereoMatcher <nl> <nl> Class computing stereo correspondence using the belief propagation algorithm . : : <nl> <nl> - class StereoBeliefPropagation <nl> + class CV_EXPORTS StereoBeliefPropagation : public cv : : StereoMatcher <nl> { <nl> public : <nl> - enum { DEFAULT_NDISP = 64 } ; <nl> - enum { DEFAULT_ITERS = 5 } ; <nl> - enum { DEFAULT_LEVELS = 5 } ; <nl> + using cv : : StereoMatcher : : compute ; <nl> <nl> - static void estimateRecommendedParams ( int width , int height , <nl> - int & ndisp , int & iters , int & levels ) ; <nl> + virtual void compute ( InputArray left , InputArray right , OutputArray disparity , Stream & stream ) = 0 ; <nl> <nl> - explicit StereoBeliefPropagation ( int ndisp = DEFAULT_NDISP , <nl> - int iters = DEFAULT_ITERS , <nl> - int levels = DEFAULT_LEVELS , <nl> - int msg_type = CV_32F ) ; <nl> - StereoBeliefPropagation ( int ndisp , int iters , int levels , <nl> - float max_data_term , float data_weight , <nl> - float max_disc_term , float disc_single_jump , <nl> - int msg_type = CV_32F ) ; <nl> + / / ! version for user specified data term <nl> + virtual void compute ( InputArray data , OutputArray disparity , Stream & stream = Stream : : Null ( ) ) = 0 ; <nl> <nl> - void operator ( ) ( const GpuMat & left , const GpuMat & right , <nl> - GpuMat & disparity , Stream & stream = Stream : : Null ( ) ) ; <nl> - void operator ( ) ( const GpuMat & data , GpuMat & disparity , Stream & stream = Stream : : Null ( ) ) ; <nl> + / / ! number of BP iterations on each level <nl> + virtual int getNumIters ( ) const = 0 ; <nl> + virtual void setNumIters ( int iters ) = 0 ; <nl> <nl> - int ndisp ; <nl> + / / ! number of levels <nl> + virtual int getNumLevels ( ) const = 0 ; <nl> + virtual void setNumLevels ( int levels ) = 0 ; <nl> <nl> - int iters ; <nl> - int levels ; <nl> + / / ! truncation of data cost <nl> + virtual double getMaxDataTerm ( ) const = 0 ; <nl> + virtual void setMaxDataTerm ( double max_data_term ) = 0 ; <nl> <nl> - float max_data_term ; <nl> - float data_weight ; <nl> - float max_disc_term ; <nl> - float disc_single_jump ; <nl> + / / ! data weight <nl> + virtual double getDataWeight ( ) const = 0 ; <nl> + virtual void setDataWeight ( double data_weight ) = 0 ; <nl> <nl> - int msg_type ; <nl> + / / ! truncation of discontinuity cost <nl> + virtual double getMaxDiscTerm ( ) const = 0 ; <nl> + virtual void setMaxDiscTerm ( double max_disc_term ) = 0 ; <nl> <nl> - . . . <nl> + / / ! discontinuity single jump <nl> + virtual double getDiscSingleJump ( ) const = 0 ; <nl> + virtual void setDiscSingleJump ( double disc_single_jump ) = 0 ; <nl> + <nl> + virtual int getMsgType ( ) const = 0 ; <nl> + virtual void setMsgType ( int msg_type ) = 0 ; <nl> + <nl> + static void estimateRecommendedParams ( int width , int height , int & ndisp , int & iters , int & levels ) ; <nl> } ; <nl> <nl> + <nl> The class implements algorithm described in [ Felzenszwalb2006 ] _ . It can compute own data cost ( using a truncated linear model ) or use a user - provided data cost . <nl> <nl> . . note : : <nl> The class implements algorithm described in [ Felzenszwalb2006 ] _ . It can compute <nl> <nl> ` ` width_step ` ` is the number of bytes in a line including padding . <nl> <nl> + ` ` StereoBeliefPropagation ` ` uses a truncated linear model for the data cost and discontinuity terms : <nl> <nl> + . . math : : <nl> <nl> - gpu : : StereoBeliefPropagation : : StereoBeliefPropagation <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> - Enables the : ocv : class : ` gpu : : StereoBeliefPropagation ` constructors . <nl> - <nl> - . . ocv : function : : gpu : : StereoBeliefPropagation : : StereoBeliefPropagation ( int ndisp = DEFAULT_NDISP , int iters = DEFAULT_ITERS , int levels = DEFAULT_LEVELS , int msg_type = CV_32F ) <nl> - <nl> - . . ocv : function : : gpu : : StereoBeliefPropagation : : StereoBeliefPropagation ( int ndisp , int iters , int levels , float max_data_term , float data_weight , float max_disc_term , float disc_single_jump , int msg_type = CV_32F ) <nl> - <nl> - : param ndisp : Number of disparities . <nl> - <nl> - : param iters : Number of BP iterations on each level . <nl> + DataCost = data \ _ weight \ cdot \ min ( \ lvert Img_Left ( x , y ) - Img_Right ( x - d , y ) \ rvert , max \ _ data \ _ term ) <nl> <nl> - : param levels : Number of levels . <nl> + . . math : : <nl> <nl> - : param max_data_term : Threshold for data cost truncation . <nl> + DiscTerm = \ min ( disc \ _ single \ _ jump \ cdot \ lvert f_1 - f_2 \ rvert , max \ _ disc \ _ term ) <nl> <nl> - : param data_weight : Data weight . <nl> + For more details , see [ Felzenszwalb2006 ] _ . <nl> <nl> - : param max_disc_term : Threshold for discontinuity truncation . <nl> + By default , ` ` StereoBeliefPropagation ` ` uses floating - point arithmetics and the ` ` CV_32FC1 ` ` type for messages . But it can also use fixed - point arithmetics and the ` ` CV_16SC1 ` ` message type for better performance . To avoid an overflow in this case , the parameters must satisfy the following requirement : <nl> <nl> - : param disc_single_jump : Discontinuity single jump . <nl> + . . math : : <nl> <nl> - : param msg_type : Type for messages . ` ` CV_16SC1 ` ` and ` ` CV_32FC1 ` ` types are supported . <nl> + 10 \ cdot 2 ^ { levels - 1 } \ cdot max \ _ data \ _ term < SHRT \ _ MAX <nl> <nl> - ` ` StereoBeliefPropagation ` ` uses a truncated linear model for the data cost and discontinuity terms : <nl> + . . seealso : : : ocv : class : ` StereoMatcher ` <nl> <nl> - . . math : : <nl> <nl> - DataCost = data \ _ weight \ cdot \ min ( \ lvert Img_Left ( x , y ) - Img_Right ( x - d , y ) \ rvert , max \ _ data \ _ term ) <nl> <nl> - . . math : : <nl> + gpu : : createStereoBeliefPropagation <nl> + mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> + Creates StereoBeliefPropagation object . <nl> <nl> - DiscTerm = \ min ( disc \ _ single \ _ jump \ cdot \ lvert f_1 - f_2 \ rvert , max \ _ disc \ _ term ) <nl> + . . ocv : function : : Ptr < gpu : : StereoBeliefPropagation > gpu : : createStereoBeliefPropagation ( int ndisp = 64 , int iters = 5 , int levels = 5 , int msg_type = CV_32F ) <nl> <nl> - For more details , see [ Felzenszwalb2006 ] _ . <nl> + : param ndisp : Number of disparities . <nl> <nl> - By default , : ocv : class : ` gpu : : StereoBeliefPropagation ` uses floating - point arithmetics and the ` ` CV_32FC1 ` ` type for messages . But it can also use fixed - point arithmetics and the ` ` CV_16SC1 ` ` message type for better performance . To avoid an overflow in this case , the parameters must satisfy the following requirement : <nl> + : param iters : Number of BP iterations on each level . <nl> <nl> - . . math : : <nl> + : param levels : Number of levels . <nl> <nl> - 10 \ cdot 2 ^ { levels - 1 } \ cdot max \ _ data \ _ term < SHRT \ _ MAX <nl> + : param msg_type : Type for messages . ` ` CV_16SC1 ` ` and ` ` CV_32FC1 ` ` types are supported . <nl> <nl> <nl> <nl> gpu : : StereoBeliefPropagation : : estimateRecommendedParams <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> + mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> Uses a heuristic method to compute the recommended parameters ( ` ` ndisp ` ` , ` ` iters ` ` and ` ` levels ` ` ) for the specified image size ( ` ` width ` ` and ` ` height ` ` ) . <nl> <nl> . . ocv : function : : void gpu : : StereoBeliefPropagation : : estimateRecommendedParams ( int width , int height , int & ndisp , int & iters , int & levels ) <nl> <nl> <nl> <nl> - gpu : : StereoBeliefPropagation : : operator ( ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> - Enables the stereo correspondence operator that finds the disparity for the specified rectified stereo pair or data cost . <nl> + gpu : : StereoBeliefPropagation : : compute <nl> + mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> + Enables the stereo correspondence operator that finds the disparity for the specified data cost . <nl> <nl> - . . ocv : function : : void gpu : : StereoBeliefPropagation : : operator ( ) ( const GpuMat & left , const GpuMat & right , GpuMat & disparity , Stream & stream = Stream : : Null ( ) ) <nl> - <nl> - . . ocv : function : : void gpu : : StereoBeliefPropagation : : operator ( ) ( const GpuMat & data , GpuMat & disparity , Stream & stream = Stream : : Null ( ) ) <nl> - <nl> - : param left : Left image . ` ` CV_8UC1 ` ` , ` ` CV_8UC3 ` ` and ` ` CV_8UC4 ` ` types are supported . <nl> - <nl> - : param right : Right image with the same size and the same type as the left one . <nl> + . . ocv : function : : void gpu : : StereoBeliefPropagation : : compute ( InputArray data , OutputArray disparity , Stream & stream = Stream : : Null ( ) ) <nl> <nl> : param data : User - specified data cost , a matrix of ` ` msg_type ` ` type and ` ` Size ( < image columns > * ndisp , < image rows > ) ` ` size . <nl> <nl> Enables the stereo correspondence operator that finds the disparity for the spec <nl> <nl> gpu : : StereoConstantSpaceBP <nl> mmmmmmmmmmmmmmmmmmmmmmmm - - <nl> - . . ocv : class : : gpu : : StereoConstantSpaceBP <nl> + . . ocv : class : : gpu : : StereoConstantSpaceBP : public gpu : : StereoBeliefPropagation <nl> <nl> Class computing stereo correspondence using the constant space belief propagation algorithm . : : <nl> <nl> - class StereoConstantSpaceBP <nl> + class CV_EXPORTS StereoConstantSpaceBP : public gpu : : StereoBeliefPropagation <nl> { <nl> public : <nl> - enum { DEFAULT_NDISP = 128 } ; <nl> - enum { DEFAULT_ITERS = 8 } ; <nl> - enum { DEFAULT_LEVELS = 4 } ; <nl> - enum { DEFAULT_NR_PLANE = 4 } ; <nl> - <nl> - static void estimateRecommendedParams ( int width , int height , <nl> - int & ndisp , int & iters , int & levels , int & nr_plane ) ; <nl> - <nl> - explicit StereoConstantSpaceBP ( int ndisp = DEFAULT_NDISP , <nl> - int iters = DEFAULT_ITERS , <nl> - int levels = DEFAULT_LEVELS , <nl> - int nr_plane = DEFAULT_NR_PLANE , <nl> - int msg_type = CV_32F ) ; <nl> - StereoConstantSpaceBP ( int ndisp , int iters , int levels , int nr_plane , <nl> - float max_data_term , float data_weight , <nl> - float max_disc_term , float disc_single_jump , <nl> - int min_disp_th = 0 , <nl> - int msg_type = CV_32F ) ; <nl> - <nl> - void operator ( ) ( const GpuMat & left , const GpuMat & right , <nl> - GpuMat & disparity , Stream & stream = Stream : : Null ( ) ) ; <nl> - <nl> - int ndisp ; <nl> - <nl> - int iters ; <nl> - int levels ; <nl> - <nl> - int nr_plane ; <nl> + / / ! number of active disparity on the first level <nl> + virtual int getNrPlane ( ) const = 0 ; <nl> + virtual void setNrPlane ( int nr_plane ) = 0 ; <nl> <nl> - float max_data_term ; <nl> - float data_weight ; <nl> - float max_disc_term ; <nl> - float disc_single_jump ; <nl> + virtual bool getUseLocalInitDataCost ( ) const = 0 ; <nl> + virtual void setUseLocalInitDataCost ( bool use_local_init_data_cost ) = 0 ; <nl> <nl> - int min_disp_th ; <nl> - <nl> - int msg_type ; <nl> - <nl> - bool use_local_init_data_cost ; <nl> - <nl> - . . . <nl> + static void estimateRecommendedParams ( int width , int height , int & ndisp , int & iters , int & levels , int & nr_plane ) ; <nl> } ; <nl> <nl> <nl> The class implements algorithm described in [ Yang2010 ] _ . ` ` StereoConstantSpaceBP ` ` supports both local minimum and global minimum data cost initialization algorithms . For more details , see the paper mentioned above . By default , a local algorithm is used . To enable a global algorithm , set ` ` use_local_init_data_cost ` ` to ` ` false ` ` . <nl> <nl> - <nl> - <nl> - gpu : : StereoConstantSpaceBP : : StereoConstantSpaceBP <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> - Enables the : ocv : class : ` gpu : : StereoConstantSpaceBP ` constructors . <nl> - <nl> - . . ocv : function : : gpu : : StereoConstantSpaceBP : : StereoConstantSpaceBP ( int ndisp = DEFAULT_NDISP , int iters = DEFAULT_ITERS , int levels = DEFAULT_LEVELS , int nr_plane = DEFAULT_NR_PLANE , int msg_type = CV_32F ) <nl> - <nl> - . . ocv : function : : gpu : : StereoConstantSpaceBP : : StereoConstantSpaceBP ( int ndisp , int iters , int levels , int nr_plane , float max_data_term , float data_weight , float max_disc_term , float disc_single_jump , int min_disp_th = 0 , int msg_type = CV_32F ) <nl> - <nl> - : param ndisp : Number of disparities . <nl> - <nl> - : param iters : Number of BP iterations on each level . <nl> - <nl> - : param levels : Number of levels . <nl> - <nl> - : param nr_plane : Number of disparity levels on the first level . <nl> - <nl> - : param max_data_term : Truncation of data cost . <nl> - <nl> - : param data_weight : Data weight . <nl> - <nl> - : param max_disc_term : Truncation of discontinuity . <nl> - <nl> - : param disc_single_jump : Discontinuity single jump . <nl> - <nl> - : param min_disp_th : Minimal disparity threshold . <nl> - <nl> - : param msg_type : Type for messages . ` ` CV_16SC1 ` ` and ` ` CV_32FC1 ` ` types are supported . <nl> - <nl> ` ` StereoConstantSpaceBP ` ` uses a truncated linear model for the data cost and discontinuity terms : <nl> <nl> . . math : : <nl> By default , ` ` StereoConstantSpaceBP ` ` uses floating - point arithmetics and the ` ` <nl> <nl> <nl> <nl> - gpu : : StereoConstantSpaceBP : : estimateRecommendedParams <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> - Uses a heuristic method to compute parameters ( ndisp , iters , levelsand nrplane ) for the specified image size ( widthand height ) . <nl> + gpu : : createStereoConstantSpaceBP <nl> + mmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + Creates StereoConstantSpaceBP object . <nl> <nl> - . . ocv : function : : void gpu : : StereoConstantSpaceBP : : estimateRecommendedParams ( int width , int height , int & ndisp , int & iters , int & levels , int & nr_plane ) <nl> + . . ocv : function : : Ptr < gpu : : StereoConstantSpaceBP > gpu : : createStereoConstantSpaceBP ( int ndisp = 128 , int iters = 8 , int levels = 4 , int nr_plane = 4 , int msg_type = CV_32F ) <nl> + <nl> + : param ndisp : Number of disparities . <nl> <nl> + : param iters : Number of BP iterations on each level . <nl> <nl> + : param levels : Number of levels . <nl> <nl> - gpu : : StereoConstantSpaceBP : : operator ( ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> - Enables the stereo correspondence operator that finds the disparity for the specified rectified stereo pair . <nl> + : param nr_plane : Number of disparity levels on the first level . <nl> <nl> - . . ocv : function : : void gpu : : StereoConstantSpaceBP : : operator ( ) ( const GpuMat & left , const GpuMat & right , GpuMat & disparity , Stream & stream = Stream : : Null ( ) ) <nl> + : param msg_type : Type for messages . ` ` CV_16SC1 ` ` and ` ` CV_32FC1 ` ` types are supported . <nl> <nl> - : param left : Left image . ` ` CV_8UC1 ` ` , ` ` CV_8UC3 ` ` and ` ` CV_8UC4 ` ` types are supported . <nl> <nl> - : param right : Right image with the same size and the same type as the left one . <nl> <nl> - : param disparity : Output disparity map . If ` ` disparity ` ` is empty , the output type is ` ` CV_16SC1 ` ` . Otherwise , the output type is ` ` disparity . type ( ) ` ` . <nl> + gpu : : StereoConstantSpaceBP : : estimateRecommendedParams <nl> + mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + Uses a heuristic method to compute parameters ( ndisp , iters , levelsand nrplane ) for the specified image size ( widthand height ) . <nl> <nl> - : param stream : Stream for the asynchronous version . <nl> + . . ocv : function : : void gpu : : StereoConstantSpaceBP : : estimateRecommendedParams ( int width , int height , int & ndisp , int & iters , int & levels , int & nr_plane ) <nl> <nl> <nl> <nl> gpu : : DisparityBilateralFilter <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> - . . ocv : class : : gpu : : DisparityBilateralFilter <nl> + . . ocv : class : : gpu : : DisparityBilateralFilter : public cv : : Algorithm <nl> <nl> Class refining a disparity map using joint bilateral filtering . : : <nl> <nl> - class CV_EXPORTS DisparityBilateralFilter <nl> + class CV_EXPORTS DisparityBilateralFilter : public cv : : Algorithm <nl> { <nl> public : <nl> - enum { DEFAULT_NDISP = 64 } ; <nl> - enum { DEFAULT_RADIUS = 3 } ; <nl> - enum { DEFAULT_ITERS = 1 } ; <nl> + / / ! the disparity map refinement operator . Refine disparity map using joint bilateral filtering given a single color image . <nl> + / / ! disparity must have CV_8U or CV_16S type , image must have CV_8UC1 or CV_8UC3 type . <nl> + virtual void apply ( InputArray disparity , InputArray image , OutputArray dst , Stream & stream = Stream : : Null ( ) ) = 0 ; <nl> + <nl> + virtual int getNumDisparities ( ) const = 0 ; <nl> + virtual void setNumDisparities ( int numDisparities ) = 0 ; <nl> + <nl> + virtual int getRadius ( ) const = 0 ; <nl> + virtual void setRadius ( int radius ) = 0 ; <nl> <nl> - explicit DisparityBilateralFilter ( int ndisp = DEFAULT_NDISP , <nl> - int radius = DEFAULT_RADIUS , int iters = DEFAULT_ITERS ) ; <nl> + virtual int getNumIters ( ) const = 0 ; <nl> + virtual void setNumIters ( int iters ) = 0 ; <nl> <nl> - DisparityBilateralFilter ( int ndisp , int radius , int iters , <nl> - float edge_threshold , float max_disc_threshold , <nl> - float sigma_range ) ; <nl> + / / ! truncation of data continuity <nl> + virtual double getEdgeThreshold ( ) const = 0 ; <nl> + virtual void setEdgeThreshold ( double edge_threshold ) = 0 ; <nl> <nl> - void operator ( ) ( const GpuMat & disparity , const GpuMat & image , <nl> - GpuMat & dst , Stream & stream = Stream : : Null ( ) ) ; <nl> + / / ! truncation of disparity continuity <nl> + virtual double getMaxDiscThreshold ( ) const = 0 ; <nl> + virtual void setMaxDiscThreshold ( double max_disc_threshold ) = 0 ; <nl> <nl> - . . . <nl> + / / ! filter range sigma <nl> + virtual double getSigmaRange ( ) const = 0 ; <nl> + virtual void setSigmaRange ( double sigma_range ) = 0 ; <nl> } ; <nl> <nl> <nl> The class implements [ Yang2010 ] _ algorithm . <nl> <nl> <nl> <nl> - gpu : : DisparityBilateralFilter : : DisparityBilateralFilter <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> - Enables the : ocv : class : ` gpu : : DisparityBilateralFilter ` constructors . <nl> - <nl> - . . ocv : function : : gpu : : DisparityBilateralFilter : : DisparityBilateralFilter ( int ndisp = DEFAULT_NDISP , int radius = DEFAULT_RADIUS , int iters = DEFAULT_ITERS ) <nl> + gpu : : createDisparityBilateralFilter <nl> + mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + Creates DisparityBilateralFilter object . <nl> <nl> - . . ocv : function : : gpu : : DisparityBilateralFilter : : DisparityBilateralFilter ( int ndisp , int radius , int iters , float edge_threshold , float max_disc_threshold , float sigma_range ) <nl> + . . ocv : function : : Ptr < gpu : : DisparityBilateralFilter > gpu : : createDisparityBilateralFilter ( int ndisp = 64 , int radius = 3 , int iters = 1 ) <nl> <nl> : param ndisp : Number of disparities . <nl> <nl> Enables the : ocv : class : ` gpu : : DisparityBilateralFilter ` constructors . <nl> <nl> : param iters : Number of iterations . <nl> <nl> - : param edge_threshold : Threshold for edges . <nl> <nl> - : param max_disc_threshold : Constant to reject outliers . <nl> <nl> - : param sigma_range : Filter range . <nl> - <nl> - <nl> - <nl> - gpu : : DisparityBilateralFilter : : operator ( ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + gpu : : DisparityBilateralFilter : : apply <nl> + mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> Refines a disparity map using joint bilateral filtering . <nl> <nl> - . . ocv : function : : void gpu : : DisparityBilateralFilter : : operator ( ) ( const GpuMat & disparity , const GpuMat & image , GpuMat & dst , Stream & stream = Stream : : Null ( ) ) <nl> + . . ocv : function : : void gpu : : DisparityBilateralFilter : : apply ( InputArray disparity , InputArray image , OutputArray dst , Stream & stream = Stream : : Null ( ) ) <nl> <nl> : param disparity : Input disparity map . ` ` CV_8UC1 ` ` and ` ` CV_16SC1 ` ` types are supported . <nl> <nl> Refines a disparity map using joint bilateral filtering . <nl> <nl> <nl> <nl> - gpu : : drawColorDisp <nl> mmmmmmmmmmmmmmmmmmmmm - - <nl> - Colors a disparity image . <nl> + gpu : : reprojectImageTo3D <nl> + mmmmmmmmmmmmmmmmmmmmm - - <nl> + Reprojects a disparity image to 3D space . <nl> <nl> - . . ocv : function : : void gpu : : drawColorDisp ( const GpuMat & src_disp , GpuMat & dst_disp , int ndisp , Stream & stream = Stream : : Null ( ) ) <nl> + . . ocv : function : : void gpu : : reprojectImageTo3D ( InputArray disp , OutputArray xyzw , InputArray Q , int dst_cn = 4 , Stream & stream = Stream : : Null ( ) ) <nl> <nl> - : param src_disp : Source disparity image . ` ` CV_8UC1 ` ` and ` ` CV_16SC1 ` ` types are supported . <nl> + : param disp : Input disparity image . ` ` CV_8U ` ` and ` ` CV_16S ` ` types are supported . <nl> <nl> - : param dst_disp : Output disparity image . It has the same size as ` ` src_disp ` ` . The type is ` ` CV_8UC4 ` ` in ` ` BGRA ` ` format ( alpha = 255 ) . <nl> + : param xyzw : Output 3 - or 4 - channel floating - point image of the same size as ` ` disp ` ` . Each element of ` ` xyzw ( x , y ) ` ` contains 3D coordinates ` ` ( x , y , z ) ` ` or ` ` ( x , y , z , 1 ) ` ` of the point ` ` ( x , y ) ` ` , computed from the disparity map . <nl> <nl> - : param ndisp : Number of disparities . <nl> + : param Q : : math : ` 4 \ times 4 ` perspective transformation matrix that can be obtained via : ocv : func : ` stereoRectify ` . <nl> <nl> - : param stream : Stream for the asynchronous version . <nl> + : param dst_cn : The number of channels for output image . Can be 3 or 4 . <nl> <nl> - This function draws a colored disparity map by converting disparity values from ` ` [ 0 . . ndisp ) ` ` interval first to ` ` HSV ` ` color space ( where different disparity values correspond to different hues ) and then converting the pixels to ` ` RGB ` ` for visualization . <nl> + : param stream : Stream for the asynchronous version . <nl> <nl> + . . seealso : : : ocv : func : ` reprojectImageTo3D ` <nl> <nl> <nl> - gpu : : reprojectImageTo3D <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> - Reprojects a disparity image to 3D space . <nl> <nl> - . . ocv : function : : void gpu : : reprojectImageTo3D ( const GpuMat & disp , GpuMat & xyzw , const Mat & Q , int dst_cn = 4 , Stream & stream = Stream : : Null ( ) ) <nl> + gpu : : drawColorDisp <nl> + mmmmmmmmmmmmmmmmmm <nl> + Colors a disparity image . <nl> <nl> - : param disp : Input disparity image . ` ` CV_8U ` ` and ` ` CV_16S ` ` types are supported . <nl> + . . ocv : function : : void gpu : : drawColorDisp ( InputArray src_disp , OutputArray dst_disp , int ndisp , Stream & stream = Stream : : Null ( ) ) <nl> <nl> - : param xyzw : Output 3 - or 4 - channel floating - point image of the same size as ` ` disp ` ` . Each element of ` ` xyzw ( x , y ) ` ` contains 3D coordinates ` ` ( x , y , z ) ` ` or ` ` ( x , y , z , 1 ) ` ` of the point ` ` ( x , y ) ` ` , computed from the disparity map . <nl> + : param src_disp : Source disparity image . ` ` CV_8UC1 ` ` and ` ` CV_16SC1 ` ` types are supported . <nl> <nl> - : param Q : : math : ` 4 \ times 4 ` perspective transformation matrix that can be obtained via : ocv : func : ` stereoRectify ` . <nl> + : param dst_disp : Output disparity image . It has the same size as ` ` src_disp ` ` . The type is ` ` CV_8UC4 ` ` in ` ` BGRA ` ` format ( alpha = 255 ) . <nl> <nl> - : param dst_cn : The number of channels for output image . Can be 3 or 4 . <nl> + : param ndisp : Number of disparities . <nl> <nl> : param stream : Stream for the asynchronous version . <nl> <nl> - . . seealso : : : ocv : func : ` reprojectImageTo3D ` <nl> + This function draws a colored disparity map by converting disparity values from ` ` [ 0 . . ndisp ) ` ` interval first to ` ` HSV ` ` color space ( where different disparity values correspond to different hues ) and then converting the pixels to ` ` RGB ` ` for visualization . <nl> <nl> <nl> <nl> . . [ Felzenszwalb2006 ] Pedro F . Felzenszwalb algorithm [ Pedro F . Felzenszwalb and Daniel P . Huttenlocher . * Efficient belief propagation for early vision * . International Journal of Computer Vision , 70 ( 1 ) , October 2006 <nl> - <nl> . . [ Yang2010 ] Q . Yang , L . Wang , and N . Ahuja . * A constant - space belief propagation algorithm for stereo matching * . In CVPR , 2010 . <nl> mmm a / modules / gpustereo / include / opencv2 / gpustereo . hpp <nl> ppp b / modules / gpustereo / include / opencv2 / gpustereo . hpp <nl> class CV_EXPORTS StereoBeliefPropagation : public cv : : StereoMatcher <nl> virtual double getDiscSingleJump ( ) const = 0 ; <nl> virtual void setDiscSingleJump ( double disc_single_jump ) = 0 ; <nl> <nl> + / / ! type for messages ( CV_16SC1 or CV_32FC1 ) <nl> virtual int getMsgType ( ) const = 0 ; <nl> virtual void setMsgType ( int msg_type ) = 0 ; <nl> <nl>
updated documentation
opencv/opencv
4e29f0ee6d9c57ea22068b8bc0c99c2414816b50
2013-06-18T04:36:49Z
mmm a / src / compiler / ia32 / code - generator - ia32 . cc <nl> ppp b / src / compiler / ia32 / code - generator - ia32 . cc <nl> void CodeGenerator : : AssembleArchInstruction ( Instruction * instr ) { <nl> case kCheckedStoreFloat64 : <nl> ASSEMBLE_CHECKED_STORE_FLOAT ( movsd ) ; <nl> break ; <nl> + case kIA32StackCheck : { <nl> + ExternalReference const stack_limit = <nl> + ExternalReference : : address_of_stack_limit ( isolate ( ) ) ; <nl> + __ cmp ( esp , Operand : : StaticVariable ( stack_limit ) ) ; <nl> + break ; <nl> + } <nl> } <nl> } <nl> <nl> mmm a / src / compiler / ia32 / instruction - codes - ia32 . h <nl> ppp b / src / compiler / ia32 / instruction - codes - ia32 . h <nl> namespace compiler { <nl> V ( IA32Movsd ) \ <nl> V ( IA32Lea ) \ <nl> V ( IA32Push ) \ <nl> - V ( IA32StoreWriteBarrier ) <nl> + V ( IA32StoreWriteBarrier ) \ <nl> + V ( IA32StackCheck ) <nl> <nl> <nl> / / Addressing modes represent the " shape " of inputs to an instruction . <nl> mmm a / src / compiler / ia32 / instruction - selector - ia32 . cc <nl> ppp b / src / compiler / ia32 / instruction - selector - ia32 . cc <nl> void VisitWordCompare ( InstructionSelector * selector , Node * node , <nl> <nl> void VisitWordCompare ( InstructionSelector * selector , Node * node , <nl> FlagsContinuation * cont ) { <nl> + IA32OperandGenerator g ( selector ) ; <nl> + Int32BinopMatcher m ( node ) ; <nl> + if ( m . left ( ) . IsLoad ( ) & & m . right ( ) . IsLoadStackPointer ( ) ) { <nl> + LoadMatcher < ExternalReferenceMatcher > mleft ( m . left ( ) . node ( ) ) ; <nl> + ExternalReference js_stack_limit = <nl> + ExternalReference : : address_of_stack_limit ( selector - > isolate ( ) ) ; <nl> + if ( mleft . object ( ) . Is ( js_stack_limit ) & & mleft . index ( ) . Is ( 0 ) ) { <nl> + / / Compare ( Load ( js_stack_limit ) , LoadStackPointer ) <nl> + if ( ! node - > op ( ) - > HasProperty ( Operator : : kCommutative ) ) cont - > Commute ( ) ; <nl> + InstructionCode opcode = cont - > Encode ( kIA32StackCheck ) ; <nl> + if ( cont - > IsBranch ( ) ) { <nl> + selector - > Emit ( opcode , g . NoOutput ( ) , g . Label ( cont - > true_block ( ) ) , <nl> + g . Label ( cont - > false_block ( ) ) ) - > MarkAsControl ( ) ; <nl> + } else { <nl> + DCHECK ( cont - > IsSet ( ) ) ; <nl> + selector - > Emit ( opcode , g . DefineAsRegister ( cont - > result ( ) ) ) ; <nl> + } <nl> + return ; <nl> + } <nl> + } <nl> VisitWordCompare ( selector , node , kIA32Cmp , cont ) ; <nl> } <nl> <nl> mmm a / src / compiler / instruction - selector . h <nl> ppp b / src / compiler / instruction - selector . h <nl> class InstructionSelector FINAL { <nl> int GetVirtualRegister ( const Node * node ) ; <nl> const std : : map < NodeId , int > GetVirtualRegistersForTesting ( ) const ; <nl> <nl> + Isolate * isolate ( ) const { return sequence ( ) - > isolate ( ) ; } <nl> + <nl> private : <nl> friend class OperandGenerator ; <nl> <nl> mmm a / src / compiler / node - matchers . h <nl> ppp b / src / compiler / node - matchers . h <nl> <nl> <nl> # include < cmath > <nl> <nl> + / / TODO ( turbofan ) : Move ExternalReference out of assembler . h <nl> + # include " src / assembler . h " <nl> # include " src / compiler / node . h " <nl> # include " src / compiler / operator . h " <nl> # include " src / unique . h " <nl> struct HeapObjectMatcher FINAL <nl> } ; <nl> <nl> <nl> + / / A pattern matcher for external reference constants . <nl> + struct ExternalReferenceMatcher FINAL <nl> + : public ValueMatcher < ExternalReference , IrOpcode : : kExternalConstant > { <nl> + explicit ExternalReferenceMatcher ( Node * node ) <nl> + : ValueMatcher < ExternalReference , IrOpcode : : kExternalConstant > ( node ) { } <nl> + } ; <nl> + <nl> + <nl> + / / For shorter pattern matching code , this struct matches the inputs to <nl> + / / machine - level load operations . <nl> + template < typename Object > <nl> + struct LoadMatcher : public NodeMatcher { <nl> + explicit LoadMatcher ( Node * node ) <nl> + : NodeMatcher ( node ) , object_ ( InputAt ( 0 ) ) , index_ ( InputAt ( 1 ) ) { } <nl> + <nl> + typedef Object ObjectMatcher ; <nl> + <nl> + Object const & object ( ) const { return object_ ; } <nl> + IntPtrMatcher const & index ( ) const { return index_ ; } <nl> + <nl> + private : <nl> + Object const object_ ; <nl> + IntPtrMatcher const index_ ; <nl> + } ; <nl> + <nl> + <nl> / / For shorter pattern matching code , this struct matches both the left and <nl> / / right hand sides of a binary operation and can put constants on the right <nl> / / if they appear on the left hand side of a commutative operation . <nl> mmm a / src / compiler / raw - machine - assembler . h <nl> ppp b / src / compiler / raw - machine - assembler . h <nl> class RawMachineAssembler : public GraphBuilder { <nl> Unique < HeapObject > val = Unique < HeapObject > : : CreateUninitialized ( object ) ; <nl> return NewNode ( common ( ) - > HeapConstant ( val ) ) ; <nl> } <nl> + Node * ExternalConstant ( ExternalReference address ) { <nl> + return NewNode ( common ( ) - > ExternalConstant ( address ) ) ; <nl> + } <nl> <nl> Node * Projection ( int index , Node * a ) { <nl> return NewNode ( common ( ) - > Projection ( index ) , a ) ; <nl> class RawMachineAssembler : public GraphBuilder { <nl> <nl> / / Memory Operations . <nl> Node * Load ( MachineType rep , Node * base ) { <nl> - return Load ( rep , base , Int32Constant ( 0 ) ) ; <nl> + return Load ( rep , base , IntPtrConstant ( 0 ) ) ; <nl> } <nl> Node * Load ( MachineType rep , Node * base , Node * index ) { <nl> return NewNode ( machine ( ) - > Load ( rep ) , base , index , graph ( ) - > start ( ) , <nl> graph ( ) - > start ( ) ) ; <nl> } <nl> void Store ( MachineType rep , Node * base , Node * value ) { <nl> - Store ( rep , base , Int32Constant ( 0 ) , value ) ; <nl> + Store ( rep , base , IntPtrConstant ( 0 ) , value ) ; <nl> } <nl> void Store ( MachineType rep , Node * base , Node * index , Node * value ) { <nl> NewNode ( machine ( ) - > Store ( StoreRepresentation ( rep , kNoWriteBarrier ) ) , base , <nl> class RawMachineAssembler : public GraphBuilder { <nl> Node * Int64LessThan ( Node * a , Node * b ) { <nl> return NewNode ( machine ( ) - > Int64LessThan ( ) , a , b ) ; <nl> } <nl> + Node * Uint64LessThan ( Node * a , Node * b ) { <nl> + return NewNode ( machine ( ) - > Uint64LessThan ( ) , a , b ) ; <nl> + } <nl> Node * Int64LessThanOrEqual ( Node * a , Node * b ) { <nl> return NewNode ( machine ( ) - > Int64LessThanOrEqual ( ) , a , b ) ; <nl> } <nl> class RawMachineAssembler : public GraphBuilder { <nl> return NewNode ( machine ( ) - > Float64InsertHighWord32 ( ) , a , b ) ; <nl> } <nl> <nl> + / / Stack operations . <nl> + Node * LoadStackPointer ( ) { return NewNode ( machine ( ) - > LoadStackPointer ( ) ) ; } <nl> + <nl> / / Parameters . <nl> Node * Parameter ( size_t index ) ; <nl> <nl> mmm a / src / compiler / x64 / code - generator - x64 . cc <nl> ppp b / src / compiler / x64 / code - generator - x64 . cc <nl> void CodeGenerator : : AssembleArchInstruction ( Instruction * instr ) { <nl> case kCheckedStoreFloat64 : <nl> ASSEMBLE_CHECKED_STORE_FLOAT ( movsd ) ; <nl> break ; <nl> + case kX64StackCheck : <nl> + __ CompareRoot ( rsp , Heap : : kStackLimitRootIndex ) ; <nl> + break ; <nl> } <nl> } / / NOLINT ( readability / fn_size ) <nl> <nl> mmm a / src / compiler / x64 / instruction - codes - x64 . h <nl> ppp b / src / compiler / x64 / instruction - codes - x64 . h <nl> namespace compiler { <nl> V ( X64Dec32 ) \ <nl> V ( X64Inc32 ) \ <nl> V ( X64Push ) \ <nl> - V ( X64StoreWriteBarrier ) <nl> + V ( X64StoreWriteBarrier ) \ <nl> + V ( X64StackCheck ) <nl> <nl> <nl> / / Addressing modes represent the " shape " of inputs to an instruction . <nl> mmm a / src / compiler / x64 / instruction - selector - x64 . cc <nl> ppp b / src / compiler / x64 / instruction - selector - x64 . cc <nl> void InstructionSelector : : VisitCall ( Node * node , BasicBlock * handler ) { <nl> } <nl> <nl> <nl> + namespace { <nl> + <nl> / / Shared routine for multiple compare operations . <nl> - static void VisitCompare ( InstructionSelector * selector , InstructionCode opcode , <nl> - InstructionOperand left , InstructionOperand right , <nl> - FlagsContinuation * cont ) { <nl> + void VisitCompare ( InstructionSelector * selector , InstructionCode opcode , <nl> + InstructionOperand left , InstructionOperand right , <nl> + FlagsContinuation * cont ) { <nl> X64OperandGenerator g ( selector ) ; <nl> opcode = cont - > Encode ( opcode ) ; <nl> if ( cont - > IsBranch ( ) ) { <nl> static void VisitCompare ( InstructionSelector * selector , InstructionCode opcode , <nl> <nl> <nl> / / Shared routine for multiple compare operations . <nl> - static void VisitCompare ( InstructionSelector * selector , InstructionCode opcode , <nl> - Node * left , Node * right , FlagsContinuation * cont , <nl> - bool commutative ) { <nl> + void VisitCompare ( InstructionSelector * selector , InstructionCode opcode , <nl> + Node * left , Node * right , FlagsContinuation * cont , <nl> + bool commutative ) { <nl> X64OperandGenerator g ( selector ) ; <nl> if ( commutative & & g . CanBeBetterLeftOperand ( right ) ) { <nl> std : : swap ( left , right ) ; <nl> static void VisitCompare ( InstructionSelector * selector , InstructionCode opcode , <nl> <nl> <nl> / / Shared routine for multiple word compare operations . <nl> - static void VisitWordCompare ( InstructionSelector * selector , Node * node , <nl> - InstructionCode opcode , FlagsContinuation * cont ) { <nl> + void VisitWordCompare ( InstructionSelector * selector , Node * node , <nl> + InstructionCode opcode , FlagsContinuation * cont ) { <nl> X64OperandGenerator g ( selector ) ; <nl> Node * const left = node - > InputAt ( 0 ) ; <nl> Node * const right = node - > InputAt ( 1 ) ; <nl> static void VisitWordCompare ( InstructionSelector * selector , Node * node , <nl> } <nl> <nl> <nl> + / / Shared routine for 64 - bit word comparison operations . <nl> + void VisitWord64Compare ( InstructionSelector * selector , Node * node , <nl> + FlagsContinuation * cont ) { <nl> + X64OperandGenerator g ( selector ) ; <nl> + Int64BinopMatcher m ( node ) ; <nl> + if ( m . left ( ) . IsLoad ( ) & & m . right ( ) . IsLoadStackPointer ( ) ) { <nl> + LoadMatcher < ExternalReferenceMatcher > mleft ( m . left ( ) . node ( ) ) ; <nl> + ExternalReference js_stack_limit = <nl> + ExternalReference : : address_of_stack_limit ( selector - > isolate ( ) ) ; <nl> + if ( mleft . object ( ) . Is ( js_stack_limit ) & & mleft . index ( ) . Is ( 0 ) ) { <nl> + / / Compare ( Load ( js_stack_limit ) , LoadStackPointer ) <nl> + if ( ! node - > op ( ) - > HasProperty ( Operator : : kCommutative ) ) cont - > Commute ( ) ; <nl> + InstructionCode opcode = cont - > Encode ( kX64StackCheck ) ; <nl> + if ( cont - > IsBranch ( ) ) { <nl> + selector - > Emit ( opcode , g . NoOutput ( ) , g . Label ( cont - > true_block ( ) ) , <nl> + g . Label ( cont - > false_block ( ) ) ) - > MarkAsControl ( ) ; <nl> + } else { <nl> + DCHECK ( cont - > IsSet ( ) ) ; <nl> + selector - > Emit ( opcode , g . DefineAsRegister ( cont - > result ( ) ) ) ; <nl> + } <nl> + return ; <nl> + } <nl> + } <nl> + VisitWordCompare ( selector , node , kX64Cmp , cont ) ; <nl> + } <nl> + <nl> + <nl> / / Shared routine for comparison with zero . <nl> - static void VisitCompareZero ( InstructionSelector * selector , Node * node , <nl> - InstructionCode opcode , FlagsContinuation * cont ) { <nl> + void VisitCompareZero ( InstructionSelector * selector , Node * node , <nl> + InstructionCode opcode , FlagsContinuation * cont ) { <nl> X64OperandGenerator g ( selector ) ; <nl> VisitCompare ( selector , opcode , g . Use ( node ) , g . TempImmediate ( 0 ) , cont ) ; <nl> } <nl> <nl> <nl> / / Shared routine for multiple float64 compare operations ( inputs commuted ) . <nl> - static void VisitFloat64Compare ( InstructionSelector * selector , Node * node , <nl> - FlagsContinuation * cont ) { <nl> + void VisitFloat64Compare ( InstructionSelector * selector , Node * node , <nl> + FlagsContinuation * cont ) { <nl> Node * const left = node - > InputAt ( 0 ) ; <nl> Node * const right = node - > InputAt ( 1 ) ; <nl> VisitCompare ( selector , kSSEFloat64Cmp , right , left , cont , false ) ; <nl> } <nl> <nl> + } / / namespace <nl> + <nl> <nl> void InstructionSelector : : VisitBranch ( Node * branch , BasicBlock * tbranch , <nl> BasicBlock * fbranch ) { <nl> void InstructionSelector : : VisitBranch ( Node * branch , BasicBlock * tbranch , <nl> return VisitWordCompare ( this , value , kX64Cmp32 , & cont ) ; <nl> case IrOpcode : : kWord64Equal : <nl> cont . OverwriteAndNegateIfEqual ( kEqual ) ; <nl> - return VisitWordCompare ( this , value , kX64Cmp , & cont ) ; <nl> + return VisitWord64Compare ( this , value , & cont ) ; <nl> case IrOpcode : : kInt64LessThan : <nl> cont . OverwriteAndNegateIfEqual ( kSignedLessThan ) ; <nl> - return VisitWordCompare ( this , value , kX64Cmp , & cont ) ; <nl> + return VisitWord64Compare ( this , value , & cont ) ; <nl> case IrOpcode : : kInt64LessThanOrEqual : <nl> cont . OverwriteAndNegateIfEqual ( kSignedLessThanOrEqual ) ; <nl> - return VisitWordCompare ( this , value , kX64Cmp , & cont ) ; <nl> + return VisitWord64Compare ( this , value , & cont ) ; <nl> case IrOpcode : : kUint64LessThan : <nl> cont . OverwriteAndNegateIfEqual ( kUnsignedLessThan ) ; <nl> - return VisitWordCompare ( this , value , kX64Cmp , & cont ) ; <nl> + return VisitWord64Compare ( this , value , & cont ) ; <nl> case IrOpcode : : kFloat64Equal : <nl> cont . OverwriteAndNegateIfEqual ( kUnorderedEqual ) ; <nl> return VisitFloat64Compare ( this , value , & cont ) ; <nl> void InstructionSelector : : VisitBranch ( Node * branch , BasicBlock * tbranch , <nl> case IrOpcode : : kInt32Sub : <nl> return VisitWordCompare ( this , value , kX64Cmp32 , & cont ) ; <nl> case IrOpcode : : kInt64Sub : <nl> - return VisitWordCompare ( this , value , kX64Cmp , & cont ) ; <nl> + return VisitWord64Compare ( this , value , & cont ) ; <nl> case IrOpcode : : kWord32And : <nl> return VisitWordCompare ( this , value , kX64Test32 , & cont ) ; <nl> case IrOpcode : : kWord64And : <nl> void InstructionSelector : : VisitWord64Equal ( Node * const node ) { <nl> if ( CanCover ( user , value ) ) { <nl> switch ( value - > opcode ( ) ) { <nl> case IrOpcode : : kInt64Sub : <nl> - return VisitWordCompare ( this , value , kX64Cmp , & cont ) ; <nl> + return VisitWord64Compare ( this , value , & cont ) ; <nl> case IrOpcode : : kWord64And : <nl> return VisitWordCompare ( this , value , kX64Test , & cont ) ; <nl> default : <nl> void InstructionSelector : : VisitWord64Equal ( Node * const node ) { <nl> } <nl> return VisitCompareZero ( this , value , kX64Cmp , & cont ) ; <nl> } <nl> - VisitWordCompare ( this , node , kX64Cmp , & cont ) ; <nl> + VisitWord64Compare ( this , node , & cont ) ; <nl> } <nl> <nl> <nl> void InstructionSelector : : VisitInt32SubWithOverflow ( Node * node ) { <nl> <nl> void InstructionSelector : : VisitInt64LessThan ( Node * node ) { <nl> FlagsContinuation cont ( kSignedLessThan , node ) ; <nl> - VisitWordCompare ( this , node , kX64Cmp , & cont ) ; <nl> + VisitWord64Compare ( this , node , & cont ) ; <nl> } <nl> <nl> <nl> void InstructionSelector : : VisitInt64LessThanOrEqual ( Node * node ) { <nl> FlagsContinuation cont ( kSignedLessThanOrEqual , node ) ; <nl> - VisitWordCompare ( this , node , kX64Cmp , & cont ) ; <nl> + VisitWord64Compare ( this , node , & cont ) ; <nl> } <nl> <nl> <nl> void InstructionSelector : : VisitUint64LessThan ( Node * node ) { <nl> FlagsContinuation cont ( kUnsignedLessThan , node ) ; <nl> - VisitWordCompare ( this , node , kX64Cmp , & cont ) ; <nl> + VisitWord64Compare ( this , node , & cont ) ; <nl> } <nl> <nl> <nl> mmm a / test / unittests / compiler / ia32 / instruction - selector - ia32 - unittest . cc <nl> ppp b / test / unittests / compiler / ia32 / instruction - selector - ia32 - unittest . cc <nl> TEST_F ( InstructionSelectorTest , Float64BinopArithmetic ) { <nl> } <nl> } <nl> <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + / / Miscellaneous . <nl> + <nl> + <nl> + TEST_F ( InstructionSelectorTest , Uint32LessThanWithLoadAndLoadStackPointer ) { <nl> + StreamBuilder m ( this , kMachBool ) ; <nl> + Node * const sl = m . Load ( <nl> + kMachPtr , <nl> + m . ExternalConstant ( ExternalReference : : address_of_stack_limit ( isolate ( ) ) ) ) ; <nl> + Node * const sp = m . LoadStackPointer ( ) ; <nl> + Node * const n = m . Uint32LessThan ( sl , sp ) ; <nl> + m . Return ( n ) ; <nl> + Stream s = m . Build ( ) ; <nl> + ASSERT_EQ ( 1U , s . size ( ) ) ; <nl> + EXPECT_EQ ( kIA32StackCheck , s [ 0 ] - > arch_opcode ( ) ) ; <nl> + ASSERT_EQ ( 0U , s [ 0 ] - > InputCount ( ) ) ; <nl> + ASSERT_EQ ( 1U , s [ 0 ] - > OutputCount ( ) ) ; <nl> + EXPECT_EQ ( s . ToVreg ( n ) , s . ToVreg ( s [ 0 ] - > Output ( ) ) ) ; <nl> + EXPECT_EQ ( kFlags_set , s [ 0 ] - > flags_mode ( ) ) ; <nl> + EXPECT_EQ ( kUnsignedGreaterThan , s [ 0 ] - > flags_condition ( ) ) ; <nl> + } <nl> + <nl> } / / namespace compiler <nl> } / / namespace internal <nl> } / / namespace v8 <nl> mmm a / test / unittests / compiler / x64 / instruction - selector - x64 - unittest . cc <nl> ppp b / test / unittests / compiler / x64 / instruction - selector - x64 - unittest . cc <nl> TEST_F ( InstructionSelectorTest , Float64BinopArithmetic ) { <nl> / / Miscellaneous . <nl> <nl> <nl> + TEST_F ( InstructionSelectorTest , Uint64LessThanWithLoadAndLoadStackPointer ) { <nl> + StreamBuilder m ( this , kMachBool ) ; <nl> + Node * const sl = m . Load ( <nl> + kMachPtr , <nl> + m . ExternalConstant ( ExternalReference : : address_of_stack_limit ( isolate ( ) ) ) ) ; <nl> + Node * const sp = m . LoadStackPointer ( ) ; <nl> + Node * const n = m . Uint64LessThan ( sl , sp ) ; <nl> + m . Return ( n ) ; <nl> + Stream s = m . Build ( ) ; <nl> + ASSERT_EQ ( 1U , s . size ( ) ) ; <nl> + EXPECT_EQ ( kX64StackCheck , s [ 0 ] - > arch_opcode ( ) ) ; <nl> + ASSERT_EQ ( 0U , s [ 0 ] - > InputCount ( ) ) ; <nl> + ASSERT_EQ ( 1U , s [ 0 ] - > OutputCount ( ) ) ; <nl> + EXPECT_EQ ( s . ToVreg ( n ) , s . ToVreg ( s [ 0 ] - > Output ( ) ) ) ; <nl> + EXPECT_EQ ( kFlags_set , s [ 0 ] - > flags_mode ( ) ) ; <nl> + EXPECT_EQ ( kUnsignedGreaterThan , s [ 0 ] - > flags_condition ( ) ) ; <nl> + } <nl> + <nl> + <nl> TEST_F ( InstructionSelectorTest , Word64ShlWithChangeInt32ToInt64 ) { <nl> TRACED_FORRANGE ( int64_t , x , 32 , 63 ) { <nl> StreamBuilder m ( this , kMachInt64 , kMachInt32 ) ; <nl>
[ x86 ] Faster / shorter code for stack checks .
v8/v8
d18bfa11308ec056ca5a4ad1a7bb63fa519e37b9
2015-03-09T11:06:45Z
mmm a / xbmc / guilib / Geometry . h <nl> ppp b / xbmc / guilib / Geometry . h <nl> class CRect <nl> <nl> std : : vector < CRect > SubtractRect ( CRect splitterRect ) <nl> { <nl> - # define ADD_RECT_ABOVE_INTERSECTION ( add ) \ <nl> - { \ <nl> - add = CRect ( x1 , y1 , x2 , intersection . y1 ) ; \ <nl> - newRectaglesList . push_back ( add ) ; \ <nl> - } <nl> - # define ADD_RECT_BELOW_INTERSECTION ( add ) \ <nl> - { \ <nl> - add = CRect ( x1 , intersection . y2 , x2 , y2 ) ; \ <nl> - newRectaglesList . push_back ( add ) ; \ <nl> - } <nl> - # define ADD_RECT_LEFT_OF_INTERSECTION ( add ) \ <nl> - { \ <nl> - add = CRect ( x1 , intersection . y1 , intersection . x1 , intersection . y2 ) ; \ <nl> - newRectaglesList . push_back ( add ) ; \ <nl> - } <nl> - # define ADD_RECT_RIGHT_OF_INTERSECTION ( add ) \ <nl> - { \ <nl> - add = CRect ( intersection . x2 , intersection . y1 , x2 , intersection . y2 ) ; \ <nl> - newRectaglesList . push_back ( add ) ; \ <nl> - } <nl> - <nl> std : : vector < CRect > newRectaglesList ; <nl> CRect intersection = splitterRect . Intersect ( * this ) ; <nl> <nl> if ( ! intersection . IsEmpty ( ) ) <nl> { <nl> CRect add ; <nl> - / / intersection rect upper edge <nl> - if ( intersection . y1 = = y1 ) / / y starts with baserect <nl> - { <nl> - / / intersection rect lower edge <nl> - if ( intersection . y2 = = y2 ) / / y goes down to baserect <nl> - { <nl> - if ( intersection . x1 = = x1 ) / / x starts with baserect <nl> - { <nl> - if ( intersection . x2 = = x2 ) / / x ends with baserect <nl> - { / / result 100 % covered <nl> - / / add nothing <nl> - } <nl> - else / / x ends in baserect <nl> - { / / results in 1 rect <nl> - ADD_RECT_RIGHT_OF_INTERSECTION ( add ) ; <nl> - } <nl> - } <nl> - else / / x starts in baserect <nl> - { <nl> - if ( intersection . x2 = = x2 ) / / x ends with baserect <nl> - { / / results in 1 rect <nl> - ADD_RECT_LEFT_OF_INTERSECTION ( add ) ; <nl> - } <nl> - else / / x ends in baserect <nl> - { / / results in 2 rects <nl> - ADD_RECT_LEFT_OF_INTERSECTION ( add ) ; <nl> - ADD_RECT_RIGHT_OF_INTERSECTION ( add ) ; <nl> - } <nl> - } <nl> - } <nl> - else / / y ends in baserect <nl> - { <nl> - if ( intersection . x1 = = x1 ) / / x starts with baserect <nl> - { <nl> - if ( intersection . x2 = = x2 ) / / x ends with baserect <nl> - { / / results in 1 rect , below intersection <nl> - ADD_RECT_BELOW_INTERSECTION ( add ) ; <nl> - } <nl> - else / / x ends in baserect <nl> - { / / results in 2 rects <nl> - ADD_RECT_BELOW_INTERSECTION ( add ) ; <nl> - ADD_RECT_RIGHT_OF_INTERSECTION ( add ) ; <nl> - } <nl> - } <nl> - else / / x starts in baserect <nl> - { <nl> - if ( intersection . x2 = = x2 ) / / x ends with baserect <nl> - { / / results in 2 rects <nl> - ADD_RECT_BELOW_INTERSECTION ( add ) ; <nl> - ADD_RECT_LEFT_OF_INTERSECTION ( add ) ; <nl> - } <nl> - else / / x ends in baserect <nl> - { / / results in 3 rects <nl> - ADD_RECT_BELOW_INTERSECTION ( add ) ; <nl> - ADD_RECT_LEFT_OF_INTERSECTION ( add ) ; <nl> - ADD_RECT_RIGHT_OF_INTERSECTION ( add ) ; <nl> - } <nl> - } <nl> - } <nl> - } <nl> - else / / y starts in baserect <nl> - { <nl> - / / intersection rect lower edge <nl> - if ( intersection . y2 = = y2 ) / / y goes down to baserect <nl> - { <nl> - if ( intersection . x1 = = x1 ) / / xstarts with baserect <nl> - { <nl> - if ( intersection . x2 = = x2 ) / / x ends with baserect <nl> - { / / results in 1 rect above intersection <nl> - ADD_RECT_ABOVE_INTERSECTION ( add ) ; <nl> - } <nl> - else / / x ends in baserect <nl> - { / / results in 2 rects <nl> - ADD_RECT_ABOVE_INTERSECTION ( add ) ; <nl> - ADD_RECT_RIGHT_OF_INTERSECTION ( add ) ; <nl> - } <nl> - } <nl> - else / / x starts in baserect <nl> - { <nl> - if ( intersection . x2 = = x2 ) / / x ends with baserect <nl> - { / / results in 2 rects <nl> - ADD_RECT_ABOVE_INTERSECTION ( add ) ; <nl> - ADD_RECT_LEFT_OF_INTERSECTION ( add ) ; <nl> - } <nl> - else / / x ends in baserect <nl> - { / / results in 3 rects <nl> - ADD_RECT_ABOVE_INTERSECTION ( add ) ; <nl> - ADD_RECT_LEFT_OF_INTERSECTION ( add ) ; <nl> - ADD_RECT_RIGHT_OF_INTERSECTION ( add ) ; <nl> - } <nl> - } <nl> - } <nl> - else / / y ends in baserect <nl> - { <nl> - if ( intersection . x1 = = x1 ) / / x starts with baserect <nl> - { <nl> - if ( intersection . x2 = = x2 ) / / x ends with baserect <nl> - { / / results in 2 rects <nl> - ADD_RECT_ABOVE_INTERSECTION ( add ) ; <nl> - ADD_RECT_BELOW_INTERSECTION ( add ) ; <nl> - } <nl> - else / / x ends in baserect <nl> - { / / results in 3 rects <nl> - ADD_RECT_ABOVE_INTERSECTION ( add ) ; <nl> - ADD_RECT_BELOW_INTERSECTION ( add ) ; <nl> - ADD_RECT_RIGHT_OF_INTERSECTION ( add ) ; <nl> - } <nl> - } <nl> - else / / x starts in baserect <nl> - { <nl> - if ( intersection . x2 = = x2 ) / / x ends with baserect <nl> - { / / results in 3 rects <nl> - ADD_RECT_ABOVE_INTERSECTION ( add ) ; <nl> - ADD_RECT_BELOW_INTERSECTION ( add ) ; <nl> - ADD_RECT_LEFT_OF_INTERSECTION ( add ) ; <nl> - } <nl> - else / / x ends in baserect <nl> - { / / results in 4 rects <nl> - ADD_RECT_ABOVE_INTERSECTION ( add ) ; <nl> - ADD_RECT_BELOW_INTERSECTION ( add ) ; <nl> - ADD_RECT_LEFT_OF_INTERSECTION ( add ) ; <nl> - ADD_RECT_RIGHT_OF_INTERSECTION ( add ) ; <nl> - } <nl> - } <nl> - } <nl> - } <nl> + <nl> + / / add rect above intersection if not empty <nl> + add = CRect ( x1 , y1 , x2 , intersection . y1 ) ; <nl> + if ( ! add . IsEmpty ( ) ) <nl> + newRectaglesList . push_back ( add ) ; <nl> + <nl> + / / add rect below intersection if not empty <nl> + add = CRect ( x1 , intersection . y2 , x2 , y2 ) ; <nl> + if ( ! add . IsEmpty ( ) ) <nl> + newRectaglesList . push_back ( add ) ; <nl> + <nl> + / / add rect left intersection if not empty <nl> + add = CRect ( x1 , intersection . y1 , intersection . x1 , intersection . y2 ) ; <nl> + if ( ! add . IsEmpty ( ) ) <nl> + newRectaglesList . push_back ( add ) ; <nl> + <nl> + / / add rect right intersection if not empty <nl> + add = CRect ( intersection . x2 , intersection . y1 , x2 , intersection . y2 ) ; <nl> + if ( ! add . IsEmpty ( ) ) <nl> + newRectaglesList . push_back ( add ) ; <nl> } <nl> else <nl> { <nl>
refactor SubtractRect for the general case and drop any empty rects . This trades a little efficiency for reducing code complexity
xbmc/xbmc
0ed2e36d663d7c620ccf5af570d191c493b5e098
2012-08-06T14:16:06Z
mmm a / src / third_party / SConscript <nl> ppp b / src / third_party / SConscript <nl> icuSuffix = ' - 57 . 1 ' <nl> gperftoolsSuffix = ' - 2 . 5 ' <nl> timelibSuffix = ' - 2018 . 01alpha1 ' <nl> tomcryptSuffix = ' - 1 . 18 . 1 ' <nl> - benchmarkSuffix = ' - 1 . 4 . 1 ' <nl> + benchmarkSuffix = ' - 1 . 3 . 0 ' <nl> sqliteSuffix = ' - amalgamation - 3190300 ' <nl> <nl> thirdPartyIncludePathList = [ <nl> similarity index 100 % <nl> rename from src / third_party / benchmark - 1 . 4 . 1 / SConscript <nl> rename to src / third_party / benchmark - 1 . 3 . 0 / SConscript <nl> similarity index 72 % <nl> rename from src / third_party / benchmark - 1 . 4 . 1 / benchmark / . gitignore <nl> rename to src / third_party / benchmark - 1 . 3 . 0 / benchmark / . gitignore <nl> mmm a / src / third_party / benchmark - 1 . 4 . 1 / benchmark / . gitignore <nl> ppp b / src / third_party / benchmark - 1 . 3 . 0 / benchmark / . gitignore <nl> <nl> * . dylib <nl> * . cmake <nl> ! / cmake / * . cmake <nl> - ! / test / AssemblyTests . cmake <nl> * ~ <nl> * . pyc <nl> __pycache__ <nl> build . ninja <nl> install_manifest . txt <nl> rules . ninja <nl> <nl> - # bazel output symlinks . <nl> - bazel - * <nl> - <nl> # out - of - source build top - level folders . <nl> build / <nl> _build / <nl> - <nl> - # in - source dependencies <nl> - / googletest / <nl> - <nl> - # Visual Studio 2015 / 2017 cache / options directory <nl> - . vs / <nl> - CMakeSettings . json <nl> similarity index 100 % <nl> rename from src / third_party / benchmark - 1 . 4 . 1 / benchmark / LICENSE <nl> rename to src / third_party / benchmark - 1 . 3 . 0 / benchmark / LICENSE <nl> similarity index 89 % <nl> rename from src / third_party / benchmark - 1 . 4 . 1 / benchmark / README . md <nl> rename to src / third_party / benchmark - 1 . 3 . 0 / benchmark / README . md <nl> mmm a / src / third_party / benchmark - 1 . 4 . 1 / benchmark / README . md <nl> ppp b / src / third_party / benchmark - 1 . 3 . 0 / benchmark / README . md <nl> <nl> [ ! [ Build Status ] ( https : / / travis - ci . org / google / benchmark . svg ? branch = master ) ] ( https : / / travis - ci . org / google / benchmark ) <nl> [ ! [ Build status ] ( https : / / ci . appveyor . com / api / projects / status / u0qsyp7t1tk7cpxs / branch / master ? svg = true ) ] ( https : / / ci . appveyor . com / project / google / benchmark / branch / master ) <nl> [ ! [ Coverage Status ] ( https : / / coveralls . io / repos / google / benchmark / badge . svg ) ] ( https : / / coveralls . io / r / google / benchmark ) <nl> - [ ! [ slackin ] ( https : / / slackin - iqtfqnpzxd . now . sh / badge . svg ) ] ( https : / / slackin - iqtfqnpzxd . now . sh / ) <nl> <nl> A library to support the benchmarking of functions , similar to unit - tests . <nl> <nl> IRC channel : https : / / freenode . net # googlebenchmark <nl> <nl> [ Additional Tooling Documentation ] ( docs / tools . md ) <nl> <nl> - [ Assembly Testing Documentation ] ( docs / AssemblyTests . md ) <nl> - <nl> - <nl> - # # Building <nl> - <nl> - The basic steps for configuring and building the library look like this : <nl> - <nl> - ` ` ` bash <nl> - $ git clone https : / / github . com / google / benchmark . git <nl> - # Benchmark requires Google Test as a dependency . Add the source tree as a subdirectory . <nl> - $ git clone https : / / github . com / google / googletest . git benchmark / googletest <nl> - $ mkdir build & & cd build <nl> - $ cmake - G < generator > [ options ] . . / benchmark <nl> - # Assuming a makefile generator was used <nl> - $ make <nl> - ` ` ` <nl> - <nl> - Note that Google Benchmark requires Google Test to build and run the tests . This <nl> - dependency can be provided two ways : <nl> - <nl> - * Checkout the Google Test sources into ` benchmark / googletest ` as above . <nl> - * Otherwise , if ` - DBENCHMARK_DOWNLOAD_DEPENDENCIES = ON ` is specified during <nl> - configuration , the library will automatically download and build any required <nl> - dependencies . <nl> - <nl> - If you do not wish to build and run the tests , add ` - DBENCHMARK_ENABLE_GTEST_TESTS = OFF ` <nl> - to ` CMAKE_ARGS ` . <nl> - <nl> - <nl> - # # Installation Guide <nl> - <nl> - For Ubuntu and Debian Based System <nl> - <nl> - First make sure you have git and cmake installed ( If not please install it ) <nl> - <nl> - ` ` ` <nl> - sudo apt - get install git <nl> - sudo apt - get install cmake <nl> - ` ` ` <nl> - <nl> - Now , let ' s clone the repository and build it <nl> - <nl> - ` ` ` <nl> - git clone https : / / github . com / google / benchmark . git <nl> - cd benchmark <nl> - git clone https : / / github . com / google / googletest . git <nl> - mkdir build <nl> - cd build <nl> - cmake . . - DCMAKE_BUILD_TYPE = RELEASE <nl> - make <nl> - ` ` ` <nl> - <nl> - We need to install the library globally now <nl> - <nl> - ` ` ` <nl> - sudo make install <nl> - ` ` ` <nl> - <nl> - Now you have google / benchmark installed in your machine <nl> - Note : Don ' t forget to link to pthread library while building <nl> - <nl> - # # Stable and Experimental Library Versions <nl> - <nl> - The main branch contains the latest stable version of the benchmarking library ; <nl> - the API of which can be considered largely stable , with source breaking changes <nl> - being made only upon the release of a new major version . <nl> - <nl> - Newer , experimental , features are implemented and tested on the <nl> - [ ` v2 ` branch ] ( https : / / github . com / google / benchmark / tree / v2 ) . Users who wish <nl> - to use , test , and provide feedback on the new features are encouraged to try <nl> - this branch . However , this branch provides no stability guarantees and reserves <nl> - the right to change and break the API at any time . <nl> - <nl> - # # Prerequisite knowledge <nl> - <nl> - Before attempting to understand this framework one should ideally have some familiarity with the structure and format of the Google Test framework , upon which it is based . Documentation for Google Test , including a " Getting Started " ( primer ) guide , is available here : <nl> - https : / / github . com / google / googletest / blob / master / googletest / docs / Documentation . md <nl> - <nl> - <nl> # # Example usage <nl> # # # Basic usage <nl> Define a function that executes the code to be measured . <nl> BENCHMARK ( BM_StringCopy ) ; <nl> BENCHMARK_MAIN ( ) ; <nl> ` ` ` <nl> <nl> - Don ' t forget to inform your linker to add benchmark library e . g . through <nl> - ` - lbenchmark ` compilation flag . Alternatively , you may leave out the <nl> - ` BENCHMARK_MAIN ( ) ; ` at the end of the source file and link against <nl> - ` - lbenchmark_main ` to get the same default behavior . <nl> - <nl> - The benchmark library will reporting the timing for the code within the ` for ( . . . ) ` loop . <nl> + Don ' t forget to inform your linker to add benchmark library e . g . through ` - lbenchmark ` compilation flag . <nl> <nl> # # # Passing arguments <nl> Sometimes a family of benchmarks can be implemented with just one routine that <nl> BM_SetInsert / 1024 / 10 33157 33648 21431 1 . 13369M <nl> The JSON format outputs human readable json split into two top level attributes . <nl> The ` context ` attribute contains information about the run in general , including <nl> information about the CPU and the date . <nl> - The ` benchmarks ` attribute contains a list of every benchmark run . Example json <nl> + The ` benchmarks ` attribute contains a list of ever benchmark run . Example json <nl> output looks like : <nl> ` ` ` json <nl> { <nl> To enable link - time optimisation , use <nl> cmake - DCMAKE_BUILD_TYPE = Release - DBENCHMARK_ENABLE_LTO = true <nl> ` ` ` <nl> <nl> - If you are using gcc , you might need to set ` GCC_AR ` and ` GCC_RANLIB ` cmake cache variables , if autodetection fails . <nl> - If you are using clang , you may need to set ` LLVMAR_EXECUTABLE ` , ` LLVMNM_EXECUTABLE ` and ` LLVMRANLIB_EXECUTABLE ` cmake cache variables . <nl> - <nl> # # Linking against the library <nl> - <nl> - When the library is built using GCC it is necessary to link with ` - pthread ` , <nl> - due to how GCC implements ` std : : thread ` . <nl> - <nl> - For GCC 4 . x failing to link to pthreads will lead to runtime exceptions , not linker errors . <nl> + When using gcc , it is necessary to link against pthread to avoid runtime exceptions . <nl> + This is due to how gcc implements std : : thread . <nl> See [ issue # 67 ] ( https : / / github . com / google / benchmark / issues / 67 ) for more details . <nl> <nl> # # Compiler Support <nl> sudo cpupower frequency - set - - governor powersave <nl> <nl> # Known Issues <nl> <nl> - # # # Windows with CMake <nl> + # # # Windows <nl> <nl> * Users must manually link ` shlwapi . lib ` . Failure to do so may result <nl> in unresolved symbols . <nl> <nl> - # # # Solaris <nl> - <nl> - * Users must explicitly link with kstat library ( - lkstat compilation flag ) . <nl> similarity index 90 % <nl> rename from src / third_party / benchmark - 1 . 4 . 1 / benchmark / include / benchmark / benchmark . h <nl> rename to src / third_party / benchmark - 1 . 3 . 0 / benchmark / include / benchmark / benchmark . h <nl> mmm a / src / third_party / benchmark - 1 . 4 . 1 / benchmark / include / benchmark / benchmark . h <nl> ppp b / src / third_party / benchmark - 1 . 3 . 0 / benchmark / include / benchmark / benchmark . h <nl> BENCHMARK ( BM_test ) - > Unit ( benchmark : : kMillisecond ) ; <nl> <nl> # include < stdint . h > <nl> <nl> - # include < algorithm > <nl> # include < cassert > <nl> # include < cstddef > <nl> # include < iosfwd > <nl> BENCHMARK ( BM_test ) - > Unit ( benchmark : : kMillisecond ) ; <nl> # define BENCHMARK_NOEXCEPT_OP ( x ) noexcept ( x ) <nl> # elif defined ( _MSC_VER ) & & ! defined ( __clang__ ) <nl> # define BENCHMARK_UNUSED <nl> - # define BENCHMARK_ALWAYS_INLINE __forceinline <nl> + / / MONGO HACK : SERVER - 32908 work around old MSVC bug , which was fixed as of MSVC 1913 . <nl> + / / See discussion here for more detail : https : / / github . com / google / benchmark / pull / 493 <nl> + # define BENCHMARK_ALWAYS_INLINE <nl> # if _MSC_VER > = 1900 <nl> # define BENCHMARK_NOEXCEPT noexcept <nl> # define BENCHMARK_NOEXCEPT_OP ( x ) noexcept ( x ) <nl> BENCHMARK_UNUSED static int stream_init_anchor = InitializeStreams ( ) ; <nl> <nl> <nl> # if ( ! defined ( __GNUC__ ) & & ! defined ( __clang__ ) ) | | defined ( __pnacl__ ) | | \ <nl> - defined ( __EMSCRIPTEN__ ) <nl> + defined ( EMSCRIPTN ) <nl> # define BENCHMARK_HAS_NO_INLINE_ASSEMBLY <nl> # endif <nl> <nl> BENCHMARK_UNUSED static int stream_init_anchor = InitializeStreams ( ) ; <nl> / / See : https : / / youtu . be / nXaxk27zwlk ? t = 2441 <nl> # ifndef BENCHMARK_HAS_NO_INLINE_ASSEMBLY <nl> template < class Tp > <nl> - inline BENCHMARK_ALWAYS_INLINE <nl> - void DoNotOptimize ( Tp const & value ) { <nl> - asm volatile ( " " : : " r , m " ( value ) : " memory " ) ; <nl> - } <nl> - <nl> - template < class Tp > <nl> - inline BENCHMARK_ALWAYS_INLINE void DoNotOptimize ( Tp & value ) { <nl> + inline BENCHMARK_ALWAYS_INLINE void DoNotOptimize ( Tp const & value ) { <nl> + / / Clang doesn ' t like the ' X ' constraint on ` value ` and certain GCC versions <nl> + / / don ' t like the ' g ' constraint . Attempt to placate them both . <nl> # if defined ( __clang__ ) <nl> - asm volatile ( " " : " + r , m " ( value ) : : " memory " ) ; <nl> + asm volatile ( " " : : " g " ( value ) : " memory " ) ; <nl> # else <nl> - asm volatile ( " " : " + m , r " ( value ) : : " memory " ) ; <nl> + asm volatile ( " " : : " i , r , m " ( value ) : " memory " ) ; <nl> # endif <nl> } <nl> - <nl> / / Force the compiler to flush pending writes to global memory . Acts as an <nl> / / effective read / write barrier <nl> inline BENCHMARK_ALWAYS_INLINE void ClobberMemory ( ) { <nl> enum BigO { oNone , o1 , oN , oNSquared , oNCubed , oLogN , oNLogN , oAuto , oLambda } ; <nl> <nl> / / BigOFunc is passed to a benchmark in order to specify the asymptotic <nl> / / computational complexity for the benchmark . <nl> - typedef double ( BigOFunc ) ( int64_t ) ; <nl> + typedef double ( BigOFunc ) ( int ) ; <nl> <nl> / / StatisticsFunc is passed to a benchmark in order to compute some descriptive <nl> / / statistics over all the measurements of some type <nl> class State { <nl> / / Returns true if the benchmark should continue through another iteration . <nl> / / NOTE : A benchmark may not return from the test until KeepRunning ( ) has <nl> / / returned false . <nl> - bool KeepRunning ( ) ; <nl> - <nl> - / / Returns true iff the benchmark should run n more iterations . <nl> - / / REQUIRES : ' n ' > 0 . <nl> - / / NOTE : A benchmark must not return from the test until KeepRunningBatch ( ) <nl> - / / has returned false . <nl> - / / NOTE : KeepRunningBatch ( ) may overshoot by up to ' n ' iterations . <nl> - / / <nl> - / / Intended usage : <nl> - / / while ( state . KeepRunningBatch ( 1000 ) ) { <nl> - / / / / process 1000 elements <nl> - / / } <nl> - bool KeepRunningBatch ( size_t n ) ; <nl> + bool KeepRunning ( ) { <nl> + if ( BENCHMARK_BUILTIN_EXPECT ( ! started_ , false ) ) { <nl> + StartKeepRunning ( ) ; <nl> + } <nl> + bool const res = - - total_iterations_ ; <nl> + if ( BENCHMARK_BUILTIN_EXPECT ( ! res , false ) ) { <nl> + FinishKeepRunning ( ) ; <nl> + } <nl> + return res ; <nl> + } <nl> <nl> / / REQUIRES : timer is running and ' SkipWithError ( . . . ) ' has not been called <nl> / / by the current thread . <nl> class State { <nl> / / <nl> / / REQUIRES : a benchmark has exited its benchmarking loop . <nl> BENCHMARK_ALWAYS_INLINE <nl> - void SetBytesProcessed ( int64_t bytes ) { bytes_processed_ = bytes ; } <nl> + void SetBytesProcessed ( size_t bytes ) { bytes_processed_ = bytes ; } <nl> <nl> BENCHMARK_ALWAYS_INLINE <nl> - int64_t bytes_processed ( ) const { return bytes_processed_ ; } <nl> + size_t bytes_processed ( ) const { return bytes_processed_ ; } <nl> <nl> / / If this routine is called with complexity_n > 0 and complexity report is <nl> / / requested for the <nl> class State { <nl> / / and complexity_n will <nl> / / represent the length of N . <nl> BENCHMARK_ALWAYS_INLINE <nl> - void SetComplexityN ( int64_t complexity_n ) { complexity_n_ = complexity_n ; } <nl> + void SetComplexityN ( int complexity_n ) { complexity_n_ = complexity_n ; } <nl> <nl> BENCHMARK_ALWAYS_INLINE <nl> - int64_t complexity_length_n ( ) { return complexity_n_ ; } <nl> + int complexity_length_n ( ) { return complexity_n_ ; } <nl> <nl> / / If this routine is called with items > 0 , then an items / s <nl> / / label is printed on the benchmark report line for the currently <nl> class State { <nl> / / <nl> / / REQUIRES : a benchmark has exited its benchmarking loop . <nl> BENCHMARK_ALWAYS_INLINE <nl> - void SetItemsProcessed ( int64_t items ) { items_processed_ = items ; } <nl> + void SetItemsProcessed ( size_t items ) { items_processed_ = items ; } <nl> <nl> BENCHMARK_ALWAYS_INLINE <nl> - int64_t items_processed ( ) const { return items_processed_ ; } <nl> + size_t items_processed ( ) const { return items_processed_ ; } <nl> <nl> / / If this routine is called , the specified label is printed at the <nl> / / end of the benchmark report line for the currently executing <nl> class State { <nl> / / static void BM_Compress ( benchmark : : State & state ) { <nl> / / . . . <nl> / / double compress = input_size / output_size ; <nl> - / / state . SetLabel ( StrFormat ( " compress : % . 1f % % " , 100 . 0 * compression ) ) ; <nl> + / / state . SetLabel ( StringPrintf ( " compress : % . 1f % % " , 100 . 0 * compression ) ) ; <nl> / / } <nl> / / Produces output that looks like : <nl> / / BM_Compress 50 50 14115038 compress : 27 . 3 % <nl> class State { <nl> <nl> / / Range arguments for this run . CHECKs if the argument has been set . <nl> BENCHMARK_ALWAYS_INLINE <nl> - int64_t range ( std : : size_t pos = 0 ) const { <nl> + int range ( std : : size_t pos = 0 ) const { <nl> assert ( range_ . size ( ) > pos ) ; <nl> return range_ [ pos ] ; <nl> } <nl> <nl> BENCHMARK_DEPRECATED_MSG ( " use ' range ( 0 ) ' instead " ) <nl> - int64_t range_x ( ) const { return range ( 0 ) ; } <nl> + int range_x ( ) const { return range ( 0 ) ; } <nl> <nl> BENCHMARK_DEPRECATED_MSG ( " use ' range ( 1 ) ' instead " ) <nl> - int64_t range_y ( ) const { return range ( 1 ) ; } <nl> + int range_y ( ) const { return range ( 1 ) ; } <nl> <nl> BENCHMARK_ALWAYS_INLINE <nl> - size_t iterations ( ) const { <nl> - if ( BENCHMARK_BUILTIN_EXPECT ( ! started_ , false ) ) { <nl> - return 0 ; <nl> - } <nl> - return max_iterations - total_iterations_ + batch_leftover_ ; <nl> - } <nl> - <nl> - private : / / items we expect on the first cache line ( ie 64 bytes of the struct ) <nl> - <nl> - / / When total_iterations_ is 0 , KeepRunning ( ) and friends will return false . <nl> - / / May be larger than max_iterations . <nl> - size_t total_iterations_ ; <nl> - <nl> - / / When using KeepRunningBatch ( ) , batch_leftover_ holds the number of <nl> - / / iterations beyond max_iters that were run . Used to track <nl> - / / completed_iterations_ accurately . <nl> - size_t batch_leftover_ ; <nl> + size_t iterations ( ) const { return ( max_iterations - total_iterations_ ) + 1 ; } <nl> <nl> - public : <nl> - const size_t max_iterations ; <nl> - <nl> - private : <nl> + private : <nl> bool started_ ; <nl> bool finished_ ; <nl> - bool error_occurred_ ; <nl> + size_t total_iterations_ ; <nl> <nl> - private : / / items we don ' t need on the first cache line <nl> - std : : vector < int64_t > range_ ; <nl> + std : : vector < int > range_ ; <nl> <nl> - int64_t bytes_processed_ ; <nl> - int64_t items_processed_ ; <nl> + size_t bytes_processed_ ; <nl> + size_t items_processed_ ; <nl> <nl> - int64_t complexity_n_ ; <nl> + int complexity_n_ ; <nl> + <nl> + bool error_occurred_ ; <nl> <nl> public : <nl> / / Container for user - defined counters . <nl> class State { <nl> const int thread_index ; <nl> / / Number of threads concurrently executing the benchmark . <nl> const int threads ; <nl> - <nl> + const size_t max_iterations ; <nl> <nl> / / TODO ( EricWF ) make me private <nl> - State ( size_t max_iters , const std : : vector < int64_t > & ranges , int thread_i , <nl> + State ( size_t max_iters , const std : : vector < int > & ranges , int thread_i , <nl> int n_threads , internal : : ThreadTimer * timer , <nl> internal : : ThreadManager * manager ) ; <nl> <nl> private : <nl> void StartKeepRunning ( ) ; <nl> - / / Implementation of KeepRunning ( ) and KeepRunningBatch ( ) . <nl> - / / is_batch must be true unless n is 1 . <nl> - bool KeepRunningInternal ( size_t n , bool is_batch ) ; <nl> void FinishKeepRunning ( ) ; <nl> internal : : ThreadTimer * timer_ ; <nl> internal : : ThreadManager * manager_ ; <nl> BENCHMARK_DISALLOW_COPY_AND_ASSIGN ( State ) ; <nl> } ; <nl> <nl> - inline BENCHMARK_ALWAYS_INLINE <nl> - bool State : : KeepRunning ( ) { <nl> - return KeepRunningInternal ( 1 , / * is_batch = * / false ) ; <nl> - } <nl> - <nl> - inline BENCHMARK_ALWAYS_INLINE <nl> - bool State : : KeepRunningBatch ( size_t n ) { <nl> - return KeepRunningInternal ( n , / * is_batch = * / true ) ; <nl> - } <nl> - <nl> - inline BENCHMARK_ALWAYS_INLINE <nl> - bool State : : KeepRunningInternal ( size_t n , bool is_batch ) { <nl> - / / total_iterations_ is set to 0 by the constructor , and always set to a <nl> - / / nonzero value by StartKepRunning ( ) . <nl> - assert ( n > 0 ) ; <nl> - / / n must be 1 unless is_batch is true . <nl> - assert ( is_batch | | n = = 1 ) ; <nl> - if ( BENCHMARK_BUILTIN_EXPECT ( total_iterations_ > = n , true ) ) { <nl> - total_iterations_ - = n ; <nl> - return true ; <nl> - } <nl> - if ( ! started_ ) { <nl> - StartKeepRunning ( ) ; <nl> - if ( ! error_occurred_ & & total_iterations_ > = n ) { <nl> - total_iterations_ - = n ; <nl> - return true ; <nl> - } <nl> - } <nl> - / / For non - batch runs , total_iterations_ must be 0 by now . <nl> - if ( is_batch & & total_iterations_ ! = 0 ) { <nl> - batch_leftover_ = n - total_iterations_ ; <nl> - total_iterations_ = 0 ; <nl> - return true ; <nl> - } <nl> - FinishKeepRunning ( ) ; <nl> - return false ; <nl> - } <nl> - <nl> struct State : : StateIterator { <nl> struct BENCHMARK_UNUSED Value { } ; <nl> typedef std : : forward_iterator_tag iterator_category ; <nl> typedef Value value_type ; <nl> typedef Value reference ; <nl> typedef Value pointer ; <nl> - typedef std : : ptrdiff_t difference_type ; <nl> <nl> private : <nl> friend class State ; <nl> struct State : : StateIterator { <nl> State * const parent_ ; <nl> } ; <nl> <nl> - inline BENCHMARK_ALWAYS_INLINE State : : StateIterator State : : begin ( ) { <nl> + BENCHMARK_ALWAYS_INLINE inline State : : StateIterator State : : begin ( ) { <nl> return StateIterator ( this ) ; <nl> } <nl> - inline BENCHMARK_ALWAYS_INLINE State : : StateIterator State : : end ( ) { <nl> + BENCHMARK_ALWAYS_INLINE inline State : : StateIterator State : : end ( ) { <nl> StartKeepRunning ( ) ; <nl> return StateIterator ( ) ; <nl> } <nl> class Benchmark { <nl> / / Run this benchmark once with " x " as the extra argument passed <nl> / / to the function . <nl> / / REQUIRES : The function passed to the constructor must accept an arg1 . <nl> - Benchmark * Arg ( int64_t x ) ; <nl> + Benchmark * Arg ( int x ) ; <nl> <nl> / / Run this benchmark with the given time unit for the generated output report <nl> Benchmark * Unit ( TimeUnit unit ) ; <nl> class Benchmark { <nl> / / Run this benchmark once for a number of values picked from the <nl> / / range [ start . . limit ] . ( start and limit are always picked . ) <nl> / / REQUIRES : The function passed to the constructor must accept an arg1 . <nl> - Benchmark * Range ( int64_t start , int64_t limit ) ; <nl> + Benchmark * Range ( int start , int limit ) ; <nl> <nl> / / Run this benchmark once for all values in the range [ start . . limit ] with <nl> / / specific step <nl> / / REQUIRES : The function passed to the constructor must accept an arg1 . <nl> - Benchmark * DenseRange ( int64_t start , int64_t limit , int step = 1 ) ; <nl> + Benchmark * DenseRange ( int start , int limit , int step = 1 ) ; <nl> <nl> / / Run this benchmark once with " args " as the extra arguments passed <nl> / / to the function . <nl> / / REQUIRES : The function passed to the constructor must accept arg1 , arg2 . . . <nl> - Benchmark * Args ( const std : : vector < int64_t > & args ) ; <nl> + Benchmark * Args ( const std : : vector < int > & args ) ; <nl> <nl> / / Equivalent to Args ( { x , y } ) <nl> / / NOTE : This is a legacy C + + 03 interface provided for compatibility only . <nl> / / New code should use ' Args ' . <nl> - Benchmark * ArgPair ( int64_t x , int64_t y ) { <nl> - std : : vector < int64_t > args ; <nl> + Benchmark * ArgPair ( int x , int y ) { <nl> + std : : vector < int > args ; <nl> args . push_back ( x ) ; <nl> args . push_back ( y ) ; <nl> return Args ( args ) ; <nl> class Benchmark { <nl> / / Run this benchmark once for a number of values picked from the <nl> / / ranges [ start . . limit ] . ( starts and limits are always picked . ) <nl> / / REQUIRES : The function passed to the constructor must accept arg1 , arg2 . . . <nl> - Benchmark * Ranges ( const std : : vector < std : : pair < int64_t , int64_t > > & ranges ) ; <nl> + Benchmark * Ranges ( const std : : vector < std : : pair < int , int > > & ranges ) ; <nl> <nl> / / Equivalent to ArgNames ( { name } ) <nl> Benchmark * ArgName ( const std : : string & name ) ; <nl> class Benchmark { <nl> / / Equivalent to Ranges ( { { lo1 , hi1 } , { lo2 , hi2 } } ) . <nl> / / NOTE : This is a legacy C + + 03 interface provided for compatibility only . <nl> / / New code should use ' Ranges ' . <nl> - Benchmark * RangePair ( int64_t lo1 , int64_t hi1 , int64_t lo2 , int64_t hi2 ) { <nl> - std : : vector < std : : pair < int64_t , int64_t > > ranges ; <nl> + Benchmark * RangePair ( int lo1 , int hi1 , int lo2 , int hi2 ) { <nl> + std : : vector < std : : pair < int , int > > ranges ; <nl> ranges . push_back ( std : : make_pair ( lo1 , hi1 ) ) ; <nl> ranges . push_back ( std : : make_pair ( lo2 , hi2 ) ) ; <nl> return Ranges ( ranges ) ; <nl> class Benchmark { <nl> <nl> int ArgsCnt ( ) const ; <nl> <nl> + static void AddRange ( std : : vector < int > * dst , int lo , int hi , int mult ) ; <nl> + <nl> private : <nl> friend class BenchmarkFamilies ; <nl> <nl> std : : string name_ ; <nl> ReportMode report_mode_ ; <nl> std : : vector < std : : string > arg_names_ ; / / Args for all benchmark runs <nl> - std : : vector < std : : vector < int64_t > > args_ ; / / Args for all benchmark runs <nl> + std : : vector < std : : vector < int > > args_ ; / / Args for all benchmark runs <nl> TimeUnit time_unit_ ; <nl> int range_multiplier_ ; <nl> double min_time_ ; <nl> class Fixture : public internal : : Benchmark { <nl> : : benchmark : : Initialize ( & argc , argv ) ; \ <nl> if ( : : benchmark : : ReportUnrecognizedArguments ( argc , argv ) ) return 1 ; \ <nl> : : benchmark : : RunSpecifiedBenchmarks ( ) ; \ <nl> - } \ <nl> - int main ( int , char * * ) <nl> + } <nl> <nl> <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> class Fixture : public internal : : Benchmark { <nl> <nl> namespace benchmark { <nl> <nl> - struct CPUInfo { <nl> - struct CacheInfo { <nl> - std : : string type ; <nl> - int level ; <nl> - int size ; <nl> - int num_sharing ; <nl> - } ; <nl> - <nl> - int num_cpus ; <nl> - double cycles_per_second ; <nl> - std : : vector < CacheInfo > caches ; <nl> - bool scaling_enabled ; <nl> - <nl> - static const CPUInfo & Get ( ) ; <nl> - <nl> - private : <nl> - CPUInfo ( ) ; <nl> - BENCHMARK_DISALLOW_COPY_AND_ASSIGN ( CPUInfo ) ; <nl> - } ; <nl> - <nl> / / Interface for custom benchmark result printers . <nl> / / By default , benchmark reports are printed to stdout . However an application <nl> / / can control the destination of the reports by calling <nl> struct CPUInfo { <nl> class BenchmarkReporter { <nl> public : <nl> struct Context { <nl> - CPUInfo const & cpu_info ; <nl> + int num_cpus ; <nl> + double mhz_per_cpu ; <nl> + bool cpu_scaling_enabled ; <nl> + <nl> / / The number of chars in the longest benchmark name . <nl> size_t name_field_width ; <nl> - static const char * executable_name ; <nl> - Context ( ) ; <nl> } ; <nl> <nl> struct Run { <nl> class BenchmarkReporter { <nl> / / Keep track of arguments to compute asymptotic complexity <nl> BigO complexity ; <nl> BigOFunc * complexity_lambda ; <nl> - int64_t complexity_n ; <nl> + int complexity_n ; <nl> <nl> / / what statistics to compute from the measurements <nl> const std : : vector < Statistics > * statistics ; <nl> new file mode 100644 <nl> index 000000000000 . . a9ae67147c5a <nl> mmm / dev / null <nl> ppp b / src / third_party / benchmark - 1 . 3 . 0 / benchmark / include / benchmark / benchmark_api . h <nl> <nl> + / / Copyright 2015 Google Inc . All rights reserved . <nl> + / / <nl> + / / Licensed under the Apache License , Version 2 . 0 ( the " License " ) ; <nl> + / / you may not use this file except in compliance with the License . <nl> + / / You may obtain a copy of the License at <nl> + / / <nl> + / / http : / / www . apache . org / licenses / LICENSE - 2 . 0 <nl> + / / <nl> + / / Unless required by applicable law or agreed to in writing , software <nl> + / / distributed under the License is distributed on an " AS IS " BASIS , <nl> + / / WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND , either express or implied . <nl> + / / See the License for the specific language governing permissions and <nl> + / / limitations under the License . <nl> + # ifndef BENCHMARK_BENCHMARK_API_H_ <nl> + # define BENCHMARK_BENCHMARK_API_H_ <nl> + <nl> + # ifdef __DEPRECATED <nl> + # ifndef BENCHMARK_WARNING_MSG <nl> + # warning the benchmark_api . h header has been deprecated and will be removed , please include benchmark . h instead <nl> + # else <nl> + BENCHMARK_WARNING_MSG ( " the benchmark_api . h header has been deprecated and will be removed , please include benchmark . h instead " ) <nl> + # endif <nl> + # endif <nl> + <nl> + # include " benchmark . h " / / For forward declaration of BenchmarkReporter <nl> + <nl> + # endif / / BENCHMARK_BENCHMARK_API_H_ <nl> similarity index 51 % <nl> rename from src / third_party / benchmark - 1 . 4 . 1 / benchmark / src / benchmark_main . cc <nl> rename to src / third_party / benchmark - 1 . 3 . 0 / benchmark / include / benchmark / reporter . h <nl> mmm a / src / third_party / benchmark - 1 . 4 . 1 / benchmark / src / benchmark_main . cc <nl> ppp b / src / third_party / benchmark - 1 . 3 . 0 / benchmark / include / benchmark / reporter . h <nl> <nl> - / / Copyright 2018 Google Inc . All rights reserved . <nl> + / / Copyright 2015 Google Inc . All rights reserved . <nl> / / <nl> / / Licensed under the Apache License , Version 2 . 0 ( the " License " ) ; <nl> / / you may not use this file except in compliance with the License . <nl> <nl> / / WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND , either express or implied . <nl> / / See the License for the specific language governing permissions and <nl> / / limitations under the License . <nl> + # ifndef BENCHMARK_REPORTER_H_ <nl> + # define BENCHMARK_REPORTER_H_ <nl> <nl> - # include " benchmark / benchmark . h " <nl> + # ifdef __DEPRECATED <nl> + # ifndef BENCHMARK_WARNING_MSG <nl> + # warning the reporter . h header has been deprecated and will be removed , please include benchmark . h instead <nl> + # else <nl> + BENCHMARK_WARNING_MSG ( " the reporter . h header has been deprecated and will be removed , please include benchmark . h instead " ) <nl> + # endif <nl> + # endif <nl> <nl> - BENCHMARK_MAIN ( ) ; <nl> + # include " benchmark . h " / / For forward declaration of BenchmarkReporter <nl> + <nl> + # endif / / BENCHMARK_REPORTER_H_ <nl> similarity index 100 % <nl> rename from src / third_party / benchmark - 1 . 4 . 1 / benchmark / src / arraysize . h <nl> rename to src / third_party / benchmark - 1 . 3 . 0 / benchmark / src / arraysize . h <nl> similarity index 84 % <nl> rename from src / third_party / benchmark - 1 . 4 . 1 / benchmark / src / benchmark . cc <nl> rename to src / third_party / benchmark - 1 . 3 . 0 / benchmark / src / benchmark . cc <nl> mmm a / src / third_party / benchmark - 1 . 4 . 1 / benchmark / src / benchmark . cc <nl> ppp b / src / third_party / benchmark - 1 . 3 . 0 / benchmark / src / benchmark . cc <nl> <nl> # include " internal_macros . h " <nl> <nl> # ifndef BENCHMARK_OS_WINDOWS <nl> - # ifndef BENCHMARK_OS_FUCHSIA <nl> # include < sys / resource . h > <nl> - # endif <nl> # include < sys / time . h > <nl> # include < unistd . h > <nl> # endif <nl> <nl> # include < condition_variable > <nl> # include < cstdio > <nl> # include < cstdlib > <nl> + # include < cstring > <nl> # include < fstream > <nl> # include < iostream > <nl> # include < memory > <nl> - # include < string > <nl> # include < thread > <nl> <nl> # include " check . h " <nl> # include " colorprint . h " <nl> # include " commandlineflags . h " <nl> # include " complexity . h " <nl> + # include " statistics . h " <nl> # include " counter . h " <nl> - # include " internal_macros . h " <nl> # include " log . h " <nl> # include " mutex . h " <nl> # include " re . h " <nl> - # include " statistics . h " <nl> # include " string_util . h " <nl> - # include " thread_manager . h " <nl> - # include " thread_timer . h " <nl> + # include " sysinfo . h " <nl> + # include " timers . h " <nl> <nl> DEFINE_bool ( benchmark_list_tests , false , <nl> " Print a list of benchmarks . This option overrides all other " <nl> DEFINE_string ( benchmark_out_format , " json " , <nl> " The format to use for file output . Valid values are " <nl> " ' console ' , ' json ' , or ' csv ' . " ) ; <nl> <nl> - DEFINE_string ( benchmark_out , " " , " The file to write additional output to " ) ; <nl> + DEFINE_string ( benchmark_out , " " , " The file to write additonal output to " ) ; <nl> <nl> DEFINE_string ( benchmark_color , " auto " , <nl> " Whether to use colors in the output . Valid values : " <nl> namespace internal { <nl> <nl> void UseCharPointer ( char const volatile * ) { } <nl> <nl> + class ThreadManager { <nl> + public : <nl> + ThreadManager ( int num_threads ) <nl> + : alive_threads_ ( num_threads ) , start_stop_barrier_ ( num_threads ) { } <nl> + <nl> + Mutex & GetBenchmarkMutex ( ) const RETURN_CAPABILITY ( benchmark_mutex_ ) { <nl> + return benchmark_mutex_ ; <nl> + } <nl> + <nl> + bool StartStopBarrier ( ) EXCLUDES ( end_cond_mutex_ ) { <nl> + return start_stop_barrier_ . wait ( ) ; <nl> + } <nl> + <nl> + void NotifyThreadComplete ( ) EXCLUDES ( end_cond_mutex_ ) { <nl> + start_stop_barrier_ . removeThread ( ) ; <nl> + if ( - - alive_threads_ = = 0 ) { <nl> + MutexLock lock ( end_cond_mutex_ ) ; <nl> + end_condition_ . notify_all ( ) ; <nl> + } <nl> + } <nl> + <nl> + void WaitForAllThreads ( ) EXCLUDES ( end_cond_mutex_ ) { <nl> + MutexLock lock ( end_cond_mutex_ ) ; <nl> + end_condition_ . wait ( lock . native_handle ( ) , <nl> + [ this ] ( ) { return alive_threads_ = = 0 ; } ) ; <nl> + } <nl> + <nl> + public : <nl> + struct Result { <nl> + double real_time_used = 0 ; <nl> + double cpu_time_used = 0 ; <nl> + double manual_time_used = 0 ; <nl> + int64_t bytes_processed = 0 ; <nl> + int64_t items_processed = 0 ; <nl> + int complexity_n = 0 ; <nl> + std : : string report_label_ ; <nl> + std : : string error_message_ ; <nl> + bool has_error_ = false ; <nl> + UserCounters counters ; <nl> + } ; <nl> + GUARDED_BY ( GetBenchmarkMutex ( ) ) Result results ; <nl> + <nl> + private : <nl> + mutable Mutex benchmark_mutex_ ; <nl> + std : : atomic < int > alive_threads_ ; <nl> + Barrier start_stop_barrier_ ; <nl> + Mutex end_cond_mutex_ ; <nl> + Condition end_condition_ ; <nl> + } ; <nl> + <nl> + / / Timer management class <nl> + class ThreadTimer { <nl> + public : <nl> + ThreadTimer ( ) = default ; <nl> + <nl> + / / Called by each thread <nl> + void StartTimer ( ) { <nl> + running_ = true ; <nl> + start_real_time_ = ChronoClockNow ( ) ; <nl> + start_cpu_time_ = ThreadCPUUsage ( ) ; <nl> + } <nl> + <nl> + / / Called by each thread <nl> + void StopTimer ( ) { <nl> + CHECK ( running_ ) ; <nl> + running_ = false ; <nl> + real_time_used_ + = ChronoClockNow ( ) - start_real_time_ ; <nl> + cpu_time_used_ + = ThreadCPUUsage ( ) - start_cpu_time_ ; <nl> + } <nl> + <nl> + / / Called by each thread <nl> + void SetIterationTime ( double seconds ) { manual_time_used_ + = seconds ; } <nl> + <nl> + bool running ( ) const { return running_ ; } <nl> + <nl> + / / REQUIRES : timer is not running <nl> + double real_time_used ( ) { <nl> + CHECK ( ! running_ ) ; <nl> + return real_time_used_ ; <nl> + } <nl> + <nl> + / / REQUIRES : timer is not running <nl> + double cpu_time_used ( ) { <nl> + CHECK ( ! running_ ) ; <nl> + return cpu_time_used_ ; <nl> + } <nl> + <nl> + / / REQUIRES : timer is not running <nl> + double manual_time_used ( ) { <nl> + CHECK ( ! running_ ) ; <nl> + return manual_time_used_ ; <nl> + } <nl> + <nl> + private : <nl> + bool running_ = false ; / / Is the timer running <nl> + double start_real_time_ = 0 ; / / If running_ <nl> + double start_cpu_time_ = 0 ; / / If running_ <nl> + <nl> + / / Accumulated time so far ( does not contain current slice if running_ ) <nl> + double real_time_used_ = 0 ; <nl> + double cpu_time_used_ = 0 ; <nl> + / / Manually set iteration time . User sets this with SetIterationTime ( seconds ) . <nl> + double manual_time_used_ = 0 ; <nl> + } ; <nl> + <nl> namespace { <nl> <nl> BenchmarkReporter : : Run CreateRunReport ( <nl> const benchmark : : internal : : Benchmark : : Instance & b , <nl> - const internal : : ThreadManager : : Result & results , <nl> + const internal : : ThreadManager : : Result & results , size_t iters , <nl> double seconds ) { <nl> / / Create report about this benchmark run . <nl> BenchmarkReporter : : Run report ; <nl> BenchmarkReporter : : Run CreateRunReport ( <nl> report . error_occurred = results . has_error_ ; <nl> report . error_message = results . error_message_ ; <nl> report . report_label = results . report_label_ ; <nl> - / / This is the total iterations across all threads . <nl> - report . iterations = results . iterations ; <nl> + / / Report the total iterations across all threads . <nl> + report . iterations = static_cast < int64_t > ( iters ) * b . threads ; <nl> report . time_unit = b . time_unit ; <nl> <nl> if ( ! report . error_occurred ) { <nl> void RunInThread ( const benchmark : : internal : : Benchmark : : Instance * b , <nl> internal : : ThreadTimer timer ; <nl> State st ( iters , b - > arg , thread_id , b - > threads , & timer , manager ) ; <nl> b - > benchmark - > Run ( st ) ; <nl> - CHECK ( st . iterations ( ) > = st . max_iterations ) <nl> + CHECK ( st . iterations ( ) = = st . max_iterations ) <nl> < < " Benchmark returned before State : : KeepRunning ( ) returned false ! " ; <nl> { <nl> MutexLock l ( manager - > GetBenchmarkMutex ( ) ) ; <nl> internal : : ThreadManager : : Result & results = manager - > results ; <nl> - results . iterations + = st . iterations ( ) ; <nl> results . cpu_time_used + = timer . cpu_time_used ( ) ; <nl> results . real_time_used + = timer . real_time_used ( ) ; <nl> results . manual_time_used + = timer . manual_time_used ( ) ; <nl> std : : vector < BenchmarkReporter : : Run > RunBenchmark ( <nl> / / Determine if this run should be reported ; Either it has <nl> / / run for a sufficient amount of time or because an error was reported . <nl> const bool should_report = repetition_num > 0 <nl> - | | has_explicit_iteration_count / / An exact iteration count was requested <nl> + | | has_explicit_iteration_count / / An exact iteration count was requested <nl> | | results . has_error_ <nl> - | | iters > = kMaxIterations / / No chance to try again , we hit the limit . <nl> - | | seconds > = min_time / / the elapsed time is large enough <nl> + | | iters > = kMaxIterations <nl> + | | seconds > = min_time / / the elapsed time is large enough <nl> / / CPU time is specified but the elapsed real time greatly exceeds the <nl> / / minimum time . Note that user provided timers are except from this <nl> / / sanity check . <nl> | | ( ( results . real_time_used > = 5 * min_time ) & & ! b . use_manual_time ) ; <nl> <nl> if ( should_report ) { <nl> - BenchmarkReporter : : Run report = CreateRunReport ( b , results , seconds ) ; <nl> + BenchmarkReporter : : Run report = <nl> + CreateRunReport ( b , results , iters , seconds ) ; <nl> if ( ! report . error_occurred & & b . complexity ! = oNone ) <nl> complexity_reports - > push_back ( report ) ; <nl> reports . push_back ( report ) ; <nl> std : : vector < BenchmarkReporter : : Run > RunBenchmark ( <nl> } / / namespace <nl> } / / namespace internal <nl> <nl> - State : : State ( size_t max_iters , const std : : vector < int64_t > & ranges , int thread_i , <nl> + State : : State ( size_t max_iters , const std : : vector < int > & ranges , int thread_i , <nl> int n_threads , internal : : ThreadTimer * timer , <nl> internal : : ThreadManager * manager ) <nl> - : total_iterations_ ( 0 ) , <nl> - batch_leftover_ ( 0 ) , <nl> - max_iterations ( max_iters ) , <nl> - started_ ( false ) , <nl> + : started_ ( false ) , <nl> finished_ ( false ) , <nl> - error_occurred_ ( false ) , <nl> + total_iterations_ ( max_iters + 1 ) , <nl> range_ ( ranges ) , <nl> bytes_processed_ ( 0 ) , <nl> items_processed_ ( 0 ) , <nl> complexity_n_ ( 0 ) , <nl> + error_occurred_ ( false ) , <nl> counters ( ) , <nl> thread_index ( thread_i ) , <nl> threads ( n_threads ) , <nl> + max_iterations ( max_iters ) , <nl> timer_ ( timer ) , <nl> manager_ ( manager ) { <nl> CHECK ( max_iterations ! = 0 ) < < " At least one iteration must be run " ; <nl> + CHECK ( total_iterations_ ! = 0 ) < < " max iterations wrapped around " ; <nl> CHECK_LT ( thread_index , threads ) < < " thread_index must be less than threads " ; <nl> - <nl> - / / Note : The use of offsetof below is technically undefined until C + + 17 <nl> - / / because State is not a standard layout type . However , all compilers <nl> - / / currently provide well - defined behavior as an extension ( which is <nl> - / / demonstrated since constexpr evaluation must diagnose all undefined <nl> - / / behavior ) . However , GCC and Clang also warn about this use of offsetof , <nl> - / / which must be suppressed . <nl> - # ifdef __GNUC__ <nl> - # pragma GCC diagnostic push <nl> - # pragma GCC diagnostic ignored " - Winvalid - offsetof " <nl> - # endif <nl> - / / Offset tests to ensure commonly accessed data is on the first cache line . <nl> - const int cache_line_size = 64 ; <nl> - static_assert ( offsetof ( State , error_occurred_ ) < = <nl> - ( cache_line_size - sizeof ( error_occurred_ ) ) , " " ) ; <nl> - # ifdef __GNUC__ <nl> - # pragma GCC diagnostic pop <nl> - # endif <nl> } <nl> <nl> void State : : PauseTiming ( ) { <nl> void State : : SkipWithError ( const char * msg ) { <nl> manager_ - > results . has_error_ = true ; <nl> } <nl> } <nl> - total_iterations_ = 0 ; <nl> + total_iterations_ = 1 ; <nl> if ( timer_ - > running ( ) ) timer_ - > StopTimer ( ) ; <nl> } <nl> <nl> void State : : SetLabel ( const char * label ) { <nl> void State : : StartKeepRunning ( ) { <nl> CHECK ( ! started_ & & ! finished_ ) ; <nl> started_ = true ; <nl> - total_iterations_ = error_occurred_ ? 0 : max_iterations ; <nl> manager_ - > StartStopBarrier ( ) ; <nl> if ( ! error_occurred_ ) ResumeTiming ( ) ; <nl> } <nl> void State : : FinishKeepRunning ( ) { <nl> if ( ! error_occurred_ ) { <nl> PauseTiming ( ) ; <nl> } <nl> - / / Total iterations has now wrapped around past 0 . Fix this . <nl> - total_iterations_ = 0 ; <nl> + / / Total iterations has now wrapped around zero . Fix this . <nl> + total_iterations_ = 1 ; <nl> finished_ = true ; <nl> manager_ - > StartStopBarrier ( ) ; <nl> } <nl> void RunBenchmarks ( const std : : vector < Benchmark : : Instance > & benchmarks , <nl> <nl> / / Print header here <nl> BenchmarkReporter : : Context context ; <nl> + context . num_cpus = NumCPUs ( ) ; <nl> + context . mhz_per_cpu = CyclesPerSecond ( ) / 1000000 . 0 ; <nl> + <nl> + context . cpu_scaling_enabled = CpuScalingEnabled ( ) ; <nl> context . name_field_width = name_field_width ; <nl> <nl> - / / Keep track of running times of all instances of current benchmark <nl> + / / Keep track of runing times of all instances of current benchmark <nl> std : : vector < BenchmarkReporter : : Run > complexity_reports ; <nl> <nl> / / We flush streams after invoking reporter methods that write to them . This <nl> void PrintUsageAndExit ( ) { <nl> <nl> void ParseCommandLineFlags ( int * argc , char * * argv ) { <nl> using namespace benchmark ; <nl> - BenchmarkReporter : : Context : : executable_name = argv [ 0 ] ; <nl> for ( int i = 1 ; i < * argc ; + + i ) { <nl> if ( ParseBoolFlag ( argv [ i ] , " benchmark_list_tests " , <nl> & FLAGS_benchmark_list_tests ) | | <nl> similarity index 97 % <nl> rename from src / third_party / benchmark - 1 . 4 . 1 / benchmark / src / benchmark_api_internal . h <nl> rename to src / third_party / benchmark - 1 . 3 . 0 / benchmark / src / benchmark_api_internal . h <nl> mmm a / src / third_party / benchmark - 1 . 4 . 1 / benchmark / src / benchmark_api_internal . h <nl> ppp b / src / third_party / benchmark - 1 . 3 . 0 / benchmark / src / benchmark_api_internal . h <nl> struct Benchmark : : Instance { <nl> std : : string name ; <nl> Benchmark * benchmark ; <nl> ReportMode report_mode ; <nl> - std : : vector < int64_t > arg ; <nl> + std : : vector < int > arg ; <nl> TimeUnit time_unit ; <nl> int range_multiplier ; <nl> bool use_real_time ; <nl> similarity index 87 % <nl> rename from src / third_party / benchmark - 1 . 4 . 1 / benchmark / src / benchmark_register . cc <nl> rename to src / third_party / benchmark - 1 . 3 . 0 / benchmark / src / benchmark_register . cc <nl> mmm a / src / third_party / benchmark - 1 . 4 . 1 / benchmark / src / benchmark_register . cc <nl> ppp b / src / third_party / benchmark - 1 . 3 . 0 / benchmark / src / benchmark_register . cc <nl> <nl> / / See the License for the specific language governing permissions and <nl> / / limitations under the License . <nl> <nl> - # include " benchmark_register . h " <nl> + # include " benchmark / benchmark . h " <nl> + # include " benchmark_api_internal . h " <nl> + # include " internal_macros . h " <nl> <nl> # ifndef BENCHMARK_OS_WINDOWS <nl> - # ifndef BENCHMARK_OS_FUCHSIA <nl> # include < sys / resource . h > <nl> - # endif <nl> # include < sys / time . h > <nl> # include < unistd . h > <nl> # endif <nl> <nl> # include < sstream > <nl> # include < thread > <nl> <nl> - # include " benchmark / benchmark . h " <nl> - # include " benchmark_api_internal . h " <nl> # include " check . h " <nl> # include " commandlineflags . h " <nl> # include " complexity . h " <nl> - # include " internal_macros . h " <nl> + # include " statistics . h " <nl> # include " log . h " <nl> # include " mutex . h " <nl> # include " re . h " <nl> - # include " statistics . h " <nl> # include " string_util . h " <nl> + # include " sysinfo . h " <nl> # include " timers . h " <nl> <nl> namespace benchmark { <nl> class BenchmarkFamilies { <nl> <nl> / / Extract the list of benchmark instances that match the specified <nl> / / regular expression . <nl> - bool FindBenchmarks ( std : : string re , <nl> + bool FindBenchmarks ( const std : : string & re , <nl> std : : vector < Benchmark : : Instance > * benchmarks , <nl> std : : ostream * Err ) ; <nl> <nl> void BenchmarkFamilies : : ClearBenchmarks ( ) { <nl> } <nl> <nl> bool BenchmarkFamilies : : FindBenchmarks ( <nl> - std : : string spec , std : : vector < Benchmark : : Instance > * benchmarks , <nl> + const std : : string & spec , std : : vector < Benchmark : : Instance > * benchmarks , <nl> std : : ostream * ErrStream ) { <nl> CHECK ( ErrStream ) ; <nl> auto & Err = * ErrStream ; <nl> / / Make regular expression out of command - line flag <nl> std : : string error_msg ; <nl> Regex re ; <nl> - bool isNegativeFilter = false ; <nl> - if ( spec [ 0 ] = = ' - ' ) { <nl> - spec . replace ( 0 , 1 , " " ) ; <nl> - isNegativeFilter = true ; <nl> - } <nl> if ( ! re . Init ( spec , & error_msg ) ) { <nl> Err < < " Could not compile benchmark re : " < < error_msg < < std : : endl ; <nl> return false ; <nl> bool BenchmarkFamilies : : FindBenchmarks ( <nl> const auto & arg_name = family - > arg_names_ [ arg_i ] ; <nl> if ( ! arg_name . empty ( ) ) { <nl> instance . name + = <nl> - StrFormat ( " % s : " , family - > arg_names_ [ arg_i ] . c_str ( ) ) ; <nl> + StringPrintF ( " % s : " , family - > arg_names_ [ arg_i ] . c_str ( ) ) ; <nl> } <nl> } <nl> - <nl> - instance . name + = StrFormat ( " % d " , arg ) ; <nl> + <nl> + instance . name + = StringPrintF ( " % d " , arg ) ; <nl> + + arg_i ; <nl> } <nl> <nl> if ( ! IsZero ( family - > min_time_ ) ) <nl> - instance . name + = StrFormat ( " / min_time : % 0 . 3f " , family - > min_time_ ) ; <nl> + instance . name + = StringPrintF ( " / min_time : % 0 . 3f " , family - > min_time_ ) ; <nl> if ( family - > iterations_ ! = 0 ) <nl> - instance . name + = StrFormat ( " / iterations : % d " , family - > iterations_ ) ; <nl> + instance . name + = StringPrintF ( " / iterations : % d " , family - > iterations_ ) ; <nl> if ( family - > repetitions_ ! = 0 ) <nl> - instance . name + = StrFormat ( " / repeats : % d " , family - > repetitions_ ) ; <nl> + instance . name + = StringPrintF ( " / repeats : % d " , family - > repetitions_ ) ; <nl> <nl> if ( family - > use_manual_time_ ) { <nl> instance . name + = " / manual_time " ; <nl> bool BenchmarkFamilies : : FindBenchmarks ( <nl> <nl> / / Add the number of threads used to the name <nl> if ( ! family - > thread_counts_ . empty ( ) ) { <nl> - instance . name + = StrFormat ( " / threads : % d " , instance . threads ) ; <nl> + instance . name + = StringPrintF ( " / threads : % d " , instance . threads ) ; <nl> } <nl> <nl> - if ( ( re . Match ( instance . name ) & & ! isNegativeFilter ) | | <nl> - ( ! re . Match ( instance . name ) & & isNegativeFilter ) ) { <nl> + if ( re . Match ( instance . name ) ) { <nl> instance . last_benchmark_instance = ( & args = = & family - > args_ . back ( ) ) ; <nl> benchmarks - > push_back ( std : : move ( instance ) ) ; <nl> } <nl> Benchmark : : Benchmark ( const char * name ) <nl> <nl> Benchmark : : ~ Benchmark ( ) { } <nl> <nl> - Benchmark * Benchmark : : Arg ( int64_t x ) { <nl> + void Benchmark : : AddRange ( std : : vector < int > * dst , int lo , int hi , int mult ) { <nl> + CHECK_GE ( lo , 0 ) ; <nl> + CHECK_GE ( hi , lo ) ; <nl> + CHECK_GE ( mult , 2 ) ; <nl> + <nl> + / / Add " lo " <nl> + dst - > push_back ( lo ) ; <nl> + <nl> + static const int kint32max = std : : numeric_limits < int32_t > : : max ( ) ; <nl> + <nl> + / / Now space out the benchmarks in multiples of " mult " <nl> + for ( int32_t i = 1 ; i < kint32max / mult ; i * = mult ) { <nl> + if ( i > = hi ) break ; <nl> + if ( i > lo ) { <nl> + dst - > push_back ( i ) ; <nl> + } <nl> + } <nl> + / / Add " hi " ( if different from " lo " ) <nl> + if ( hi ! = lo ) { <nl> + dst - > push_back ( hi ) ; <nl> + } <nl> + } <nl> + <nl> + Benchmark * Benchmark : : Arg ( int x ) { <nl> CHECK ( ArgsCnt ( ) = = - 1 | | ArgsCnt ( ) = = 1 ) ; <nl> args_ . push_back ( { x } ) ; <nl> return this ; <nl> Benchmark * Benchmark : : Unit ( TimeUnit unit ) { <nl> return this ; <nl> } <nl> <nl> - Benchmark * Benchmark : : Range ( int64_t start , int64_t limit ) { <nl> + Benchmark * Benchmark : : Range ( int start , int limit ) { <nl> CHECK ( ArgsCnt ( ) = = - 1 | | ArgsCnt ( ) = = 1 ) ; <nl> - std : : vector < int64_t > arglist ; <nl> + std : : vector < int > arglist ; <nl> AddRange ( & arglist , start , limit , range_multiplier_ ) ; <nl> <nl> - for ( int64_t i : arglist ) { <nl> + for ( int i : arglist ) { <nl> args_ . push_back ( { i } ) ; <nl> } <nl> return this ; <nl> } <nl> <nl> - Benchmark * Benchmark : : Ranges ( <nl> - const std : : vector < std : : pair < int64_t , int64_t > > & ranges ) { <nl> + Benchmark * Benchmark : : Ranges ( const std : : vector < std : : pair < int , int > > & ranges ) { <nl> CHECK ( ArgsCnt ( ) = = - 1 | | ArgsCnt ( ) = = static_cast < int > ( ranges . size ( ) ) ) ; <nl> - std : : vector < std : : vector < int64_t > > arglists ( ranges . size ( ) ) ; <nl> + std : : vector < std : : vector < int > > arglists ( ranges . size ( ) ) ; <nl> std : : size_t total = 1 ; <nl> for ( std : : size_t i = 0 ; i < ranges . size ( ) ; i + + ) { <nl> AddRange ( & arglists [ i ] , ranges [ i ] . first , ranges [ i ] . second , <nl> Benchmark * Benchmark : : Ranges ( <nl> std : : vector < std : : size_t > ctr ( arglists . size ( ) , 0 ) ; <nl> <nl> for ( std : : size_t i = 0 ; i < total ; i + + ) { <nl> - std : : vector < int64_t > tmp ; <nl> + std : : vector < int > tmp ; <nl> tmp . reserve ( arglists . size ( ) ) ; <nl> <nl> for ( std : : size_t j = 0 ; j < arglists . size ( ) ; j + + ) { <nl> Benchmark * Benchmark : : ArgNames ( const std : : vector < std : : string > & names ) { <nl> return this ; <nl> } <nl> <nl> - Benchmark * Benchmark : : DenseRange ( int64_t start , int64_t limit , int step ) { <nl> + Benchmark * Benchmark : : DenseRange ( int start , int limit , int step ) { <nl> CHECK ( ArgsCnt ( ) = = - 1 | | ArgsCnt ( ) = = 1 ) ; <nl> CHECK_GE ( start , 0 ) ; <nl> CHECK_LE ( start , limit ) ; <nl> - for ( int64_t arg = start ; arg < = limit ; arg + = step ) { <nl> + for ( int arg = start ; arg < = limit ; arg + = step ) { <nl> args_ . push_back ( { arg } ) ; <nl> } <nl> return this ; <nl> } <nl> <nl> - Benchmark * Benchmark : : Args ( const std : : vector < int64_t > & args ) { <nl> + Benchmark * Benchmark : : Args ( const std : : vector < int > & args ) { <nl> CHECK ( ArgsCnt ( ) = = - 1 | | ArgsCnt ( ) = = static_cast < int > ( args . size ( ) ) ) ; <nl> args_ . push_back ( args ) ; <nl> return this ; <nl> Benchmark * Benchmark : : RangeMultiplier ( int multiplier ) { <nl> return this ; <nl> } <nl> <nl> + <nl> Benchmark * Benchmark : : MinTime ( double t ) { <nl> CHECK ( t > 0 . 0 ) ; <nl> CHECK ( iterations_ = = 0 ) ; <nl> Benchmark * Benchmark : : MinTime ( double t ) { <nl> return this ; <nl> } <nl> <nl> + <nl> Benchmark * Benchmark : : Iterations ( size_t n ) { <nl> CHECK ( n > 0 ) ; <nl> CHECK ( IsZero ( min_time_ ) ) ; <nl> Benchmark * Benchmark : : DenseThreadRange ( int min_threads , int max_threads , <nl> } <nl> <nl> Benchmark * Benchmark : : ThreadPerCpu ( ) { <nl> - thread_counts_ . push_back ( CPUInfo : : Get ( ) . num_cpus ) ; <nl> + static int num_cpus = NumCPUs ( ) ; <nl> + thread_counts_ . push_back ( num_cpus ) ; <nl> return this ; <nl> } <nl> <nl> similarity index 100 % <nl> rename from src / third_party / benchmark - 1 . 4 . 1 / benchmark / src / check . h <nl> rename to src / third_party / benchmark - 1 . 3 . 0 / benchmark / src / check . h <nl> similarity index 100 % <nl> rename from src / third_party / benchmark - 1 . 4 . 1 / benchmark / src / colorprint . cc <nl> rename to src / third_party / benchmark - 1 . 3 . 0 / benchmark / src / colorprint . cc <nl> similarity index 100 % <nl> rename from src / third_party / benchmark - 1 . 4 . 1 / benchmark / src / colorprint . h <nl> rename to src / third_party / benchmark - 1 . 3 . 0 / benchmark / src / colorprint . h <nl> similarity index 100 % <nl> rename from src / third_party / benchmark - 1 . 4 . 1 / benchmark / src / commandlineflags . cc <nl> rename to src / third_party / benchmark - 1 . 3 . 0 / benchmark / src / commandlineflags . cc <nl> similarity index 100 % <nl> rename from src / third_party / benchmark - 1 . 4 . 1 / benchmark / src / commandlineflags . h <nl> rename to src / third_party / benchmark - 1 . 3 . 0 / benchmark / src / commandlineflags . h <nl> similarity index 92 % <nl> rename from src / third_party / benchmark - 1 . 4 . 1 / benchmark / src / complexity . cc <nl> rename to src / third_party / benchmark - 1 . 3 . 0 / benchmark / src / complexity . cc <nl> mmm a / src / third_party / benchmark - 1 . 4 . 1 / benchmark / src / complexity . cc <nl> ppp b / src / third_party / benchmark - 1 . 3 . 0 / benchmark / src / complexity . cc <nl> namespace benchmark { <nl> BigOFunc * FittingCurve ( BigO complexity ) { <nl> switch ( complexity ) { <nl> case oN : <nl> - return [ ] ( int64_t n ) - > double { return static_cast < double > ( n ) ; } ; <nl> + return [ ] ( int n ) - > double { return n ; } ; <nl> case oNSquared : <nl> - return [ ] ( int64_t n ) - > double { return std : : pow ( n , 2 ) ; } ; <nl> + return [ ] ( int n ) - > double { return std : : pow ( n , 2 ) ; } ; <nl> case oNCubed : <nl> - return [ ] ( int64_t n ) - > double { return std : : pow ( n , 3 ) ; } ; <nl> + return [ ] ( int n ) - > double { return std : : pow ( n , 3 ) ; } ; <nl> case oLogN : <nl> - return [ ] ( int64_t n ) { return log2 ( n ) ; } ; <nl> + return [ ] ( int n ) { return log2 ( n ) ; } ; <nl> case oNLogN : <nl> - return [ ] ( int64_t n ) { return n * log2 ( n ) ; } ; <nl> + return [ ] ( int n ) { return n * log2 ( n ) ; } ; <nl> case o1 : <nl> default : <nl> - return [ ] ( int64_t ) { return 1 . 0 ; } ; <nl> + return [ ] ( int ) { return 1 . 0 ; } ; <nl> } <nl> } <nl> <nl> std : : string GetBigOString ( BigO complexity ) { <nl> <nl> / / Find the coefficient for the high - order term in the running time , by <nl> / / minimizing the sum of squares of relative error , for the fitting curve <nl> - / / given by the lambda expression . <nl> + / / given by the lambda expresion . <nl> / / - n : Vector containing the size of the benchmark tests . <nl> / / - time : Vector containing the times for the benchmark tests . <nl> - / / - fitting_curve : lambda expression ( e . g . [ ] ( int64_t n ) { return n ; } ; ) . <nl> + / / - fitting_curve : lambda expresion ( e . g . [ ] ( int n ) { return n ; } ; ) . <nl> <nl> / / For a deeper explanation on the algorithm logic , look the README file at <nl> / / http : / / github . com / ismaelJimenez / Minimal - Cpp - Least - Squared - Fit <nl> <nl> - LeastSq MinimalLeastSq ( const std : : vector < int64_t > & n , <nl> + LeastSq MinimalLeastSq ( const std : : vector < int > & n , <nl> const std : : vector < double > & time , <nl> BigOFunc * fitting_curve ) { <nl> double sigma_gn = 0 . 0 ; <nl> LeastSq MinimalLeastSq ( const std : : vector < int64_t > & n , <nl> / / - complexity : If different than oAuto , the fitting curve will stick to <nl> / / this one . If it is oAuto , it will be calculated the best <nl> / / fitting curve . <nl> - LeastSq MinimalLeastSq ( const std : : vector < int64_t > & n , <nl> + LeastSq MinimalLeastSq ( const std : : vector < int > & n , <nl> const std : : vector < double > & time , const BigO complexity ) { <nl> CHECK_EQ ( n . size ( ) , time . size ( ) ) ; <nl> CHECK_GE ( n . size ( ) , 2 ) ; / / Do not compute fitting curve is less than two <nl> std : : vector < BenchmarkReporter : : Run > ComputeBigO ( <nl> if ( reports . size ( ) < 2 ) return results ; <nl> <nl> / / Accumulators . <nl> - std : : vector < int64_t > n ; <nl> + std : : vector < int > n ; <nl> std : : vector < double > real_time ; <nl> std : : vector < double > cpu_time ; <nl> <nl> similarity index 100 % <nl> rename from src / third_party / benchmark - 1 . 4 . 1 / benchmark / src / complexity . h <nl> rename to src / third_party / benchmark - 1 . 3 . 0 / benchmark / src / complexity . h <nl> similarity index 95 % <nl> rename from src / third_party / benchmark - 1 . 4 . 1 / benchmark / src / console_reporter . cc <nl> rename to src / third_party / benchmark - 1 . 3 . 0 / benchmark / src / console_reporter . cc <nl> mmm a / src / third_party / benchmark - 1 . 4 . 1 / benchmark / src / console_reporter . cc <nl> ppp b / src / third_party / benchmark - 1 . 3 . 0 / benchmark / src / console_reporter . cc <nl> void ConsoleReporter : : PrintRunData ( const Run & result ) { <nl> } <nl> <nl> for ( auto & c : result . counters ) { <nl> - const std : : size_t cNameLen = std : : max ( std : : string : : size_type ( 10 ) , <nl> - c . first . length ( ) ) ; <nl> auto const & s = HumanReadableNumber ( c . second . value , 1000 ) ; <nl> if ( output_options_ & OO_Tabular ) { <nl> if ( c . second . flags & Counter : : kIsRate ) { <nl> - printer ( Out , COLOR_DEFAULT , " % * s / s " , cNameLen - 2 , s . c_str ( ) ) ; <nl> + printer ( Out , COLOR_DEFAULT , " % 8s / s " , s . c_str ( ) ) ; <nl> } else { <nl> - printer ( Out , COLOR_DEFAULT , " % * s " , cNameLen , s . c_str ( ) ) ; <nl> + printer ( Out , COLOR_DEFAULT , " % 10s " , s . c_str ( ) ) ; <nl> } <nl> } else { <nl> const char * unit = ( c . second . flags & Counter : : kIsRate ) ? " / s " : " " ; <nl> similarity index 100 % <nl> rename from src / third_party / benchmark - 1 . 4 . 1 / benchmark / src / counter . cc <nl> rename to src / third_party / benchmark - 1 . 3 . 0 / benchmark / src / counter . cc <nl> similarity index 100 % <nl> rename from src / third_party / benchmark - 1 . 4 . 1 / benchmark / src / counter . h <nl> rename to src / third_party / benchmark - 1 . 3 . 0 / benchmark / src / counter . h <nl> similarity index 100 % <nl> rename from src / third_party / benchmark - 1 . 4 . 1 / benchmark / src / csv_reporter . cc <nl> rename to src / third_party / benchmark - 1 . 3 . 0 / benchmark / src / csv_reporter . cc <nl> similarity index 98 % <nl> rename from src / third_party / benchmark - 1 . 4 . 1 / benchmark / src / cycleclock . h <nl> rename to src / third_party / benchmark - 1 . 3 . 0 / benchmark / src / cycleclock . h <nl> mmm a / src / third_party / benchmark - 1 . 4 . 1 / benchmark / src / cycleclock . h <nl> ppp b / src / third_party / benchmark - 1 . 3 . 0 / benchmark / src / cycleclock . h <nl> inline BENCHMARK_ALWAYS_INLINE int64_t Now ( ) { <nl> struct timeval tv ; <nl> gettimeofday ( & tv , nullptr ) ; <nl> return static_cast < int64_t > ( tv . tv_sec ) * 1000000 + tv . tv_usec ; <nl> - # elif defined ( __s390__ ) / / Covers both s390 and s390x . <nl> - / / Return the CPU clock . <nl> + # elif defined ( __s390__ ) <nl> + / / MONGODB MODIFICATION : Return the CPU clock on s390x . <nl> uint64_t tsc ; <nl> - asm ( " stck % 0 " : " = Q " ( tsc ) : : " cc " ) ; <nl> + asm ( " \ tstck \ t % 0 \ n " : " = Q " ( tsc ) : : " cc " ) ; <nl> return tsc ; <nl> # else <nl> / / The soft failover to a generic implementation is automatic only for ARM . <nl> new file mode 100644 <nl> index 000000000000 . . 942887457f1e <nl> mmm / dev / null <nl> ppp b / src / third_party / benchmark - 1 . 3 . 0 / benchmark / src / internal_macros . h <nl> <nl> + # ifndef BENCHMARK_INTERNAL_MACROS_H_ <nl> + # define BENCHMARK_INTERNAL_MACROS_H_ <nl> + <nl> + # include " benchmark / benchmark . h " <nl> + <nl> + # ifndef __has_feature <nl> + # define __has_feature ( x ) 0 <nl> + # endif <nl> + <nl> + # if defined ( __clang__ ) <nl> + # define COMPILER_CLANG <nl> + # elif defined ( _MSC_VER ) <nl> + # define COMPILER_MSVC <nl> + # elif defined ( __GNUC__ ) <nl> + # define COMPILER_GCC <nl> + # endif <nl> + <nl> + # if __has_feature ( cxx_attributes ) <nl> + # define BENCHMARK_NORETURN [ [ noreturn ] ] <nl> + # elif defined ( __GNUC__ ) <nl> + # define BENCHMARK_NORETURN __attribute__ ( ( noreturn ) ) <nl> + # elif defined ( COMPILER_MSVC ) <nl> + # define BENCHMARK_NORETURN __declspec ( noreturn ) <nl> + # else <nl> + # define BENCHMARK_NORETURN <nl> + # endif <nl> + <nl> + # if defined ( __CYGWIN__ ) <nl> + # define BENCHMARK_OS_CYGWIN 1 <nl> + # elif defined ( _WIN32 ) <nl> + # define BENCHMARK_OS_WINDOWS 1 <nl> + # elif defined ( __APPLE__ ) <nl> + # include " TargetConditionals . h " <nl> + # if defined ( TARGET_OS_MAC ) <nl> + # define BENCHMARK_OS_MACOSX 1 <nl> + # if defined ( TARGET_OS_IPHONE ) <nl> + # define BENCHMARK_OS_IOS 1 <nl> + # endif <nl> + # endif <nl> + # elif defined ( __FreeBSD__ ) <nl> + # define BENCHMARK_OS_FREEBSD 1 <nl> + # elif defined ( __linux__ ) <nl> + # define BENCHMARK_OS_LINUX 1 <nl> + # elif defined ( __native_client__ ) <nl> + # define BENCHMARK_OS_NACL 1 <nl> + # elif defined ( EMSCRIPTEN ) <nl> + # define BENCHMARK_OS_EMSCRIPTEN 1 <nl> + # elif defined ( __rtems__ ) <nl> + # define BENCHMARK_OS_RTEMS 1 <nl> + # endif <nl> + <nl> + # if ! __has_feature ( cxx_exceptions ) & & ! defined ( __cpp_exceptions ) \ <nl> + & & ! defined ( __EXCEPTIONS ) <nl> + # define BENCHMARK_HAS_NO_EXCEPTIONS <nl> + # endif <nl> + <nl> + # endif / / BENCHMARK_INTERNAL_MACROS_H_ <nl> similarity index 78 % <nl> rename from src / third_party / benchmark - 1 . 4 . 1 / benchmark / src / json_reporter . cc <nl> rename to src / third_party / benchmark - 1 . 3 . 0 / benchmark / src / json_reporter . cc <nl> mmm a / src / third_party / benchmark - 1 . 4 . 1 / benchmark / src / json_reporter . cc <nl> ppp b / src / third_party / benchmark - 1 . 3 . 0 / benchmark / src / json_reporter . cc <nl> namespace benchmark { <nl> namespace { <nl> <nl> std : : string FormatKV ( std : : string const & key , std : : string const & value ) { <nl> - return StrFormat ( " \ " % s \ " : \ " % s \ " " , key . c_str ( ) , value . c_str ( ) ) ; <nl> + return StringPrintF ( " \ " % s \ " : \ " % s \ " " , key . c_str ( ) , value . c_str ( ) ) ; <nl> } <nl> <nl> std : : string FormatKV ( std : : string const & key , const char * value ) { <nl> - return StrFormat ( " \ " % s \ " : \ " % s \ " " , key . c_str ( ) , value ) ; <nl> + return StringPrintF ( " \ " % s \ " : \ " % s \ " " , key . c_str ( ) , value ) ; <nl> } <nl> <nl> std : : string FormatKV ( std : : string const & key , bool value ) { <nl> - return StrFormat ( " \ " % s \ " : % s " , key . c_str ( ) , value ? " true " : " false " ) ; <nl> + return StringPrintF ( " \ " % s \ " : % s " , key . c_str ( ) , value ? " true " : " false " ) ; <nl> } <nl> <nl> std : : string FormatKV ( std : : string const & key , int64_t value ) { <nl> bool JSONReporter : : ReportContext ( const Context & context ) { <nl> std : : string walltime_value = LocalDateTimeString ( ) ; <nl> out < < indent < < FormatKV ( " date " , walltime_value ) < < " , \ n " ; <nl> <nl> - if ( Context : : executable_name ) { <nl> - out < < indent < < FormatKV ( " executable " , Context : : executable_name ) < < " , \ n " ; <nl> - } <nl> - <nl> - CPUInfo const & info = context . cpu_info ; <nl> - out < < indent < < FormatKV ( " num_cpus " , static_cast < int64_t > ( info . num_cpus ) ) <nl> + out < < indent < < FormatKV ( " num_cpus " , static_cast < int64_t > ( context . num_cpus ) ) <nl> < < " , \ n " ; <nl> - out < < indent <nl> - < < FormatKV ( " mhz_per_cpu " , <nl> - RoundDouble ( info . cycles_per_second / 1000000 . 0 ) ) <nl> + out < < indent < < FormatKV ( " mhz_per_cpu " , RoundDouble ( context . mhz_per_cpu ) ) <nl> < < " , \ n " ; <nl> - out < < indent < < FormatKV ( " cpu_scaling_enabled " , info . scaling_enabled ) <nl> + out < < indent < < FormatKV ( " cpu_scaling_enabled " , context . cpu_scaling_enabled ) <nl> < < " , \ n " ; <nl> <nl> - out < < indent < < " \ " caches \ " : [ \ n " ; <nl> - indent = std : : string ( 6 , ' ' ) ; <nl> - std : : string cache_indent ( 8 , ' ' ) ; <nl> - for ( size_t i = 0 ; i < info . caches . size ( ) ; + + i ) { <nl> - auto & CI = info . caches [ i ] ; <nl> - out < < indent < < " { \ n " ; <nl> - out < < cache_indent < < FormatKV ( " type " , CI . type ) < < " , \ n " ; <nl> - out < < cache_indent < < FormatKV ( " level " , static_cast < int64_t > ( CI . level ) ) <nl> - < < " , \ n " ; <nl> - out < < cache_indent <nl> - < < FormatKV ( " size " , static_cast < int64_t > ( CI . size ) * 1000u ) < < " , \ n " ; <nl> - out < < cache_indent <nl> - < < FormatKV ( " num_sharing " , static_cast < int64_t > ( CI . num_sharing ) ) <nl> - < < " \ n " ; <nl> - out < < indent < < " } " ; <nl> - if ( i ! = info . caches . size ( ) - 1 ) out < < " , " ; <nl> - out < < " \ n " ; <nl> - } <nl> - indent = std : : string ( 4 , ' ' ) ; <nl> - out < < indent < < " ] , \ n " ; <nl> - <nl> # if defined ( NDEBUG ) <nl> const char build_type [ ] = " release " ; <nl> # else <nl> similarity index 100 % <nl> rename from src / third_party / benchmark - 1 . 4 . 1 / benchmark / src / log . h <nl> rename to src / third_party / benchmark - 1 . 3 . 0 / benchmark / src / log . h <nl> similarity index 100 % <nl> rename from src / third_party / benchmark - 1 . 4 . 1 / benchmark / src / mutex . h <nl> rename to src / third_party / benchmark - 1 . 3 . 0 / benchmark / src / mutex . h <nl> similarity index 84 % <nl> rename from src / third_party / benchmark - 1 . 4 . 1 / benchmark / src / re . h <nl> rename to src / third_party / benchmark - 1 . 3 . 0 / benchmark / src / re . h <nl> mmm a / src / third_party / benchmark - 1 . 4 . 1 / benchmark / src / re . h <nl> ppp b / src / third_party / benchmark - 1 . 3 . 0 / benchmark / src / re . h <nl> <nl> <nl> # include " internal_macros . h " <nl> <nl> - # if ! defined ( HAVE_STD_REGEX ) & & \ <nl> - ! defined ( HAVE_GNU_POSIX_REGEX ) & & \ <nl> - ! defined ( HAVE_POSIX_REGEX ) <nl> - / / No explicit regex selection ; detect based on builtin hints . <nl> - # if defined ( BENCHMARK_OS_LINUX ) | | defined ( BENCHMARK_OS_APPLE ) <nl> - # define HAVE_POSIX_REGEX 1 <nl> - # elif __cplusplus > = 199711L <nl> - # define HAVE_STD_REGEX 1 <nl> - # endif <nl> - # endif <nl> - <nl> / / Prefer C regex libraries when compiling w / o exceptions so that we can <nl> / / correctly report errors . <nl> - # if defined ( BENCHMARK_HAS_NO_EXCEPTIONS ) & & \ <nl> - defined ( BENCHMARK_HAVE_STD_REGEX ) & & \ <nl> + # if defined ( BENCHMARK_HAS_NO_EXCEPTIONS ) & & defined ( HAVE_STD_REGEX ) & & \ <nl> ( defined ( HAVE_GNU_POSIX_REGEX ) | | defined ( HAVE_POSIX_REGEX ) ) <nl> - # undef HAVE_STD_REGEX <nl> + # undef HAVE_STD_REGEX <nl> # endif <nl> <nl> # if defined ( HAVE_STD_REGEX ) <nl> - # include < regex > <nl> + # include < regex > <nl> # elif defined ( HAVE_GNU_POSIX_REGEX ) <nl> - # include < gnuregex . h > <nl> + # include < gnuregex . h > <nl> # elif defined ( HAVE_POSIX_REGEX ) <nl> - # include < regex . h > <nl> + # include < regex . h > <nl> # else <nl> # error No regular expression backend was found ! <nl> # endif <nl> class Regex { <nl> # elif defined ( HAVE_POSIX_REGEX ) | | defined ( HAVE_GNU_POSIX_REGEX ) <nl> regex_t re_ ; <nl> # else <nl> - # error No regular expression backend implementation available <nl> + # error No regular expression backend implementation available <nl> # endif <nl> } ; <nl> <nl> similarity index 69 % <nl> rename from src / third_party / benchmark - 1 . 4 . 1 / benchmark / src / reporter . cc <nl> rename to src / third_party / benchmark - 1 . 3 . 0 / benchmark / src / reporter . cc <nl> mmm a / src / third_party / benchmark - 1 . 4 . 1 / benchmark / src / reporter . cc <nl> ppp b / src / third_party / benchmark - 1 . 3 . 0 / benchmark / src / reporter . cc <nl> void BenchmarkReporter : : PrintBasicContext ( std : : ostream * out , <nl> CHECK ( out ) < < " cannot be null " ; <nl> auto & Out = * out ; <nl> <nl> - Out < < LocalDateTimeString ( ) < < " \ n " ; <nl> - <nl> - if ( context . executable_name ) <nl> - Out < < " Running " < < context . executable_name < < " \ n " ; <nl> + Out < < " Run on ( " < < context . num_cpus < < " X " < < context . mhz_per_cpu <nl> + < < " MHz CPU " < < ( ( context . num_cpus > 1 ) ? " s " : " " ) < < " ) \ n " ; <nl> <nl> - const CPUInfo & info = context . cpu_info ; <nl> - Out < < " Run on ( " < < info . num_cpus < < " X " <nl> - < < ( info . cycles_per_second / 1000000 . 0 ) < < " MHz CPU " <nl> - < < ( ( info . num_cpus > 1 ) ? " s " : " " ) < < " ) \ n " ; <nl> - if ( info . caches . size ( ) ! = 0 ) { <nl> - Out < < " CPU Caches : \ n " ; <nl> - for ( auto & CInfo : info . caches ) { <nl> - Out < < " L " < < CInfo . level < < " " < < CInfo . type < < " " <nl> - < < ( CInfo . size / 1000 ) < < " K " ; <nl> - if ( CInfo . num_sharing ! = 0 ) <nl> - Out < < " ( x " < < ( info . num_cpus / CInfo . num_sharing ) < < " ) " ; <nl> - Out < < " \ n " ; <nl> - } <nl> - } <nl> + Out < < LocalDateTimeString ( ) < < " \ n " ; <nl> <nl> - if ( info . scaling_enabled ) { <nl> + if ( context . cpu_scaling_enabled ) { <nl> Out < < " * * * WARNING * * * CPU scaling is enabled , the benchmark " <nl> " real time measurements may be noisy and will incur extra " <nl> " overhead . \ n " ; <nl> void BenchmarkReporter : : PrintBasicContext ( std : : ostream * out , <nl> # endif <nl> } <nl> <nl> - / / No initializer because it ' s already initialized to NULL . <nl> - const char * BenchmarkReporter : : Context : : executable_name ; <nl> - <nl> - BenchmarkReporter : : Context : : Context ( ) : cpu_info ( CPUInfo : : Get ( ) ) { } <nl> - <nl> double BenchmarkReporter : : Run : : GetAdjustedRealTime ( ) const { <nl> double new_time = real_accumulated_time * GetTimeUnitMultiplier ( time_unit ) ; <nl> if ( iterations ! = 0 ) new_time / = static_cast < double > ( iterations ) ; <nl> similarity index 100 % <nl> rename from src / third_party / benchmark - 1 . 4 . 1 / benchmark / src / sleep . cc <nl> rename to src / third_party / benchmark - 1 . 3 . 0 / benchmark / src / sleep . cc <nl> similarity index 100 % <nl> rename from src / third_party / benchmark - 1 . 4 . 1 / benchmark / src / sleep . h <nl> rename to src / third_party / benchmark - 1 . 3 . 0 / benchmark / src / sleep . h <nl> similarity index 90 % <nl> rename from src / third_party / benchmark - 1 . 4 . 1 / benchmark / src / statistics . cc <nl> rename to src / third_party / benchmark - 1 . 3 . 0 / benchmark / src / statistics . cc <nl> mmm a / src / third_party / benchmark - 1 . 4 . 1 / benchmark / src / statistics . cc <nl> ppp b / src / third_party / benchmark - 1 . 3 . 0 / benchmark / src / statistics . cc <nl> auto StatisticsSum = [ ] ( const std : : vector < double > & v ) { <nl> } ; <nl> <nl> double StatisticsMean ( const std : : vector < double > & v ) { <nl> - if ( v . empty ( ) ) return 0 . 0 ; <nl> + if ( v . size ( ) = = 0 ) return 0 . 0 ; <nl> return StatisticsSum ( v ) * ( 1 . 0 / v . size ( ) ) ; <nl> } <nl> <nl> double StatisticsMedian ( const std : : vector < double > & v ) { <nl> if ( v . size ( ) < 3 ) return StatisticsMean ( v ) ; <nl> - std : : vector < double > copy ( v ) ; <nl> - <nl> - auto center = copy . begin ( ) + v . size ( ) / 2 ; <nl> - std : : nth_element ( copy . begin ( ) , center , copy . end ( ) ) ; <nl> - <nl> - / / did we have an odd number of samples ? <nl> - / / if yes , then center is the median <nl> - / / it no , then we are looking for the average between center and the value before <nl> + std : : vector < double > partial ; <nl> + / / we need roundDown ( count / 2 ) + 1 slots <nl> + partial . resize ( 1 + ( v . size ( ) / 2 ) ) ; <nl> + std : : partial_sort_copy ( v . begin ( ) , v . end ( ) , partial . begin ( ) , partial . end ( ) ) ; <nl> + / / did we have odd number of samples ? <nl> + / / if yes , then the last element of partially - sorted vector is the median <nl> + / / it no , then the average of the last two elements is the median <nl> if ( v . size ( ) % 2 = = 1 ) <nl> - return * center ; <nl> - auto center2 = copy . begin ( ) + v . size ( ) / 2 - 1 ; <nl> - std : : nth_element ( copy . begin ( ) , center2 , copy . end ( ) ) ; <nl> - return ( * center + * center2 ) / 2 . 0 ; <nl> + return partial . back ( ) ; <nl> + return ( partial [ partial . size ( ) - 2 ] + partial [ partial . size ( ) - 1 ] ) / 2 . 0 ; <nl> } <nl> <nl> / / Return the sum of the squares of this sample set <nl> auto Sqrt = [ ] ( const double dat ) { <nl> <nl> double StatisticsStdDev ( const std : : vector < double > & v ) { <nl> const auto mean = StatisticsMean ( v ) ; <nl> - if ( v . empty ( ) ) return mean ; <nl> + if ( v . size ( ) = = 0 ) return mean ; <nl> <nl> / / Sample standard deviation is undefined for n = 1 <nl> if ( v . size ( ) = = 1 ) <nl> similarity index 100 % <nl> rename from src / third_party / benchmark - 1 . 4 . 1 / benchmark / src / statistics . h <nl> rename to src / third_party / benchmark - 1 . 3 . 0 / benchmark / src / statistics . h <nl> similarity index 96 % <nl> rename from src / third_party / benchmark - 1 . 4 . 1 / benchmark / src / string_util . cc <nl> rename to src / third_party / benchmark - 1 . 3 . 0 / benchmark / src / string_util . cc <nl> mmm a / src / third_party / benchmark - 1 . 4 . 1 / benchmark / src / string_util . cc <nl> ppp b / src / third_party / benchmark - 1 . 3 . 0 / benchmark / src / string_util . cc <nl> std : : string HumanReadableNumber ( double n , double one_k ) { <nl> return ToBinaryStringFullySpecified ( n , 1 . 1 , 1 , one_k ) ; <nl> } <nl> <nl> - std : : string StrFormatImp ( const char * msg , va_list args ) { <nl> + std : : string StringPrintFImp ( const char * msg , va_list args ) { <nl> / / we might need a second shot at this , so pre - emptivly make a copy <nl> va_list args_cp ; <nl> va_copy ( args_cp , args ) ; <nl> std : : string StrFormatImp ( const char * msg , va_list args ) { <nl> return std : : string ( buff_ptr . get ( ) ) ; <nl> } <nl> <nl> - std : : string StrFormat ( const char * format , . . . ) { <nl> + std : : string StringPrintF ( const char * format , . . . ) { <nl> va_list args ; <nl> va_start ( args , format ) ; <nl> - std : : string tmp = StrFormatImp ( format , args ) ; <nl> + std : : string tmp = StringPrintFImp ( format , args ) ; <nl> va_end ( args ) ; <nl> return tmp ; <nl> } <nl> similarity index 70 % <nl> rename from src / third_party / benchmark - 1 . 4 . 1 / benchmark / src / string_util . h <nl> rename to src / third_party / benchmark - 1 . 3 . 0 / benchmark / src / string_util . h <nl> mmm a / src / third_party / benchmark - 1 . 4 . 1 / benchmark / src / string_util . h <nl> ppp b / src / third_party / benchmark - 1 . 3 . 0 / benchmark / src / string_util . h <nl> void AppendHumanReadable ( int n , std : : string * str ) ; <nl> <nl> std : : string HumanReadableNumber ( double n , double one_k = 1024 . 0 ) ; <nl> <nl> - std : : string StrFormat ( const char * format , . . . ) ; <nl> + std : : string StringPrintF ( const char * format , . . . ) ; <nl> <nl> - inline std : : ostream & StrCatImp ( std : : ostream & out ) BENCHMARK_NOEXCEPT { <nl> + inline std : : ostream & StringCatImp ( std : : ostream & out ) BENCHMARK_NOEXCEPT { <nl> return out ; <nl> } <nl> <nl> template < class First , class . . . Rest > <nl> - inline std : : ostream & StrCatImp ( std : : ostream & out , First & & f , <nl> + inline std : : ostream & StringCatImp ( std : : ostream & out , First & & f , <nl> Rest & & . . . rest ) { <nl> out < < std : : forward < First > ( f ) ; <nl> - return StrCatImp ( out , std : : forward < Rest > ( rest ) . . . ) ; <nl> + return StringCatImp ( out , std : : forward < Rest > ( rest ) . . . ) ; <nl> } <nl> <nl> template < class . . . Args > <nl> inline std : : string StrCat ( Args & & . . . args ) { <nl> std : : ostringstream ss ; <nl> - StrCatImp ( ss , std : : forward < Args > ( args ) . . . ) ; <nl> + StringCatImp ( ss , std : : forward < Args > ( args ) . . . ) ; <nl> return ss . str ( ) ; <nl> } <nl> <nl> new file mode 100644 <nl> index 000000000000 . . 7feb79e65f20 <nl> mmm / dev / null <nl> ppp b / src / third_party / benchmark - 1 . 3 . 0 / benchmark / src / sysinfo . cc <nl> <nl> + / / Copyright 2015 Google Inc . All rights reserved . <nl> + / / <nl> + / / Licensed under the Apache License , Version 2 . 0 ( the " License " ) ; <nl> + / / you may not use this file except in compliance with the License . <nl> + / / You may obtain a copy of the License at <nl> + / / <nl> + / / http : / / www . apache . org / licenses / LICENSE - 2 . 0 <nl> + / / <nl> + / / Unless required by applicable law or agreed to in writing , software <nl> + / / distributed under the License is distributed on an " AS IS " BASIS , <nl> + / / WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND , either express or implied . <nl> + / / See the License for the specific language governing permissions and <nl> + / / limitations under the License . <nl> + <nl> + # include " sysinfo . h " <nl> + # include " internal_macros . h " <nl> + <nl> + # ifdef BENCHMARK_OS_WINDOWS <nl> + # include < Shlwapi . h > <nl> + # include < VersionHelpers . h > <nl> + # include < Windows . h > <nl> + # else <nl> + # include < fcntl . h > <nl> + # include < sys / resource . h > <nl> + # include < sys / time . h > <nl> + # include < sys / types . h > / / this header must be included before ' sys / sysctl . h ' to avoid compilation error on FreeBSD <nl> + # include < unistd . h > <nl> + # if defined BENCHMARK_OS_FREEBSD | | defined BENCHMARK_OS_MACOSX <nl> + # include < sys / sysctl . h > <nl> + # endif <nl> + # endif <nl> + <nl> + # include < cerrno > <nl> + # include < cstdint > <nl> + # include < cstdio > <nl> + # include < cstdlib > <nl> + # include < cstring > <nl> + # include < iostream > <nl> + # include < limits > <nl> + # include < mutex > <nl> + <nl> + # include " arraysize . h " <nl> + # include " check . h " <nl> + # include " cycleclock . h " <nl> + # include " internal_macros . h " <nl> + # include " log . h " <nl> + # include " sleep . h " <nl> + # include " string_util . h " <nl> + <nl> + namespace benchmark { <nl> + namespace { <nl> + std : : once_flag cpuinfo_init ; <nl> + double cpuinfo_cycles_per_second = 1 . 0 ; <nl> + int cpuinfo_num_cpus = 1 ; / / Conservative guess <nl> + <nl> + # if ! defined BENCHMARK_OS_MACOSX <nl> + const int64_t estimate_time_ms = 1000 ; <nl> + <nl> + / / Helper function estimates cycles / sec by observing cycles elapsed during <nl> + / / sleep ( ) . Using small sleep time decreases accuracy significantly . <nl> + int64_t EstimateCyclesPerSecond ( ) { <nl> + const int64_t start_ticks = cycleclock : : Now ( ) ; <nl> + SleepForMilliseconds ( estimate_time_ms ) ; <nl> + return cycleclock : : Now ( ) - start_ticks ; <nl> + } <nl> + # endif <nl> + <nl> + # if defined BENCHMARK_OS_LINUX | | defined BENCHMARK_OS_CYGWIN <nl> + / / Helper function for reading an int from a file . Returns true if successful <nl> + / / and the memory location pointed to by value is set to the value read . <nl> + bool ReadIntFromFile ( const char * file , long * value ) { <nl> + bool ret = false ; <nl> + int fd = open ( file , O_RDONLY ) ; <nl> + if ( fd ! = - 1 ) { <nl> + char line [ 1024 ] ; <nl> + char * err ; <nl> + memset ( line , ' \ 0 ' , sizeof ( line ) ) ; <nl> + ssize_t read_err = read ( fd , line , sizeof ( line ) - 1 ) ; <nl> + ( ( void ) read_err ) ; / / prevent unused warning <nl> + CHECK ( read_err > = 0 ) ; <nl> + const long temp_value = strtol ( line , & err , 10 ) ; <nl> + if ( line [ 0 ] ! = ' \ 0 ' & & ( * err = = ' \ n ' | | * err = = ' \ 0 ' ) ) { <nl> + * value = temp_value ; <nl> + ret = true ; <nl> + } <nl> + close ( fd ) ; <nl> + } <nl> + return ret ; <nl> + } <nl> + # endif <nl> + <nl> + # if defined BENCHMARK_OS_LINUX | | defined BENCHMARK_OS_CYGWIN <nl> + static std : : string convertToLowerCase ( std : : string s ) { <nl> + for ( auto & ch : s ) <nl> + ch = std : : tolower ( ch ) ; <nl> + return s ; <nl> + } <nl> + static bool startsWithKey ( std : : string Value , std : : string Key , <nl> + bool IgnoreCase = true ) { <nl> + if ( IgnoreCase ) { <nl> + Key = convertToLowerCase ( std : : move ( Key ) ) ; <nl> + Value = convertToLowerCase ( std : : move ( Value ) ) ; <nl> + } <nl> + return Value . compare ( 0 , Key . size ( ) , Key ) = = 0 ; <nl> + } <nl> + # endif <nl> + <nl> + void InitializeSystemInfo ( ) { <nl> + # if defined BENCHMARK_OS_LINUX | | defined BENCHMARK_OS_CYGWIN <nl> + char line [ 1024 ] ; <nl> + char * err ; <nl> + long freq ; <nl> + <nl> + bool saw_mhz = false ; <nl> + <nl> + / / If the kernel is exporting the tsc frequency use that . There are issues <nl> + / / where cpuinfo_max_freq cannot be relied on because the BIOS may be <nl> + / / exporintg an invalid p - state ( on x86 ) or p - states may be used to put the <nl> + / / processor in a new mode ( turbo mode ) . Essentially , those frequencies <nl> + / / cannot always be relied upon . The same reasons apply to / proc / cpuinfo as <nl> + / / well . <nl> + if ( ! saw_mhz & & <nl> + ReadIntFromFile ( " / sys / devices / system / cpu / cpu0 / tsc_freq_khz " , & freq ) ) { <nl> + / / The value is in kHz ( as the file name suggests ) . For example , on a <nl> + / / 2GHz warpstation , the file contains the value " 2000000 " . <nl> + cpuinfo_cycles_per_second = freq * 1000 . 0 ; <nl> + saw_mhz = true ; <nl> + } <nl> + <nl> + / / If CPU scaling is in effect , we want to use the * maximum * frequency , <nl> + / / not whatever CPU speed some random processor happens to be using now . <nl> + if ( ! saw_mhz & & <nl> + ReadIntFromFile ( " / sys / devices / system / cpu / cpu0 / cpufreq / cpuinfo_max_freq " , <nl> + & freq ) ) { <nl> + / / The value is in kHz . For example , on a 2GHz warpstation , the file <nl> + / / contains the value " 2000000 " . <nl> + cpuinfo_cycles_per_second = freq * 1000 . 0 ; <nl> + saw_mhz = true ; <nl> + } <nl> + <nl> + / / Read / proc / cpuinfo for other values , and if there is no cpuinfo_max_freq . <nl> + const char * pname = " / proc / cpuinfo " ; <nl> + int fd = open ( pname , O_RDONLY ) ; <nl> + if ( fd = = - 1 ) { <nl> + perror ( pname ) ; <nl> + if ( ! saw_mhz ) { <nl> + cpuinfo_cycles_per_second = <nl> + static_cast < double > ( EstimateCyclesPerSecond ( ) ) ; <nl> + } <nl> + return ; <nl> + } <nl> + <nl> + double bogo_clock = 1 . 0 ; <nl> + bool saw_bogo = false ; <nl> + long max_cpu_id = 0 ; <nl> + int num_cpus = 0 ; <nl> + line [ 0 ] = line [ 1 ] = ' \ 0 ' ; <nl> + size_t chars_read = 0 ; <nl> + do { / / we ' ll exit when the last read didn ' t read anything <nl> + / / Move the next line to the beginning of the buffer <nl> + const size_t oldlinelen = strlen ( line ) ; <nl> + if ( sizeof ( line ) = = oldlinelen + 1 ) / / oldlinelen took up entire line <nl> + line [ 0 ] = ' \ 0 ' ; <nl> + else / / still other lines left to save <nl> + memmove ( line , line + oldlinelen + 1 , sizeof ( line ) - ( oldlinelen + 1 ) ) ; <nl> + / / Terminate the new line , reading more if we can ' t find the newline <nl> + char * newline = strchr ( line , ' \ n ' ) ; <nl> + if ( newline = = nullptr ) { <nl> + const size_t linelen = strlen ( line ) ; <nl> + const size_t bytes_to_read = sizeof ( line ) - 1 - linelen ; <nl> + CHECK ( bytes_to_read > 0 ) ; / / because the memmove recovered > = 1 bytes <nl> + chars_read = read ( fd , line + linelen , bytes_to_read ) ; <nl> + line [ linelen + chars_read ] = ' \ 0 ' ; <nl> + newline = strchr ( line , ' \ n ' ) ; <nl> + } <nl> + if ( newline ! = nullptr ) * newline = ' \ 0 ' ; <nl> + <nl> + / / When parsing the " cpu MHz " and " bogomips " ( fallback ) entries , we only <nl> + / / accept postive values . Some environments ( virtual machines ) report zero , <nl> + / / which would cause infinite looping in WallTime_Init . <nl> + if ( ! saw_mhz & & startsWithKey ( line , " cpu MHz " ) ) { <nl> + const char * freqstr = strchr ( line , ' : ' ) ; <nl> + if ( freqstr ) { <nl> + cpuinfo_cycles_per_second = strtod ( freqstr + 1 , & err ) * 1000000 . 0 ; <nl> + if ( freqstr [ 1 ] ! = ' \ 0 ' & & * err = = ' \ 0 ' & & cpuinfo_cycles_per_second > 0 ) <nl> + saw_mhz = true ; <nl> + } <nl> + } else if ( startsWithKey ( line , " bogomips " ) ) { <nl> + const char * freqstr = strchr ( line , ' : ' ) ; <nl> + if ( freqstr ) { <nl> + bogo_clock = strtod ( freqstr + 1 , & err ) * 1000000 . 0 ; <nl> + if ( freqstr [ 1 ] ! = ' \ 0 ' & & * err = = ' \ 0 ' & & bogo_clock > 0 ) <nl> + saw_bogo = true ; <nl> + } <nl> + } else if ( startsWithKey ( line , " processor " , / * IgnoreCase * / false ) ) { <nl> + / / The above comparison is case - sensitive because ARM kernels often <nl> + / / include a " Processor " line that tells you about the CPU , distinct <nl> + / / from the usual " processor " lines that give you CPU ids . No current <nl> + / / Linux architecture is using " Processor " for CPU ids . <nl> + num_cpus + + ; / / count up every time we see an " processor : " entry <nl> + const char * id_str = strchr ( line , ' : ' ) ; <nl> + if ( id_str ) { <nl> + const long cpu_id = strtol ( id_str + 1 , & err , 10 ) ; <nl> + if ( id_str [ 1 ] ! = ' \ 0 ' & & * err = = ' \ 0 ' & & max_cpu_id < cpu_id ) <nl> + max_cpu_id = cpu_id ; <nl> + } <nl> + } <nl> + } while ( chars_read > 0 ) ; <nl> + close ( fd ) ; <nl> + <nl> + if ( ! saw_mhz ) { <nl> + if ( saw_bogo ) { <nl> + / / If we didn ' t find anything better , we ' ll use bogomips , but <nl> + / / we ' re not happy about it . <nl> + cpuinfo_cycles_per_second = bogo_clock ; <nl> + } else { <nl> + / / If we don ' t even have bogomips , we ' ll use the slow estimation . <nl> + cpuinfo_cycles_per_second = <nl> + static_cast < double > ( EstimateCyclesPerSecond ( ) ) ; <nl> + } <nl> + } <nl> + if ( num_cpus = = 0 ) { <nl> + fprintf ( stderr , " Failed to read num . CPUs correctly from / proc / cpuinfo \ n " ) ; <nl> + } else { <nl> + if ( ( max_cpu_id + 1 ) ! = num_cpus ) { <nl> + fprintf ( stderr , <nl> + " CPU ID assignments in / proc / cpuinfo seem messed up . " <nl> + " This is usually caused by a bad BIOS . \ n " ) ; <nl> + } <nl> + cpuinfo_num_cpus = num_cpus ; <nl> + } <nl> + <nl> + # elif defined BENCHMARK_OS_FREEBSD <nl> + / / For this sysctl to work , the machine must be configured without <nl> + / / SMP , APIC , or APM support . hz should be 64 - bit in freebsd 7 . 0 <nl> + / / and later . Before that , it ' s a 32 - bit quantity ( and gives the <nl> + / / wrong answer on machines faster than 2 ^ 32 Hz ) . See <nl> + / / http : / / lists . freebsd . org / pipermail / freebsd - i386 / 2004 - November / 001846 . html <nl> + / / But also compare FreeBSD 7 . 0 : <nl> + / / http : / / fxr . watson . org / fxr / source / i386 / i386 / tsc . c ? v = RELENG70 # L223 <nl> + / / 231 error = sysctl_handle_quad ( oidp , & freq , 0 , req ) ; <nl> + / / To FreeBSD 6 . 3 ( it ' s the same in 6 - STABLE ) : <nl> + / / http : / / fxr . watson . org / fxr / source / i386 / i386 / tsc . c ? v = RELENG6 # L131 <nl> + / / 139 error = sysctl_handle_int ( oidp , & freq , sizeof ( freq ) , req ) ; <nl> + # if __FreeBSD__ > = 7 <nl> + uint64_t hz = 0 ; <nl> + # else <nl> + unsigned int hz = 0 ; <nl> + # endif <nl> + size_t sz = sizeof ( hz ) ; <nl> + const char * sysctl_path = " machdep . tsc_freq " ; <nl> + if ( sysctlbyname ( sysctl_path , & hz , & sz , nullptr , 0 ) ! = 0 ) { <nl> + fprintf ( stderr , " Unable to determine clock rate from sysctl : % s : % s \ n " , <nl> + sysctl_path , strerror ( errno ) ) ; <nl> + cpuinfo_cycles_per_second = static_cast < double > ( EstimateCyclesPerSecond ( ) ) ; <nl> + } else { <nl> + cpuinfo_cycles_per_second = hz ; <nl> + } <nl> + / / TODO : also figure out cpuinfo_num_cpus <nl> + <nl> + # elif defined BENCHMARK_OS_WINDOWS <nl> + / / In NT , read MHz from the registry . If we fail to do so or we ' re in win9x <nl> + / / then make a crude estimate . <nl> + DWORD data , data_size = sizeof ( data ) ; <nl> + if ( IsWindowsXPOrGreater ( ) & & <nl> + SUCCEEDED ( <nl> + SHGetValueA ( HKEY_LOCAL_MACHINE , <nl> + " HARDWARE \ \ DESCRIPTION \ \ System \ \ CentralProcessor \ \ 0 " , <nl> + " ~ MHz " , nullptr , & data , & data_size ) ) ) <nl> + cpuinfo_cycles_per_second = <nl> + static_cast < double > ( ( int64_t ) data * ( int64_t ) ( 1000 * 1000 ) ) ; / / was mhz <nl> + else <nl> + cpuinfo_cycles_per_second = static_cast < double > ( EstimateCyclesPerSecond ( ) ) ; <nl> + <nl> + SYSTEM_INFO sysinfo ; <nl> + / / Use memset as opposed to = { } to avoid GCC missing initializer false <nl> + / / positives . <nl> + std : : memset ( & sysinfo , 0 , sizeof ( SYSTEM_INFO ) ) ; <nl> + GetSystemInfo ( & sysinfo ) ; <nl> + cpuinfo_num_cpus = sysinfo . dwNumberOfProcessors ; / / number of logical <nl> + / / processors in the current <nl> + / / group <nl> + <nl> + # elif defined BENCHMARK_OS_MACOSX <nl> + int32_t num_cpus = 0 ; <nl> + size_t size = sizeof ( num_cpus ) ; <nl> + if ( : : sysctlbyname ( " hw . ncpu " , & num_cpus , & size , nullptr , 0 ) = = 0 & & <nl> + ( size = = sizeof ( num_cpus ) ) ) { <nl> + cpuinfo_num_cpus = num_cpus ; <nl> + } else { <nl> + fprintf ( stderr , " % s \ n " , strerror ( errno ) ) ; <nl> + std : : exit ( EXIT_FAILURE ) ; <nl> + } <nl> + int64_t cpu_freq = 0 ; <nl> + size = sizeof ( cpu_freq ) ; <nl> + if ( : : sysctlbyname ( " hw . cpufrequency " , & cpu_freq , & size , nullptr , 0 ) = = 0 & & <nl> + ( size = = sizeof ( cpu_freq ) ) ) { <nl> + cpuinfo_cycles_per_second = cpu_freq ; <nl> + } else { <nl> + # if defined BENCHMARK_OS_IOS <nl> + fprintf ( stderr , " CPU frequency cannot be detected . \ n " ) ; <nl> + cpuinfo_cycles_per_second = 0 ; <nl> + # else <nl> + fprintf ( stderr , " % s \ n " , strerror ( errno ) ) ; <nl> + std : : exit ( EXIT_FAILURE ) ; <nl> + # endif <nl> + } <nl> + # else <nl> + / / Generic cycles per second counter <nl> + cpuinfo_cycles_per_second = static_cast < double > ( EstimateCyclesPerSecond ( ) ) ; <nl> + # endif <nl> + } <nl> + <nl> + } / / end namespace <nl> + <nl> + double CyclesPerSecond ( void ) { <nl> + std : : call_once ( cpuinfo_init , InitializeSystemInfo ) ; <nl> + return cpuinfo_cycles_per_second ; <nl> + } <nl> + <nl> + int NumCPUs ( void ) { <nl> + std : : call_once ( cpuinfo_init , InitializeSystemInfo ) ; <nl> + return cpuinfo_num_cpus ; <nl> + } <nl> + <nl> + / / The " " ' s catch people who don ' t pass in a literal for " str " <nl> + # define strliterallen ( str ) ( sizeof ( " " str " " ) - 1 ) <nl> + <nl> + / / Must use a string literal for prefix . <nl> + # define memprefix ( str , len , prefix ) \ <nl> + ( ( ( ( len ) > = strliterallen ( prefix ) ) & & \ <nl> + std : : memcmp ( str , prefix , strliterallen ( prefix ) ) = = 0 ) \ <nl> + ? str + strliterallen ( prefix ) \ <nl> + : nullptr ) <nl> + <nl> + bool CpuScalingEnabled ( ) { <nl> + # ifndef BENCHMARK_OS_WINDOWS <nl> + / / On Linux , the CPUfreq subsystem exposes CPU information as files on the <nl> + / / local file system . If reading the exported files fails , then we may not be <nl> + / / running on Linux , so we silently ignore all the read errors . <nl> + for ( int cpu = 0 , num_cpus = NumCPUs ( ) ; cpu < num_cpus ; + + cpu ) { <nl> + std : : string governor_file = <nl> + StrCat ( " / sys / devices / system / cpu / cpu " , cpu , " / cpufreq / scaling_governor " ) ; <nl> + FILE * file = fopen ( governor_file . c_str ( ) , " r " ) ; <nl> + if ( ! file ) break ; <nl> + char buff [ 16 ] ; <nl> + size_t bytes_read = fread ( buff , 1 , sizeof ( buff ) , file ) ; <nl> + fclose ( file ) ; <nl> + if ( memprefix ( buff , bytes_read , " performance " ) = = nullptr ) return true ; <nl> + } <nl> + # endif <nl> + return false ; <nl> + } <nl> + <nl> + } / / end namespace benchmark <nl> new file mode 100644 <nl> index 000000000000 . . c5d9916d2dde <nl> mmm / dev / null <nl> ppp b / src / third_party / benchmark - 1 . 3 . 0 / benchmark / src / sysinfo . h <nl> <nl> + # ifndef BENCHMARK_SYSINFO_H_ <nl> + # define BENCHMARK_SYSINFO_H_ <nl> + <nl> + namespace benchmark { <nl> + int NumCPUs ( ) ; <nl> + double CyclesPerSecond ( ) ; <nl> + bool CpuScalingEnabled ( ) ; <nl> + } / / end namespace benchmark <nl> + <nl> + # endif / / BENCHMARK_SYSINFO_H_ <nl> similarity index 95 % <nl> rename from src / third_party / benchmark - 1 . 4 . 1 / benchmark / src / timers . cc <nl> rename to src / third_party / benchmark - 1 . 3 . 0 / benchmark / src / timers . cc <nl> mmm a / src / third_party / benchmark - 1 . 4 . 1 / benchmark / src / timers . cc <nl> ppp b / src / third_party / benchmark - 1 . 3 . 0 / benchmark / src / timers . cc <nl> <nl> <nl> # ifdef BENCHMARK_OS_WINDOWS <nl> # include < Shlwapi . h > <nl> - # undef StrCat / / Don ' t let StrCat in string_util . h be renamed to lstrcatA <nl> # include < VersionHelpers . h > <nl> # include < Windows . h > <nl> # else <nl> # include < fcntl . h > <nl> - # ifndef BENCHMARK_OS_FUCHSIA <nl> # include < sys / resource . h > <nl> - # endif <nl> # include < sys / time . h > <nl> # include < sys / types . h > / / this header must be included before ' sys / sysctl . h ' to avoid compilation error on FreeBSD <nl> # include < unistd . h > <nl> double MakeTime ( FILETIME const & kernel_time , FILETIME const & user_time ) { <nl> static_cast < double > ( user . QuadPart ) ) * <nl> 1e - 7 ; <nl> } <nl> - # elif ! defined ( BENCHMARK_OS_FUCHSIA ) <nl> + # else <nl> double MakeTime ( struct rusage const & ru ) { <nl> return ( static_cast < double > ( ru . ru_utime . tv_sec ) + <nl> static_cast < double > ( ru . ru_utime . tv_usec ) * 1e - 6 + <nl> double ThreadCPUUsage ( ) { <nl> / / RTEMS doesn ' t support CLOCK_THREAD_CPUTIME_ID . See <nl> / / https : / / github . com / RTEMS / rtems / blob / master / cpukit / posix / src / clockgettime . c <nl> return ProcessCPUUsage ( ) ; <nl> - # elif defined ( BENCHMARK_OS_SOLARIS ) <nl> - struct rusage ru ; <nl> - if ( getrusage ( RUSAGE_LWP , & ru ) = = 0 ) return MakeTime ( ru ) ; <nl> - DiagnoseAndExit ( " getrusage ( RUSAGE_LWP , . . . ) failed " ) ; <nl> # elif defined ( CLOCK_THREAD_CPUTIME_ID ) <nl> struct timespec ts ; <nl> if ( clock_gettime ( CLOCK_THREAD_CPUTIME_ID , & ts ) = = 0 ) return MakeTime ( ts ) ; <nl> std : : string DateTimeString ( bool local ) { <nl> std : : strftime ( storage , sizeof ( storage ) , " % x % X " , : : localtime ( & now ) ) ; <nl> # else <nl> std : : tm timeinfo ; <nl> + std : : memset ( & timeinfo , 0 , sizeof ( std : : tm ) ) ; <nl> : : localtime_r ( & now , & timeinfo ) ; <nl> written = std : : strftime ( storage , sizeof ( storage ) , " % F % T " , & timeinfo ) ; <nl> # endif <nl> std : : string DateTimeString ( bool local ) { <nl> written = std : : strftime ( storage , sizeof ( storage ) , " % x % X " , : : gmtime ( & now ) ) ; <nl> # else <nl> std : : tm timeinfo ; <nl> + std : : memset ( & timeinfo , 0 , sizeof ( std : : tm ) ) ; <nl> : : gmtime_r ( & now , & timeinfo ) ; <nl> written = std : : strftime ( storage , sizeof ( storage ) , " % F % T " , & timeinfo ) ; <nl> # endif <nl> similarity index 100 % <nl> rename from src / third_party / benchmark - 1 . 4 . 1 / benchmark / src / timers . h <nl> rename to src / third_party / benchmark - 1 . 3 . 0 / benchmark / src / timers . h <nl> new file mode 100644 <nl> index 000000000000 . . f1a06fbe0ae2 <nl> mmm / dev / null <nl> ppp b / src / third_party / benchmark - 1 . 3 . 0 / patches / 0001 - Use - STCK - to - get - the - CPU - clock - on - s390x . patch <nl> <nl> + From f58107b74d08e604cac0fcec7bc3cf7a0e7a684f Mon Sep 17 00 : 00 : 00 2001 <nl> + From : Robert Guo < robert . guo @ 10gen . com > <nl> + Date : Fri , 19 Jan 2018 16 : 30 : 42 - 0500 <nl> + Subject : [ PATCH ] Use STCK to get the CPU clock on s390x <nl> + <nl> + mmm <nl> + src / cycleclock . h | 5 ppp + + <nl> + 1 file changed , 5 insertions ( + ) <nl> + <nl> pppmmm a / src / cycleclock . h <nl> ppp + b / src / cycleclock . h <nl> + inline BENCHMARK_ALWAYS_INLINE int64_t Now ( ) { <nl> + struct timeval tv ; <nl> + gettimeofday ( & tv , nullptr ) ; <nl> + return static_cast < int64_t > ( tv . tv_sec ) * 1000000 + tv . tv_usec ; <nl> + + # elif defined ( __s390__ ) <nl> + + / / MONGODB MODIFICATION : Return the CPU clock on s390x . <nl> + + uint64_t tsc ; <nl> + + asm ( " \ tstck \ t % 0 \ n " : " = Q " ( tsc ) : : " cc " ) ; <nl> + + return tsc ; <nl> + # else <nl> + / / The soft failover to a generic implementation is automatic only for ARM . <nl> + / / For other platforms the developer is expected to make an attempt to create <nl> + - - <nl> + 2 . 14 . 3 ( Apple Git - 98 ) <nl> + <nl> new file mode 100644 <nl> index 000000000000 . . 4bbd33934b3b <nl> mmm / dev / null <nl> ppp b / src / third_party / benchmark - 1 . 3 . 0 / patches / 0002 - Work - around - MSVC - __forceinline - bug . patch <nl> <nl> + From df74ea738d9a797a2f5596c72ff08a2cd895168f Mon Sep 17 00 : 00 : 00 2001 <nl> + From : Robert Guo < robert . guo @ 10gen . com > <nl> + Date : Mon , 22 Jan 2018 18 : 19 : 04 - 0500 <nl> + Subject : [ PATCH ] Work around MSVC __forceinline bug <nl> + <nl> + mmm <nl> + include / benchmark / benchmark . h | 4 ppp - <nl> + 1 file changed , 3 insertions ( + ) , 1 deletion ( - ) <nl> + <nl> pppmmm a / include / benchmark / benchmark . h <nl> ppp + b / include / benchmark / benchmark . h <nl> + BENCHMARK ( BM_test ) - > Unit ( benchmark : : kMillisecond ) ; <nl> + # define BENCHMARK_NOEXCEPT_OP ( x ) noexcept ( x ) <nl> + # elif defined ( _MSC_VER ) & & ! defined ( __clang__ ) <nl> + # define BENCHMARK_UNUSED <nl> + - # define BENCHMARK_ALWAYS_INLINE __forceinline <nl> + + / / MONGO HACK : SERVER - 32908 work around old MSVC bug , which was fixed as of MSVC 1913 . <nl> + + / / See discussion here for more detail : https : / / github . com / google / benchmark / pull / 493 <nl> + + # define BENCHMARK_ALWAYS_INLINE <nl> + # if _MSC_VER > = 1900 <nl> + # define BENCHMARK_NOEXCEPT noexcept <nl> + # define BENCHMARK_NOEXCEPT_OP ( x ) noexcept ( x ) <nl> + - - <nl> + 2 . 14 . 3 ( Apple Git - 98 ) <nl> + <nl> similarity index 77 % <nl> rename from src / third_party / benchmark - 1 . 4 . 1 / patches / 0001 - Remove - deprecated - benchmark - fixture - function - decl . patch <nl> rename to src / third_party / benchmark - 1 . 3 . 0 / patches / 0003 - Remove - deprecated - benchmark - fixture - function - decl . patch <nl> mmm a / src / third_party / benchmark - 1 . 4 . 1 / patches / 0001 - Remove - deprecated - benchmark - fixture - function - decl . patch <nl> ppp b / src / third_party / benchmark - 1 . 3 . 0 / patches / 0003 - Remove - deprecated - benchmark - fixture - function - decl . patch <nl> Subject : [ PATCH ] SERVER - 33560 Remove deprecated Fixture function declarations <nl> from Google Benchmark <nl> <nl> mmm <nl> - . . . / benchmark - 1 . 4 . 1 / benchmark / include / benchmark / benchmark . h | 10 ppp + mmmmmm <nl> + . . . / benchmark - 1 . 3 . 0 / benchmark / include / benchmark / benchmark . h | 10 ppp + mmmmmm <nl> 1 file changed , 4 insertions ( + ) , 6 deletions ( - ) <nl> <nl> - + mmm - a / src / third_party / benchmark - 1 . 4 . 1 / benchmark / include / benchmark / benchmark . h <nl> - ppp b / src / third_party / benchmark - 1 . 4 . 1 / benchmark / include / benchmark / benchmark . h <nl> + mmm a / src / third_party / benchmark - 1 . 3 . 0 / benchmark / include / benchmark / benchmark . h <nl> ppp + b / src / third_party / benchmark - 1 . 3 . 0 / benchmark / include / benchmark / benchmark . h <nl> class Fixture : public internal : : Benchmark { <nl> this - > TearDown ( st ) ; <nl> } <nl> deleted file mode 100644 <nl> index 0705e219f2fa . . 000000000000 <nl> mmm a / src / third_party / benchmark - 1 . 4 . 1 / benchmark / src / benchmark_register . h <nl> ppp / dev / null <nl> <nl> - # ifndef BENCHMARK_REGISTER_H <nl> - # define BENCHMARK_REGISTER_H <nl> - <nl> - # include < vector > <nl> - <nl> - # include " check . h " <nl> - <nl> - template < typename T > <nl> - void AddRange ( std : : vector < T > * dst , T lo , T hi , int mult ) { <nl> - CHECK_GE ( lo , 0 ) ; <nl> - CHECK_GE ( hi , lo ) ; <nl> - CHECK_GE ( mult , 2 ) ; <nl> - <nl> - / / Add " lo " <nl> - dst - > push_back ( lo ) ; <nl> - <nl> - static const T kmax = std : : numeric_limits < T > : : max ( ) ; <nl> - <nl> - / / Now space out the benchmarks in multiples of " mult " <nl> - for ( T i = 1 ; i < kmax / mult ; i * = mult ) { <nl> - if ( i > = hi ) break ; <nl> - if ( i > lo ) { <nl> - dst - > push_back ( i ) ; <nl> - } <nl> - } <nl> - <nl> - / / Add " hi " ( if different from " lo " ) <nl> - if ( hi ! = lo ) { <nl> - dst - > push_back ( hi ) ; <nl> - } <nl> - } <nl> - <nl> - # endif / / BENCHMARK_REGISTER_H <nl> deleted file mode 100644 <nl> index edb8a5c0a35e . . 000000000000 <nl> mmm a / src / third_party / benchmark - 1 . 4 . 1 / benchmark / src / internal_macros . h <nl> ppp / dev / null <nl> <nl> - # ifndef BENCHMARK_INTERNAL_MACROS_H_ <nl> - # define BENCHMARK_INTERNAL_MACROS_H_ <nl> - <nl> - # include " benchmark / benchmark . h " <nl> - <nl> - # ifndef __has_feature <nl> - # define __has_feature ( x ) 0 <nl> - # endif <nl> - # ifndef __has_builtin <nl> - # define __has_builtin ( x ) 0 <nl> - # endif <nl> - <nl> - # if defined ( __clang__ ) <nl> - # if ! defined ( COMPILER_CLANG ) <nl> - # define COMPILER_CLANG <nl> - # endif <nl> - # elif defined ( _MSC_VER ) <nl> - # if ! defined ( COMPILER_MSVC ) <nl> - # define COMPILER_MSVC <nl> - # endif <nl> - # elif defined ( __GNUC__ ) <nl> - # if ! defined ( COMPILER_GCC ) <nl> - # define COMPILER_GCC <nl> - # endif <nl> - # endif <nl> - <nl> - # if __has_feature ( cxx_attributes ) <nl> - # define BENCHMARK_NORETURN [ [ noreturn ] ] <nl> - # elif defined ( __GNUC__ ) <nl> - # define BENCHMARK_NORETURN __attribute__ ( ( noreturn ) ) <nl> - # elif defined ( COMPILER_MSVC ) <nl> - # define BENCHMARK_NORETURN __declspec ( noreturn ) <nl> - # else <nl> - # define BENCHMARK_NORETURN <nl> - # endif <nl> - <nl> - # if defined ( __CYGWIN__ ) <nl> - # define BENCHMARK_OS_CYGWIN 1 <nl> - # elif defined ( _WIN32 ) <nl> - # define BENCHMARK_OS_WINDOWS 1 <nl> - # elif defined ( __APPLE__ ) <nl> - # define BENCHMARK_OS_APPLE 1 <nl> - # include " TargetConditionals . h " <nl> - # if defined ( TARGET_OS_MAC ) <nl> - # define BENCHMARK_OS_MACOSX 1 <nl> - # if defined ( TARGET_OS_IPHONE ) <nl> - # define BENCHMARK_OS_IOS 1 <nl> - # endif <nl> - # endif <nl> - # elif defined ( __FreeBSD__ ) <nl> - # define BENCHMARK_OS_FREEBSD 1 <nl> - # elif defined ( __NetBSD__ ) <nl> - # define BENCHMARK_OS_NETBSD 1 <nl> - # elif defined ( __OpenBSD__ ) <nl> - # define BENCHMARK_OS_OPENBSD 1 <nl> - # elif defined ( __linux__ ) <nl> - # define BENCHMARK_OS_LINUX 1 <nl> - # elif defined ( __native_client__ ) <nl> - # define BENCHMARK_OS_NACL 1 <nl> - # elif defined ( __EMSCRIPTEN__ ) <nl> - # define BENCHMARK_OS_EMSCRIPTEN 1 <nl> - # elif defined ( __rtems__ ) <nl> - # define BENCHMARK_OS_RTEMS 1 <nl> - # elif defined ( __Fuchsia__ ) <nl> - # define BENCHMARK_OS_FUCHSIA 1 <nl> - # elif defined ( __SVR4 ) & & defined ( __sun ) <nl> - # define BENCHMARK_OS_SOLARIS 1 <nl> - # endif <nl> - <nl> - # if ! __has_feature ( cxx_exceptions ) & & ! defined ( __cpp_exceptions ) \ <nl> - & & ! defined ( __EXCEPTIONS ) <nl> - # define BENCHMARK_HAS_NO_EXCEPTIONS <nl> - # endif <nl> - <nl> - # if defined ( COMPILER_CLANG ) | | defined ( COMPILER_GCC ) <nl> - # define BENCHMARK_MAYBE_UNUSED __attribute__ ( ( unused ) ) <nl> - # else <nl> - # define BENCHMARK_MAYBE_UNUSED <nl> - # endif <nl> - <nl> - # if defined ( COMPILER_GCC ) | | __has_builtin ( __builtin_unreachable ) <nl> - # define BENCHMARK_UNREACHABLE ( ) __builtin_unreachable ( ) <nl> - # elif defined ( COMPILER_MSVC ) <nl> - # define BENCHMARK_UNREACHABLE ( ) __assume ( false ) <nl> - # else <nl> - # define BENCHMARK_UNREACHABLE ( ) ( ( void ) 0 ) <nl> - # endif <nl> - <nl> - # endif / / BENCHMARK_INTERNAL_MACROS_H_ <nl> deleted file mode 100644 <nl> index d19d0ef4c1e0 . . 000000000000 <nl> mmm a / src / third_party / benchmark - 1 . 4 . 1 / benchmark / src / sysinfo . cc <nl> ppp / dev / null <nl> <nl> - / / Copyright 2015 Google Inc . All rights reserved . <nl> - / / <nl> - / / Licensed under the Apache License , Version 2 . 0 ( the " License " ) ; <nl> - / / you may not use this file except in compliance with the License . <nl> - / / You may obtain a copy of the License at <nl> - / / <nl> - / / http : / / www . apache . org / licenses / LICENSE - 2 . 0 <nl> - / / <nl> - / / Unless required by applicable law or agreed to in writing , software <nl> - / / distributed under the License is distributed on an " AS IS " BASIS , <nl> - / / WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND , either express or implied . <nl> - / / See the License for the specific language governing permissions and <nl> - / / limitations under the License . <nl> - <nl> - # include " internal_macros . h " <nl> - <nl> - # ifdef BENCHMARK_OS_WINDOWS <nl> - # include < Shlwapi . h > <nl> - # undef StrCat / / Don ' t let StrCat in string_util . h be renamed to lstrcatA <nl> - # include < VersionHelpers . h > <nl> - # include < Windows . h > <nl> - # else <nl> - # include < fcntl . h > <nl> - # ifndef BENCHMARK_OS_FUCHSIA <nl> - # include < sys / resource . h > <nl> - # endif <nl> - # include < sys / time . h > <nl> - # include < sys / types . h > / / this header must be included before ' sys / sysctl . h ' to avoid compilation error on FreeBSD <nl> - # include < unistd . h > <nl> - # if defined BENCHMARK_OS_FREEBSD | | defined BENCHMARK_OS_MACOSX | | \ <nl> - defined BENCHMARK_OS_NETBSD | | defined BENCHMARK_OS_OPENBSD <nl> - # define BENCHMARK_HAS_SYSCTL <nl> - # include < sys / sysctl . h > <nl> - # endif <nl> - # endif <nl> - # if defined ( BENCHMARK_OS_SOLARIS ) <nl> - # include < kstat . h > <nl> - # endif <nl> - <nl> - # include < algorithm > <nl> - # include < array > <nl> - # include < bitset > <nl> - # include < cerrno > <nl> - # include < climits > <nl> - # include < cstdint > <nl> - # include < cstdio > <nl> - # include < cstdlib > <nl> - # include < cstring > <nl> - # include < fstream > <nl> - # include < iostream > <nl> - # include < iterator > <nl> - # include < limits > <nl> - # include < memory > <nl> - # include < sstream > <nl> - <nl> - # include " check . h " <nl> - # include " cycleclock . h " <nl> - # include " internal_macros . h " <nl> - # include " log . h " <nl> - # include " sleep . h " <nl> - # include " string_util . h " <nl> - <nl> - namespace benchmark { <nl> - namespace { <nl> - <nl> - void PrintImp ( std : : ostream & out ) { out < < std : : endl ; } <nl> - <nl> - template < class First , class . . . Rest > <nl> - void PrintImp ( std : : ostream & out , First & & f , Rest & & . . . rest ) { <nl> - out < < std : : forward < First > ( f ) ; <nl> - PrintImp ( out , std : : forward < Rest > ( rest ) . . . ) ; <nl> - } <nl> - <nl> - template < class . . . Args > <nl> - BENCHMARK_NORETURN void PrintErrorAndDie ( Args & & . . . args ) { <nl> - PrintImp ( std : : cerr , std : : forward < Args > ( args ) . . . ) ; <nl> - std : : exit ( EXIT_FAILURE ) ; <nl> - } <nl> - <nl> - # ifdef BENCHMARK_HAS_SYSCTL <nl> - <nl> - / / / ValueUnion - A type used to correctly alias the byte - for - byte output of <nl> - / / / ` sysctl ` with the result type it ' s to be interpreted as . <nl> - struct ValueUnion { <nl> - union DataT { <nl> - uint32_t uint32_value ; <nl> - uint64_t uint64_value ; <nl> - / / For correct aliasing of union members from bytes . <nl> - char bytes [ 8 ] ; <nl> - } ; <nl> - using DataPtr = std : : unique_ptr < DataT , decltype ( & std : : free ) > ; <nl> - <nl> - / / The size of the data union member + its trailing array size . <nl> - size_t Size ; <nl> - DataPtr Buff ; <nl> - <nl> - public : <nl> - ValueUnion ( ) : Size ( 0 ) , Buff ( nullptr , & std : : free ) { } <nl> - <nl> - explicit ValueUnion ( size_t BuffSize ) <nl> - : Size ( sizeof ( DataT ) + BuffSize ) , <nl> - Buff ( : : new ( std : : malloc ( Size ) ) DataT ( ) , & std : : free ) { } <nl> - <nl> - ValueUnion ( ValueUnion & & other ) = default ; <nl> - <nl> - explicit operator bool ( ) const { return bool ( Buff ) ; } <nl> - <nl> - char * data ( ) const { return Buff - > bytes ; } <nl> - <nl> - std : : string GetAsString ( ) const { return std : : string ( data ( ) ) ; } <nl> - <nl> - int64_t GetAsInteger ( ) const { <nl> - if ( Size = = sizeof ( Buff - > uint32_value ) ) <nl> - return static_cast < int32_t > ( Buff - > uint32_value ) ; <nl> - else if ( Size = = sizeof ( Buff - > uint64_value ) ) <nl> - return static_cast < int64_t > ( Buff - > uint64_value ) ; <nl> - BENCHMARK_UNREACHABLE ( ) ; <nl> - } <nl> - <nl> - uint64_t GetAsUnsigned ( ) const { <nl> - if ( Size = = sizeof ( Buff - > uint32_value ) ) <nl> - return Buff - > uint32_value ; <nl> - else if ( Size = = sizeof ( Buff - > uint64_value ) ) <nl> - return Buff - > uint64_value ; <nl> - BENCHMARK_UNREACHABLE ( ) ; <nl> - } <nl> - <nl> - template < class T , int N > <nl> - std : : array < T , N > GetAsArray ( ) { <nl> - const int ArrSize = sizeof ( T ) * N ; <nl> - CHECK_LE ( ArrSize , Size ) ; <nl> - std : : array < T , N > Arr ; <nl> - std : : memcpy ( Arr . data ( ) , data ( ) , ArrSize ) ; <nl> - return Arr ; <nl> - } <nl> - } ; <nl> - <nl> - ValueUnion GetSysctlImp ( std : : string const & Name ) { <nl> - # if defined BENCHMARK_OS_OPENBSD <nl> - int mib [ 2 ] ; <nl> - <nl> - mib [ 0 ] = CTL_HW ; <nl> - if ( ( Name = = " hw . ncpu " ) | | ( Name = = " hw . cpuspeed " ) ) { <nl> - ValueUnion buff ( sizeof ( int ) ) ; <nl> - <nl> - if ( Name = = " hw . ncpu " ) { <nl> - mib [ 1 ] = HW_NCPU ; <nl> - } else { <nl> - mib [ 1 ] = HW_CPUSPEED ; <nl> - } <nl> - <nl> - if ( sysctl ( mib , 2 , buff . data ( ) , & buff . Size , nullptr , 0 ) = = - 1 ) { <nl> - return ValueUnion ( ) ; <nl> - } <nl> - return buff ; <nl> - } <nl> - return ValueUnion ( ) ; <nl> - # else <nl> - size_t CurBuffSize = 0 ; <nl> - if ( sysctlbyname ( Name . c_str ( ) , nullptr , & CurBuffSize , nullptr , 0 ) = = - 1 ) <nl> - return ValueUnion ( ) ; <nl> - <nl> - ValueUnion buff ( CurBuffSize ) ; <nl> - if ( sysctlbyname ( Name . c_str ( ) , buff . data ( ) , & buff . Size , nullptr , 0 ) = = 0 ) <nl> - return buff ; <nl> - return ValueUnion ( ) ; <nl> - # endif <nl> - } <nl> - <nl> - BENCHMARK_MAYBE_UNUSED <nl> - bool GetSysctl ( std : : string const & Name , std : : string * Out ) { <nl> - Out - > clear ( ) ; <nl> - auto Buff = GetSysctlImp ( Name ) ; <nl> - if ( ! Buff ) return false ; <nl> - Out - > assign ( Buff . data ( ) ) ; <nl> - return true ; <nl> - } <nl> - <nl> - template < class Tp , <nl> - class = typename std : : enable_if < std : : is_integral < Tp > : : value > : : type > <nl> - bool GetSysctl ( std : : string const & Name , Tp * Out ) { <nl> - * Out = 0 ; <nl> - auto Buff = GetSysctlImp ( Name ) ; <nl> - if ( ! Buff ) return false ; <nl> - * Out = static_cast < Tp > ( Buff . GetAsUnsigned ( ) ) ; <nl> - return true ; <nl> - } <nl> - <nl> - template < class Tp , size_t N > <nl> - bool GetSysctl ( std : : string const & Name , std : : array < Tp , N > * Out ) { <nl> - auto Buff = GetSysctlImp ( Name ) ; <nl> - if ( ! Buff ) return false ; <nl> - * Out = Buff . GetAsArray < Tp , N > ( ) ; <nl> - return true ; <nl> - } <nl> - # endif <nl> - <nl> - template < class ArgT > <nl> - bool ReadFromFile ( std : : string const & fname , ArgT * arg ) { <nl> - * arg = ArgT ( ) ; <nl> - std : : ifstream f ( fname . c_str ( ) ) ; <nl> - if ( ! f . is_open ( ) ) return false ; <nl> - f > > * arg ; <nl> - return f . good ( ) ; <nl> - } <nl> - <nl> - bool CpuScalingEnabled ( int num_cpus ) { <nl> - / / We don ' t have a valid CPU count , so don ' t even bother . <nl> - if ( num_cpus < = 0 ) return false ; <nl> - # ifndef BENCHMARK_OS_WINDOWS <nl> - / / On Linux , the CPUfreq subsystem exposes CPU information as files on the <nl> - / / local file system . If reading the exported files fails , then we may not be <nl> - / / running on Linux , so we silently ignore all the read errors . <nl> - std : : string res ; <nl> - for ( int cpu = 0 ; cpu < num_cpus ; + + cpu ) { <nl> - std : : string governor_file = <nl> - StrCat ( " / sys / devices / system / cpu / cpu " , cpu , " / cpufreq / scaling_governor " ) ; <nl> - if ( ReadFromFile ( governor_file , & res ) & & res ! = " performance " ) return true ; <nl> - } <nl> - # endif <nl> - return false ; <nl> - } <nl> - <nl> - int CountSetBitsInCPUMap ( std : : string Val ) { <nl> - auto CountBits = [ ] ( std : : string Part ) { <nl> - using CPUMask = std : : bitset < sizeof ( std : : uintptr_t ) * CHAR_BIT > ; <nl> - Part = " 0x " + Part ; <nl> - CPUMask Mask ( std : : stoul ( Part , nullptr , 16 ) ) ; <nl> - return static_cast < int > ( Mask . count ( ) ) ; <nl> - } ; <nl> - size_t Pos ; <nl> - int total = 0 ; <nl> - while ( ( Pos = Val . find ( ' , ' ) ) ! = std : : string : : npos ) { <nl> - total + = CountBits ( Val . substr ( 0 , Pos ) ) ; <nl> - Val = Val . substr ( Pos + 1 ) ; <nl> - } <nl> - if ( ! Val . empty ( ) ) { <nl> - total + = CountBits ( Val ) ; <nl> - } <nl> - return total ; <nl> - } <nl> - <nl> - BENCHMARK_MAYBE_UNUSED <nl> - std : : vector < CPUInfo : : CacheInfo > GetCacheSizesFromKVFS ( ) { <nl> - std : : vector < CPUInfo : : CacheInfo > res ; <nl> - std : : string dir = " / sys / devices / system / cpu / cpu0 / cache / " ; <nl> - int Idx = 0 ; <nl> - while ( true ) { <nl> - CPUInfo : : CacheInfo info ; <nl> - std : : string FPath = StrCat ( dir , " index " , Idx + + , " / " ) ; <nl> - std : : ifstream f ( StrCat ( FPath , " size " ) . c_str ( ) ) ; <nl> - if ( ! f . is_open ( ) ) break ; <nl> - std : : string suffix ; <nl> - f > > info . size ; <nl> - if ( f . fail ( ) ) <nl> - PrintErrorAndDie ( " Failed while reading file ' " , FPath , " size ' " ) ; <nl> - if ( f . good ( ) ) { <nl> - f > > suffix ; <nl> - if ( f . bad ( ) ) <nl> - PrintErrorAndDie ( <nl> - " Invalid cache size format : failed to read size suffix " ) ; <nl> - else if ( f & & suffix ! = " K " ) <nl> - PrintErrorAndDie ( " Invalid cache size format : Expected bytes " , suffix ) ; <nl> - else if ( suffix = = " K " ) <nl> - info . size * = 1000 ; <nl> - } <nl> - if ( ! ReadFromFile ( StrCat ( FPath , " type " ) , & info . type ) ) <nl> - PrintErrorAndDie ( " Failed to read from file " , FPath , " type " ) ; <nl> - if ( ! ReadFromFile ( StrCat ( FPath , " level " ) , & info . level ) ) <nl> - PrintErrorAndDie ( " Failed to read from file " , FPath , " level " ) ; <nl> - std : : string map_str ; <nl> - if ( ! ReadFromFile ( StrCat ( FPath , " shared_cpu_map " ) , & map_str ) ) <nl> - PrintErrorAndDie ( " Failed to read from file " , FPath , " shared_cpu_map " ) ; <nl> - info . num_sharing = CountSetBitsInCPUMap ( map_str ) ; <nl> - res . push_back ( info ) ; <nl> - } <nl> - <nl> - return res ; <nl> - } <nl> - <nl> - # ifdef BENCHMARK_OS_MACOSX <nl> - std : : vector < CPUInfo : : CacheInfo > GetCacheSizesMacOSX ( ) { <nl> - std : : vector < CPUInfo : : CacheInfo > res ; <nl> - std : : array < uint64_t , 4 > CacheCounts { { 0 , 0 , 0 , 0 } } ; <nl> - GetSysctl ( " hw . cacheconfig " , & CacheCounts ) ; <nl> - <nl> - struct { <nl> - std : : string name ; <nl> - std : : string type ; <nl> - int level ; <nl> - size_t num_sharing ; <nl> - } Cases [ ] = { { " hw . l1dcachesize " , " Data " , 1 , CacheCounts [ 1 ] } , <nl> - { " hw . l1icachesize " , " Instruction " , 1 , CacheCounts [ 1 ] } , <nl> - { " hw . l2cachesize " , " Unified " , 2 , CacheCounts [ 2 ] } , <nl> - { " hw . l3cachesize " , " Unified " , 3 , CacheCounts [ 3 ] } } ; <nl> - for ( auto & C : Cases ) { <nl> - int val ; <nl> - if ( ! GetSysctl ( C . name , & val ) ) continue ; <nl> - CPUInfo : : CacheInfo info ; <nl> - info . type = C . type ; <nl> - info . level = C . level ; <nl> - info . size = val ; <nl> - info . num_sharing = static_cast < int > ( C . num_sharing ) ; <nl> - res . push_back ( std : : move ( info ) ) ; <nl> - } <nl> - return res ; <nl> - } <nl> - # elif defined ( BENCHMARK_OS_WINDOWS ) <nl> - std : : vector < CPUInfo : : CacheInfo > GetCacheSizesWindows ( ) { <nl> - std : : vector < CPUInfo : : CacheInfo > res ; <nl> - DWORD buffer_size = 0 ; <nl> - using PInfo = SYSTEM_LOGICAL_PROCESSOR_INFORMATION ; <nl> - using CInfo = CACHE_DESCRIPTOR ; <nl> - <nl> - using UPtr = std : : unique_ptr < PInfo , decltype ( & std : : free ) > ; <nl> - GetLogicalProcessorInformation ( nullptr , & buffer_size ) ; <nl> - UPtr buff ( ( PInfo * ) malloc ( buffer_size ) , & std : : free ) ; <nl> - if ( ! GetLogicalProcessorInformation ( buff . get ( ) , & buffer_size ) ) <nl> - PrintErrorAndDie ( " Failed during call to GetLogicalProcessorInformation : " , <nl> - GetLastError ( ) ) ; <nl> - <nl> - PInfo * it = buff . get ( ) ; <nl> - PInfo * end = buff . get ( ) + ( buffer_size / sizeof ( PInfo ) ) ; <nl> - <nl> - for ( ; it ! = end ; + + it ) { <nl> - if ( it - > Relationship ! = RelationCache ) continue ; <nl> - using BitSet = std : : bitset < sizeof ( ULONG_PTR ) * CHAR_BIT > ; <nl> - BitSet B ( it - > ProcessorMask ) ; <nl> - / / To prevent duplicates , only consider caches where CPU 0 is specified <nl> - if ( ! B . test ( 0 ) ) continue ; <nl> - CInfo * Cache = & it - > Cache ; <nl> - CPUInfo : : CacheInfo C ; <nl> - C . num_sharing = static_cast < int > ( B . count ( ) ) ; <nl> - C . level = Cache - > Level ; <nl> - C . size = Cache - > Size ; <nl> - switch ( Cache - > Type ) { <nl> - case CacheUnified : <nl> - C . type = " Unified " ; <nl> - break ; <nl> - case CacheInstruction : <nl> - C . type = " Instruction " ; <nl> - break ; <nl> - case CacheData : <nl> - C . type = " Data " ; <nl> - break ; <nl> - case CacheTrace : <nl> - C . type = " Trace " ; <nl> - break ; <nl> - default : <nl> - C . type = " Unknown " ; <nl> - break ; <nl> - } <nl> - res . push_back ( C ) ; <nl> - } <nl> - return res ; <nl> - } <nl> - # endif <nl> - <nl> - std : : vector < CPUInfo : : CacheInfo > GetCacheSizes ( ) { <nl> - # ifdef BENCHMARK_OS_MACOSX <nl> - return GetCacheSizesMacOSX ( ) ; <nl> - # elif defined ( BENCHMARK_OS_WINDOWS ) <nl> - return GetCacheSizesWindows ( ) ; <nl> - # else <nl> - return GetCacheSizesFromKVFS ( ) ; <nl> - # endif <nl> - } <nl> - <nl> - int GetNumCPUs ( ) { <nl> - # ifdef BENCHMARK_HAS_SYSCTL <nl> - int NumCPU = - 1 ; <nl> - if ( GetSysctl ( " hw . ncpu " , & NumCPU ) ) return NumCPU ; <nl> - fprintf ( stderr , " Err : % s \ n " , strerror ( errno ) ) ; <nl> - std : : exit ( EXIT_FAILURE ) ; <nl> - # elif defined ( BENCHMARK_OS_WINDOWS ) <nl> - SYSTEM_INFO sysinfo ; <nl> - / / Use memset as opposed to = { } to avoid GCC missing initializer false <nl> - / / positives . <nl> - std : : memset ( & sysinfo , 0 , sizeof ( SYSTEM_INFO ) ) ; <nl> - GetSystemInfo ( & sysinfo ) ; <nl> - return sysinfo . dwNumberOfProcessors ; / / number of logical <nl> - / / processors in the current <nl> - / / group <nl> - # elif defined ( BENCHMARK_OS_SOLARIS ) <nl> - / / Returns - 1 in case of a failure . <nl> - int NumCPU = sysconf ( _SC_NPROCESSORS_ONLN ) ; <nl> - if ( NumCPU < 0 ) { <nl> - fprintf ( stderr , <nl> - " sysconf ( _SC_NPROCESSORS_ONLN ) failed with error : % s \ n " , <nl> - strerror ( errno ) ) ; <nl> - } <nl> - return NumCPU ; <nl> - # else <nl> - int NumCPUs = 0 ; <nl> - int MaxID = - 1 ; <nl> - std : : ifstream f ( " / proc / cpuinfo " ) ; <nl> - if ( ! f . is_open ( ) ) { <nl> - std : : cerr < < " failed to open / proc / cpuinfo \ n " ; <nl> - return - 1 ; <nl> - } <nl> - const std : : string Key = " processor " ; <nl> - std : : string ln ; <nl> - while ( std : : getline ( f , ln ) ) { <nl> - if ( ln . empty ( ) ) continue ; <nl> - size_t SplitIdx = ln . find ( ' : ' ) ; <nl> - std : : string value ; <nl> - if ( SplitIdx ! = std : : string : : npos ) value = ln . substr ( SplitIdx + 1 ) ; <nl> - if ( ln . size ( ) > = Key . size ( ) & & ln . compare ( 0 , Key . size ( ) , Key ) = = 0 ) { <nl> - NumCPUs + + ; <nl> - if ( ! value . empty ( ) ) { <nl> - int CurID = std : : stoi ( value ) ; <nl> - MaxID = std : : max ( CurID , MaxID ) ; <nl> - } <nl> - } <nl> - } <nl> - if ( f . bad ( ) ) { <nl> - std : : cerr < < " Failure reading / proc / cpuinfo \ n " ; <nl> - return - 1 ; <nl> - } <nl> - if ( ! f . eof ( ) ) { <nl> - std : : cerr < < " Failed to read to end of / proc / cpuinfo \ n " ; <nl> - return - 1 ; <nl> - } <nl> - f . close ( ) ; <nl> - <nl> - if ( ( MaxID + 1 ) ! = NumCPUs ) { <nl> - fprintf ( stderr , <nl> - " CPU ID assignments in / proc / cpuinfo seem messed up . " <nl> - " This is usually caused by a bad BIOS . \ n " ) ; <nl> - } <nl> - return NumCPUs ; <nl> - # endif <nl> - BENCHMARK_UNREACHABLE ( ) ; <nl> - } <nl> - <nl> - double GetCPUCyclesPerSecond ( ) { <nl> - # if defined BENCHMARK_OS_LINUX | | defined BENCHMARK_OS_CYGWIN <nl> - long freq ; <nl> - <nl> - / / If the kernel is exporting the tsc frequency use that . There are issues <nl> - / / where cpuinfo_max_freq cannot be relied on because the BIOS may be <nl> - / / exporintg an invalid p - state ( on x86 ) or p - states may be used to put the <nl> - / / processor in a new mode ( turbo mode ) . Essentially , those frequencies <nl> - / / cannot always be relied upon . The same reasons apply to / proc / cpuinfo as <nl> - / / well . <nl> - if ( ReadFromFile ( " / sys / devices / system / cpu / cpu0 / tsc_freq_khz " , & freq ) <nl> - / / If CPU scaling is in effect , we want to use the * maximum * frequency , <nl> - / / not whatever CPU speed some random processor happens to be using now . <nl> - | | ReadFromFile ( " / sys / devices / system / cpu / cpu0 / cpufreq / cpuinfo_max_freq " , <nl> - & freq ) ) { <nl> - / / The value is in kHz ( as the file name suggests ) . For example , on a <nl> - / / 2GHz warpstation , the file contains the value " 2000000 " . <nl> - return freq * 1000 . 0 ; <nl> - } <nl> - <nl> - const double error_value = - 1 ; <nl> - double bogo_clock = error_value ; <nl> - <nl> - std : : ifstream f ( " / proc / cpuinfo " ) ; <nl> - if ( ! f . is_open ( ) ) { <nl> - std : : cerr < < " failed to open / proc / cpuinfo \ n " ; <nl> - return error_value ; <nl> - } <nl> - <nl> - auto startsWithKey = [ ] ( std : : string const & Value , std : : string const & Key ) { <nl> - if ( Key . size ( ) > Value . size ( ) ) return false ; <nl> - auto Cmp = [ & ] ( char X , char Y ) { <nl> - return std : : tolower ( X ) = = std : : tolower ( Y ) ; <nl> - } ; <nl> - return std : : equal ( Key . begin ( ) , Key . end ( ) , Value . begin ( ) , Cmp ) ; <nl> - } ; <nl> - <nl> - std : : string ln ; <nl> - while ( std : : getline ( f , ln ) ) { <nl> - if ( ln . empty ( ) ) continue ; <nl> - size_t SplitIdx = ln . find ( ' : ' ) ; <nl> - std : : string value ; <nl> - if ( SplitIdx ! = std : : string : : npos ) value = ln . substr ( SplitIdx + 1 ) ; <nl> - / / When parsing the " cpu MHz " and " bogomips " ( fallback ) entries , we only <nl> - / / accept positive values . Some environments ( virtual machines ) report zero , <nl> - / / which would cause infinite looping in WallTime_Init . <nl> - if ( startsWithKey ( ln , " cpu MHz " ) ) { <nl> - if ( ! value . empty ( ) ) { <nl> - double cycles_per_second = std : : stod ( value ) * 1000000 . 0 ; <nl> - if ( cycles_per_second > 0 ) return cycles_per_second ; <nl> - } <nl> - } else if ( startsWithKey ( ln , " bogomips " ) ) { <nl> - if ( ! value . empty ( ) ) { <nl> - bogo_clock = std : : stod ( value ) * 1000000 . 0 ; <nl> - if ( bogo_clock < 0 . 0 ) bogo_clock = error_value ; <nl> - } <nl> - } <nl> - } <nl> - if ( f . bad ( ) ) { <nl> - std : : cerr < < " Failure reading / proc / cpuinfo \ n " ; <nl> - return error_value ; <nl> - } <nl> - if ( ! f . eof ( ) ) { <nl> - std : : cerr < < " Failed to read to end of / proc / cpuinfo \ n " ; <nl> - return error_value ; <nl> - } <nl> - f . close ( ) ; <nl> - / / If we found the bogomips clock , but nothing better , we ' ll use it ( but <nl> - / / we ' re not happy about it ) ; otherwise , fallback to the rough estimation <nl> - / / below . <nl> - if ( bogo_clock > = 0 . 0 ) return bogo_clock ; <nl> - <nl> - # elif defined BENCHMARK_HAS_SYSCTL <nl> - constexpr auto * FreqStr = <nl> - # if defined ( BENCHMARK_OS_FREEBSD ) | | defined ( BENCHMARK_OS_NETBSD ) <nl> - " machdep . tsc_freq " ; <nl> - # elif defined BENCHMARK_OS_OPENBSD <nl> - " hw . cpuspeed " ; <nl> - # else <nl> - " hw . cpufrequency " ; <nl> - # endif <nl> - unsigned long long hz = 0 ; <nl> - # if defined BENCHMARK_OS_OPENBSD <nl> - if ( GetSysctl ( FreqStr , & hz ) ) return hz * 1000000 ; <nl> - # else <nl> - if ( GetSysctl ( FreqStr , & hz ) ) return hz ; <nl> - # endif <nl> - fprintf ( stderr , " Unable to determine clock rate from sysctl : % s : % s \ n " , <nl> - FreqStr , strerror ( errno ) ) ; <nl> - <nl> - # elif defined BENCHMARK_OS_WINDOWS <nl> - / / In NT , read MHz from the registry . If we fail to do so or we ' re in win9x <nl> - / / then make a crude estimate . <nl> - DWORD data , data_size = sizeof ( data ) ; <nl> - if ( IsWindowsXPOrGreater ( ) & & <nl> - SUCCEEDED ( <nl> - SHGetValueA ( HKEY_LOCAL_MACHINE , <nl> - " HARDWARE \ \ DESCRIPTION \ \ System \ \ CentralProcessor \ \ 0 " , <nl> - " ~ MHz " , nullptr , & data , & data_size ) ) ) <nl> - return static_cast < double > ( ( int64_t ) data * <nl> - ( int64_t ) ( 1000 * 1000 ) ) ; / / was mhz <nl> - # elif defined ( BENCHMARK_OS_SOLARIS ) <nl> - kstat_ctl_t * kc = kstat_open ( ) ; <nl> - if ( ! kc ) { <nl> - std : : cerr < < " failed to open / dev / kstat \ n " ; <nl> - return - 1 ; <nl> - } <nl> - kstat_t * ksp = kstat_lookup ( kc , ( char * ) " cpu_info " , - 1 , ( char * ) " cpu_info0 " ) ; <nl> - if ( ! ksp ) { <nl> - std : : cerr < < " failed to lookup in / dev / kstat \ n " ; <nl> - return - 1 ; <nl> - } <nl> - if ( kstat_read ( kc , ksp , NULL ) < 0 ) { <nl> - std : : cerr < < " failed to read from / dev / kstat \ n " ; <nl> - return - 1 ; <nl> - } <nl> - kstat_named_t * knp = <nl> - ( kstat_named_t * ) kstat_data_lookup ( ksp , ( char * ) " current_clock_Hz " ) ; <nl> - if ( ! knp ) { <nl> - std : : cerr < < " failed to lookup data in / dev / kstat \ n " ; <nl> - return - 1 ; <nl> - } <nl> - if ( knp - > data_type ! = KSTAT_DATA_UINT64 ) { <nl> - std : : cerr < < " current_clock_Hz is of unexpected data type : " <nl> - < < knp - > data_type < < " \ n " ; <nl> - return - 1 ; <nl> - } <nl> - double clock_hz = knp - > value . ui64 ; <nl> - kstat_close ( kc ) ; <nl> - return clock_hz ; <nl> - # endif <nl> - / / If we ' ve fallen through , attempt to roughly estimate the CPU clock rate . <nl> - const int estimate_time_ms = 1000 ; <nl> - const auto start_ticks = cycleclock : : Now ( ) ; <nl> - SleepForMilliseconds ( estimate_time_ms ) ; <nl> - return static_cast < double > ( cycleclock : : Now ( ) - start_ticks ) ; <nl> - } <nl> - <nl> - } / / end namespace <nl> - <nl> - const CPUInfo & CPUInfo : : Get ( ) { <nl> - static const CPUInfo * info = new CPUInfo ( ) ; <nl> - return * info ; <nl> - } <nl> - <nl> - CPUInfo : : CPUInfo ( ) <nl> - : num_cpus ( GetNumCPUs ( ) ) , <nl> - cycles_per_second ( GetCPUCyclesPerSecond ( ) ) , <nl> - caches ( GetCacheSizes ( ) ) , <nl> - scaling_enabled ( CpuScalingEnabled ( num_cpus ) ) { } <nl> - <nl> - } / / end namespace benchmark <nl> deleted file mode 100644 <nl> index 82b4d72b62fb . . 000000000000 <nl> mmm a / src / third_party / benchmark - 1 . 4 . 1 / benchmark / src / thread_manager . h <nl> ppp / dev / null <nl> <nl> - # ifndef BENCHMARK_THREAD_MANAGER_H <nl> - # define BENCHMARK_THREAD_MANAGER_H <nl> - <nl> - # include < atomic > <nl> - <nl> - # include " benchmark / benchmark . h " <nl> - # include " mutex . h " <nl> - <nl> - namespace benchmark { <nl> - namespace internal { <nl> - <nl> - class ThreadManager { <nl> - public : <nl> - ThreadManager ( int num_threads ) <nl> - : alive_threads_ ( num_threads ) , start_stop_barrier_ ( num_threads ) { } <nl> - <nl> - Mutex & GetBenchmarkMutex ( ) const RETURN_CAPABILITY ( benchmark_mutex_ ) { <nl> - return benchmark_mutex_ ; <nl> - } <nl> - <nl> - bool StartStopBarrier ( ) EXCLUDES ( end_cond_mutex_ ) { <nl> - return start_stop_barrier_ . wait ( ) ; <nl> - } <nl> - <nl> - void NotifyThreadComplete ( ) EXCLUDES ( end_cond_mutex_ ) { <nl> - start_stop_barrier_ . removeThread ( ) ; <nl> - if ( - - alive_threads_ = = 0 ) { <nl> - MutexLock lock ( end_cond_mutex_ ) ; <nl> - end_condition_ . notify_all ( ) ; <nl> - } <nl> - } <nl> - <nl> - void WaitForAllThreads ( ) EXCLUDES ( end_cond_mutex_ ) { <nl> - MutexLock lock ( end_cond_mutex_ ) ; <nl> - end_condition_ . wait ( lock . native_handle ( ) , <nl> - [ this ] ( ) { return alive_threads_ = = 0 ; } ) ; <nl> - } <nl> - <nl> - public : <nl> - struct Result { <nl> - int64_t iterations = 0 ; <nl> - double real_time_used = 0 ; <nl> - double cpu_time_used = 0 ; <nl> - double manual_time_used = 0 ; <nl> - int64_t bytes_processed = 0 ; <nl> - int64_t items_processed = 0 ; <nl> - int64_t complexity_n = 0 ; <nl> - std : : string report_label_ ; <nl> - std : : string error_message_ ; <nl> - bool has_error_ = false ; <nl> - UserCounters counters ; <nl> - } ; <nl> - GUARDED_BY ( GetBenchmarkMutex ( ) ) Result results ; <nl> - <nl> - private : <nl> - mutable Mutex benchmark_mutex_ ; <nl> - std : : atomic < int > alive_threads_ ; <nl> - Barrier start_stop_barrier_ ; <nl> - Mutex end_cond_mutex_ ; <nl> - Condition end_condition_ ; <nl> - } ; <nl> - <nl> - } / / namespace internal <nl> - } / / namespace benchmark <nl> - <nl> - # endif / / BENCHMARK_THREAD_MANAGER_H <nl> deleted file mode 100644 <nl> index eaf108e017dc . . 000000000000 <nl> mmm a / src / third_party / benchmark - 1 . 4 . 1 / benchmark / src / thread_timer . h <nl> ppp / dev / null <nl> <nl> - # ifndef BENCHMARK_THREAD_TIMER_H <nl> - # define BENCHMARK_THREAD_TIMER_H <nl> - <nl> - # include " check . h " <nl> - # include " timers . h " <nl> - <nl> - namespace benchmark { <nl> - namespace internal { <nl> - <nl> - class ThreadTimer { <nl> - public : <nl> - ThreadTimer ( ) = default ; <nl> - <nl> - / / Called by each thread <nl> - void StartTimer ( ) { <nl> - running_ = true ; <nl> - start_real_time_ = ChronoClockNow ( ) ; <nl> - start_cpu_time_ = ThreadCPUUsage ( ) ; <nl> - } <nl> - <nl> - / / Called by each thread <nl> - void StopTimer ( ) { <nl> - CHECK ( running_ ) ; <nl> - running_ = false ; <nl> - real_time_used_ + = ChronoClockNow ( ) - start_real_time_ ; <nl> - / / Floating point error can result in the subtraction producing a negative <nl> - / / time . Guard against that . <nl> - cpu_time_used_ + = std : : max < double > ( ThreadCPUUsage ( ) - start_cpu_time_ , 0 ) ; <nl> - } <nl> - <nl> - / / Called by each thread <nl> - void SetIterationTime ( double seconds ) { manual_time_used_ + = seconds ; } <nl> - <nl> - bool running ( ) const { return running_ ; } <nl> - <nl> - / / REQUIRES : timer is not running <nl> - double real_time_used ( ) { <nl> - CHECK ( ! running_ ) ; <nl> - return real_time_used_ ; <nl> - } <nl> - <nl> - / / REQUIRES : timer is not running <nl> - double cpu_time_used ( ) { <nl> - CHECK ( ! running_ ) ; <nl> - return cpu_time_used_ ; <nl> - } <nl> - <nl> - / / REQUIRES : timer is not running <nl> - double manual_time_used ( ) { <nl> - CHECK ( ! running_ ) ; <nl> - return manual_time_used_ ; <nl> - } <nl> - <nl> - private : <nl> - bool running_ = false ; / / Is the timer running <nl> - double start_real_time_ = 0 ; / / If running_ <nl> - double start_cpu_time_ = 0 ; / / If running_ <nl> - <nl> - / / Accumulated time so far ( does not contain current slice if running_ ) <nl> - double real_time_used_ = 0 ; <nl> - double cpu_time_used_ = 0 ; <nl> - / / Manually set iteration time . User sets this with SetIterationTime ( seconds ) . <nl> - double manual_time_used_ = 0 ; <nl> - } ; <nl> - <nl> - } / / namespace internal <nl> - } / / namespace benchmark <nl> - <nl> - # endif / / BENCHMARK_THREAD_TIMER_H <nl> deleted file mode 100644 <nl> index d13573118efa . . 000000000000 <nl> mmm a / src / third_party / benchmark - 1 . 4 . 1 / patches / 0002 - SERVER - 33491 - Fix - benchmark . h - compile - with - fdirective . patch <nl> ppp / dev / null <nl> <nl> - From 8a275d29b6e17c37ac66380a7689c80e8a52fbb6 Mon Sep 17 00 : 00 : 00 2001 <nl> - From : Mathias Stearn < mathias @ 10gen . com > <nl> - Date : Mon , 26 Feb 2018 12 : 24 : 33 - 0500 <nl> - Subject : [ PATCH ] SERVER - 33491 Fix benchmark . h compile with - fdirectives - only <nl> - <nl> mmm - <nl> - . . . / benchmark - 1 . 4 . 1 / benchmark / include / benchmark / benchmark . h | 7 pppppp - <nl> - 1 file changed , 6 insertions ( + ) , 1 deletion ( - ) <nl> - <nl> mmmmmm a / src / third_party / benchmark - 1 . 4 . 1 / benchmark / include / benchmark / benchmark . h <nl> - ppp b / src / third_party / benchmark - 1 . 4 . 1 / benchmark / include / benchmark / benchmark . h <nl> - class Fixture : public internal : : Benchmark { <nl> - / / Check that __COUNTER__ is defined and that __COUNTER__ increases by 1 <nl> - / / every time it is expanded . X + 1 = = X + 0 is used in case X is defined to be <nl> - / / empty . If X is empty the expression becomes ( + 1 = = + 0 ) . <nl> - - # if defined ( __COUNTER__ ) & & ( __COUNTER__ + 1 = = __COUNTER__ + 0 ) <nl> - + / / <nl> - + / / MONGODB MODIFICATION : all of our supported compilers support __COUNTER__ so we don ' t need to test <nl> - + / / for it here . This test interferes with - E - fdirectives - only since it is illegal to use <nl> - + / / __COUNTER__ in an # if clause with that flag because its value could change between the partial <nl> - + / / preprocessing and the compile phases . <nl> - + # if true / / defined ( __COUNTER__ ) & & ( __COUNTER__ + 1 = = __COUNTER__ + 0 ) <nl> - # define BENCHMARK_PRIVATE_UNIQUE_ID __COUNTER__ <nl> - # else <nl> - # define BENCHMARK_PRIVATE_UNIQUE_ID __LINE__ <nl> mmm <nl> - 2 . 10 . 1 . windows . 1 <nl> - <nl> mmm a / src / third_party / scripts / benchmark_get_sources . sh <nl> ppp b / src / third_party / scripts / benchmark_get_sources . sh <nl> <nl> # ! / bin / bash <nl> # This script downloads and imports Google Benchmark . <nl> - # It can be run on Linux , Mac OS X or Windows WSL . <nl> + # It can be run on Linux or Mac OS X . <nl> # Actual integration into the build system is not done by this script . <nl> # <nl> # Turn on strict error checking , like perl use ' strict ' <nl> if [ " $ # " - ne 0 ] ; then <nl> exit 1 <nl> fi <nl> <nl> - GIT_EXE = git <nl> - if grep - q Microsoft / proc / version ; then <nl> - GIT_EXE = git . exe <nl> - fi <nl> - <nl> + VERSION = 1 . 3 . 0 <nl> NAME = benchmark <nl> - VERSION = 1 . 4 . 1 <nl> - if grep - q Microsoft / proc / version ; then <nl> - SRC_ROOT = $ ( wslpath - u $ ( powershell . exe - Command " Get - ChildItem Env : TEMP | Get - Content | Write - Host " ) ) <nl> - SRC_ROOT + = " $ ( mktemp - u / benchmark . XXXXXX ) " <nl> - mkdir - p $ SRC_ROOT <nl> - else <nl> - SRC_ROOT = $ ( mktemp - d / tmp / benchmark . XXXXXX ) <nl> - fi <nl> - <nl> + SRC_ROOT = $ ( mktemp - d / tmp / benchmark . XXXXXX ) <nl> + # trap " rm - rf $ SRC_ROOT " EXIT <nl> SRC = $ { SRC_ROOT } / $ { NAME } - $ { VERSION } <nl> - CLONE_DEST = $ SRC <nl> - if grep - q Microsoft / proc / version ; then <nl> - CLONE_DEST = $ ( wslpath - m $ SRC ) <nl> - fi <nl> - DEST_DIR = $ ( $ GIT_EXE rev - parse - - show - toplevel ) / src / third_party / $ NAME - $ VERSION <nl> - PATCH_DIR = $ ( $ GIT_EXE rev - parse - - show - toplevel ) / src / third_party / $ NAME - $ VERSION / patches <nl> - if grep - q Microsoft / proc / version ; then <nl> - DEST_DIR = $ ( wslpath - u " $ DEST_DIR " ) <nl> - PATCH_DIR = $ ( wslpath - w $ ( wslpath - u " $ PATCH_DIR " ) ) <nl> - fi <nl> - <nl> - echo " dest : $ DEST_DIR " <nl> - echo " patch : $ PATCH_DIR " <nl> + DEST_DIR = $ ( git rev - parse - - show - toplevel ) / src / third_party / $ NAME - $ VERSION <nl> + PATCH_DIR = $ ( git rev - parse - - show - toplevel ) / src / third_party / $ NAME - $ VERSION / patches <nl> <nl> if [ ! - d $ SRC ] ; then <nl> - $ GIT_EXE clone git @ github . com : google / benchmark . git $ CLONE_DEST <nl> + git clone git @ github . com : google / benchmark . git $ SRC <nl> <nl> pushd $ SRC <nl> - $ GIT_EXE checkout v $ VERSION <nl> + git checkout v $ VERSION <nl> + git am $ PATCH_DIR / * . patch <nl> <nl> popd <nl> fi <nl>
Revert " SERVER - 37994 Upgrade google benchmark to v1 . 4 . 1 "
mongodb/mongo
f3d8e28d038b590ab7682c5f5e5dc38853bd2d49
2018-12-18T18:12:07Z
mmm a / tools / push - to - trunk . sh <nl> ppp b / tools / push - to - trunk . sh <nl> if [ $ STEP - le 4 ] ; then <nl> for commit in $ COMMITS ; do <nl> # Get the commit ' s title line . <nl> git log - 1 $ commit - - format = " % w ( 80 , 8 , 8 ) % s " > > " $ CHANGELOG_ENTRY_FILE " <nl> - # Grep for " BUG = xxxx " lines in the commit message . <nl> - git log - 1 $ commit - - format = " % b " | grep BUG = | grep - v " BUG = $ " \ <nl> - | sed - e ' s / ^ / / ' \ <nl> - > > " $ CHANGELOG_ENTRY_FILE " <nl> + # Grep for " BUG = xxxx " lines in the commit message and convert them to <nl> + # " ( issue xxxx ) " . <nl> + git log - 1 $ commit - - format = " % B " \ <nl> + | grep " ^ BUG = " | grep - v " BUG = $ " \ <nl> + | sed - e ' s / ^ / / ' \ <nl> + | sed - e ' s / BUG = v8 : \ ( . * \ ) $ / ( issue \ 1 ) / ' \ <nl> + | sed - e ' s / BUG = \ ( . * \ ) $ / ( Chromium issue \ 1 ) / ' \ <nl> + > > " $ CHANGELOG_ENTRY_FILE " <nl> # Append the commit ' s author for reference . <nl> git log - 1 $ commit - - format = " % w ( 80 , 8 , 8 ) ( % an ) " > > " $ CHANGELOG_ENTRY_FILE " <nl> echo " " > > " $ CHANGELOG_ENTRY_FILE " <nl>
Convert " BUG = foo " to " ( issue foo ) " in push - to - trunk . sh
v8/v8
c7d2903fae98801d44e5b3978b6f1bce6c1b8090
2011-09-15T11:45:06Z
mmm a / training / tesstrain . sh <nl> ppp b / training / tesstrain . sh <nl> source ` dirname $ 0 ` / tesstrain_utils . sh <nl> ARGV = ( " $ @ " ) <nl> parse_flags <nl> <nl> - tlog " \ n = = = Starting training for language ' $ { LANG_CODE } ' " <nl> - <nl> - tlog " Cleaning workspace directory $ { TRAINING_DIR } . . . " <nl> mkdir - p $ { TRAINING_DIR } <nl> - rm - fr $ { TRAINING_DIR } / * <nl> + tlog " \ n = = = Starting training for language ' $ { LANG_CODE } ' " <nl> <nl> source ` dirname $ 0 ` / language - specific . sh <nl> set_lang_specific_parameters $ { LANG_CODE } <nl> mmm a / training / tesstrain_utils . sh <nl> ppp b / training / tesstrain_utils . sh <nl> OUTPUT_DIR = " / tmp / tesstrain / tessdata " <nl> OVERWRITE = 0 <nl> RUN_SHAPE_CLUSTERING = 0 <nl> EXTRACT_FONT_PROPERTIES = 1 <nl> - WORKSPACE_DIR = " / tmp / tesstrain " <nl> + WORKSPACE_DIR = ` mktemp - d ` <nl> EXPOSURES = 0 <nl> <nl> # Logging helper functions . <nl>
Use mktemp to create workspace directory
tesseract-ocr/tesseract
de789ac8ea351d848e3a742ad038f9053f9cf1f4
2015-09-10T14:05:07Z
mmm a / test / Parse / raw_string . swift <nl> ppp b / test / Parse / raw_string . swift <nl> _ = # # " " " <nl> <nl> / / = = = mmmmmmmmm - False Multiline Delimiters mmmmmm - - = = = <nl> <nl> - / / / Source code contains zero - width character in this format ` # " [ U + 200B ] " [ U + 200B ] " # ` <nl> - / / / The check contains the zero - width character in this format : ` " [ U + 200B ] \ " [ U + 200B ] " ` <nl> + / / / Source code contains zero - width character in this format : ` # " [ U + 200B ] " [ U + 200B ] " # ` <nl> + / / / The check contains zero - width character in this format : ` " [ U + 200B ] \ " [ U + 200B ] " ` <nl> / / / Use this test when implementating ` diagnoseZeroWidthMatchAndAdvance ` . <nl> / / / See https : / / bugs . swift . org / browse / SR - 8678 <nl> _ = # " ​ " ​ " # <nl>
Consistent comment format for test description
apple/swift
d6d01aa85a77ceaa0d7e607bee079c8d8d1acf28
2020-10-24T03:51:47Z
mmm a / addons / xbmc . metadata / addon . xml <nl> ppp b / addons / xbmc . metadata / addon . xml <nl> <nl> < ? xml version = " 1 . 0 " encoding = " UTF - 8 " ? > <nl> - < addon id = " xbmc . metadata " version = " 2 . 0 " provider - name = " Team XBMC " > <nl> + < addon id = " xbmc . metadata " version = " 2 . 1 " provider - name = " Team XBMC " > <nl> < backwards - compatibility abi = " 1 . 0 " / > <nl> < requires > <nl> < import addon = " xbmc . core " version = " 0 . 1 " / > <nl> mmm a / xbmc / utils / ScraperParser . cpp <nl> ppp b / xbmc / utils / ScraperParser . cpp <nl> void CScraperParser : : ReplaceBuffers ( CStdString & strDest ) <nl> strDest . replace ( strDest . begin ( ) + iIndex , strDest . begin ( ) + iEnd + 1 , strReplace ) ; <nl> iIndex + = strReplace . length ( ) ; <nl> } <nl> + / / insert localize strings <nl> + iIndex = 0 ; <nl> + while ( ( size_t ) ( iIndex = strDest . find ( " $ LOCALIZE [ " , iIndex ) ) ! = CStdString : : npos ) <nl> + { <nl> + int iEnd = strDest . Find ( " ] " , iIndex ) ; <nl> + CStdString strInfo = strDest . Mid ( iIndex + 10 , iEnd - iIndex - 10 ) ; <nl> + CStdString strReplace ; <nl> + if ( m_scraper ) <nl> + strReplace = m_scraper - > GetString ( strtol ( strInfo . c_str ( ) , NULL , 10 ) ) ; <nl> + strDest . replace ( strDest . begin ( ) + iIndex , strDest . begin ( ) + iEnd + 1 , strReplace ) ; <nl> + iIndex + = strReplace . length ( ) ; <nl> + } <nl> iIndex = 0 ; <nl> while ( ( size_t ) ( iIndex = strDest . find ( " \ \ n " , iIndex ) ) ! = CStdString : : npos ) <nl> strDest . replace ( strDest . begin ( ) + iIndex , strDest . begin ( ) + iIndex + 2 , " \ n " ) ; <nl>
Merge pull request from cptspiff / scraperloc
xbmc/xbmc
a310b4aa8c041e76f089ad9f8841d111f93101a2
2012-05-05T05:26:31Z
mmm a / emcc <nl> ppp b / emcc <nl> from tools import shared , jsrun <nl> from tools . shared import Compression , execute , suffix , unsuffixed , unsuffixed_basename , WINDOWS <nl> from tools . response_file import read_response_file <nl> <nl> - C_SUFFIXES = ( ' . c ' , ' . C ' ) <nl> - CXX_SUFFIXES = ( ' . cpp ' , ' . cxx ' , ' . cc ' , ' . CPP ' , ' . CXX ' , ' . CC ' ) <nl> - SOURCE_SUFFIXES = C_SUFFIXES + CXX_SUFFIXES + ( ' . m ' , ' . mm ' ) <nl> - BITCODE_SUFFIXES = ( ' . bc ' , ' . o ' , ' . obj ' ) <nl> - DYNAMICLIB_SUFFIXES = ( ' . dylib ' , ' . so ' , ' . dll ' ) <nl> - STATICLIB_SUFFIXES = ( ' . a ' , ) <nl> - ASSEMBLY_SUFFIXES = ( ' . ll ' , ) <nl> + # endings = dot + a suffix , safe to test by filename . endswith ( endings ) <nl> + C_ENDINGS = ( ' . c ' , ' . C ' ) <nl> + CXX_ENDINGS = ( ' . cpp ' , ' . cxx ' , ' . cc ' , ' . CPP ' , ' . CXX ' , ' . CC ' ) <nl> + SOURCE_ENDINGS = C_ENDINGS + CXX_ENDINGS + ( ' . m ' , ' . mm ' ) <nl> + BITCODE_ENDINGS = ( ' . bc ' , ' . o ' , ' . obj ' ) <nl> + DYNAMICLIB_ENDINGS = ( ' . dylib ' , ' . so ' , ' . dll ' ) <nl> + STATICLIB_ENDINGS = ( ' . a ' , ) <nl> + ASSEMBLY_ENDINGS = ( ' . ll ' , ) <nl> + <nl> LIB_PREFIXES = ( ' ' , ' lib ' ) <nl> + <nl> JS_CONTAINING_SUFFIXES = ( ' js ' , ' html ' ) <nl> <nl> # Mapping of emcc opt levels to llvm opt levels . We use llvm opt level 3 in emcc opt <nl> try : <nl> prev = newargs [ i - 1 ] <nl> if prev in [ ' - MT ' , ' - MF ' , ' - MQ ' , ' - D ' , ' - U ' , ' - o ' , ' - x ' , ' - Xpreprocessor ' , ' - include ' , ' - imacros ' , ' - idirafter ' , ' - iprefix ' , ' - iwithprefix ' , ' - iwithprefixbefore ' , ' - isysroot ' , ' - imultilib ' , ' - A ' , ' - isystem ' , ' - iquote ' , ' - install_name ' , ' - compatibility_version ' , ' - current_version ' , ' - I ' , ' - L ' ] : continue # ignore this gcc - style argument <nl> <nl> - if ( os . path . islink ( arg ) and os . path . realpath ( arg ) . endswith ( SOURCE_SUFFIXES + BITCODE_SUFFIXES + DYNAMICLIB_SUFFIXES + ASSEMBLY_SUFFIXES ) ) : <nl> + if ( os . path . islink ( arg ) and os . path . realpath ( arg ) . endswith ( SOURCE_ENDINGS + BITCODE_ENDINGS + DYNAMICLIB_ENDINGS + ASSEMBLY_ENDINGS ) ) : <nl> arg = os . path . realpath ( arg ) <nl> <nl> if not arg . startswith ( ' - ' ) : <nl> try : <nl> exit ( 1 ) <nl> <nl> arg_suffix = filename_type_suffix ( arg ) <nl> - if arg_suffix . endswith ( SOURCE_SUFFIXES + BITCODE_SUFFIXES + DYNAMICLIB_SUFFIXES + ASSEMBLY_SUFFIXES ) or shared . Building . is_ar ( arg ) : # we already removed - o < target > , so all these should be inputs <nl> + if arg_suffix . endswith ( SOURCE_ENDINGS + BITCODE_ENDINGS + DYNAMICLIB_ENDINGS + ASSEMBLY_ENDINGS ) or shared . Building . is_ar ( arg ) : # we already removed - o < target > , so all these should be inputs <nl> newargs [ i ] = ' ' <nl> - if arg_suffix . endswith ( SOURCE_SUFFIXES ) : <nl> + if arg_suffix . endswith ( SOURCE_ENDINGS ) : <nl> input_files . append ( arg ) <nl> has_source_inputs = True <nl> - elif arg_suffix . endswith ( ASSEMBLY_SUFFIXES ) or shared . Building . is_bitcode ( arg ) : # this should be bitcode , make sure it is valid <nl> + elif arg_suffix . endswith ( ASSEMBLY_ENDINGS ) or shared . Building . is_bitcode ( arg ) : # this should be bitcode , make sure it is valid <nl> input_files . append ( arg ) <nl> - elif arg_suffix . endswith ( STATICLIB_SUFFIXES + DYNAMICLIB_SUFFIXES ) : <nl> + elif arg_suffix . endswith ( STATICLIB_ENDINGS + DYNAMICLIB_ENDINGS ) : <nl> # if it ' s not , and it ' s a library , just add it to libs to find later <nl> l = unsuffixed_basename ( arg ) <nl> for prefix in LIB_PREFIXES : <nl> try : <nl> newargs [ i ] = ' ' <nl> else : <nl> logging . warning ( arg + ' is not valid LLVM bitcode ' ) <nl> - elif arg_suffix . endswith ( STATICLIB_SUFFIXES ) : <nl> + elif arg_suffix . endswith ( STATICLIB_ENDINGS ) : <nl> if not shared . Building . is_ar ( arg ) : <nl> if shared . Building . is_bitcode ( arg ) : <nl> - logging . error ( arg + ' : File has a suffix of a static library ' + str ( STATICLIB_SUFFIXES ) + ' , but instead is an LLVM bitcode file ! When linking LLVM bitcode files , use one of the suffixes ' + str ( BITCODE_SUFFIXES ) ) <nl> + logging . error ( arg + ' : File has a suffix of a static library ' + str ( STATICLIB_ENDINGS ) + ' , but instead is an LLVM bitcode file ! When linking LLVM bitcode files , use one of the suffixes ' + str ( BITCODE_ENDINGS ) ) <nl> else : <nl> logging . error ( arg + ' : Unknown format , not a static library ! ' ) <nl> exit ( 1 ) <nl> try : <nl> logging . debug ( ' looking for library " % s " ' % lib ) <nl> found = False <nl> for prefix in LIB_PREFIXES : <nl> - for suff in STATICLIB_SUFFIXES + DYNAMICLIB_SUFFIXES : <nl> + for suff in STATICLIB_ENDINGS + DYNAMICLIB_ENDINGS : <nl> name = prefix + lib + suff <nl> for lib_dir in lib_dirs : <nl> path = os . path . join ( lib_dir , name ) <nl> try : <nl> # ignore dynamic linking , since multiple dynamic linkings can interfere with each other <nl> if not filename_type_suffix ( target ) [ 1 : ] in JS_CONTAINING_SUFFIXES or ignore_dynamic_linking : <nl> def check ( input_file ) : <nl> - if input_file . endswith ( DYNAMICLIB_SUFFIXES ) : <nl> + if input_file . endswith ( DYNAMICLIB_ENDINGS ) : <nl> if not ignore_dynamic_linking : logging . warning ( ' ignoring dynamic library % s because not compiling to JS or HTML , remember to link it when compiling to JS or HTML at the end ' % os . path . basename ( input_file ) ) <nl> return False <nl> else : <nl> try : <nl> input_files = filter ( lambda input_file : check ( input_file ) , input_files ) <nl> <nl> if len ( input_files ) = = 0 : <nl> - logging . error ( ' no input files \ nnote that input files without a known suffix are ignored , make sure your input files end with one of : ' + str ( SOURCE_SUFFIXES + BITCODE_SUFFIXES + DYNAMICLIB_SUFFIXES + STATICLIB_SUFFIXES + ASSEMBLY_SUFFIXES ) ) <nl> + logging . error ( ' no input files \ nnote that input files without a known suffix are ignored , make sure your input files end with one of : ' + str ( SOURCE_ENDINGS + BITCODE_ENDINGS + DYNAMICLIB_ENDINGS + STATICLIB_ENDINGS + ASSEMBLY_ENDINGS ) ) <nl> exit ( 0 ) <nl> <nl> newargs = CC_ADDITIONAL_ARGS + newargs <nl> try : <nl> # First , generate LLVM bitcode . For each input file , we get base . o with bitcode <nl> for input_file in input_files : <nl> file_suffix = filename_type_suffix ( input_file ) <nl> - if file_suffix . endswith ( SOURCE_SUFFIXES ) : <nl> + if file_suffix . endswith ( SOURCE_ENDINGS ) : <nl> logging . debug ( ' compiling source file : ' + input_file ) <nl> input_file = shared . Building . preprocess ( input_file , in_temp ( uniquename ( input_file ) ) ) <nl> output_file = in_temp ( unsuffixed ( uniquename ( input_file ) ) + ' . o ' ) <nl> temp_files . append ( output_file ) <nl> args = newargs + [ ' - emit - llvm ' , ' - c ' , input_file , ' - o ' , output_file ] <nl> - if file_suffix . endswith ( CXX_SUFFIXES ) : <nl> + if file_suffix . endswith ( CXX_ENDINGS ) : <nl> args + = shared . EMSDK_CXX_OPTS <nl> logging . debug ( " running : " + call + ' ' + ' ' . join ( args ) ) <nl> execute ( [ call ] + args ) # let compiler frontend print directly , so colors are saved ( PIPE kills that ) <nl> try : <nl> logging . error ( ' compiler frontend failed to generate LLVM bitcode , halting ' ) <nl> sys . exit ( 1 ) <nl> else : # bitcode <nl> - if file_suffix . endswith ( BITCODE_SUFFIXES ) : <nl> + if file_suffix . endswith ( BITCODE_ENDINGS ) : <nl> logging . debug ( ' copying bitcode file : ' + input_file ) <nl> temp_file = in_temp ( unsuffixed ( uniquename ( input_file ) ) + ' . o ' ) <nl> shutil . copyfile ( input_file , temp_file ) <nl> temp_files . append ( temp_file ) <nl> - elif file_suffix . endswith ( DYNAMICLIB_SUFFIXES ) or shared . Building . is_ar ( input_file ) : <nl> + elif file_suffix . endswith ( DYNAMICLIB_ENDINGS ) or shared . Building . is_ar ( input_file ) : <nl> logging . debug ( ' copying library file : ' + input_file ) <nl> temp_file = in_temp ( uniquename ( input_file ) ) <nl> shutil . copyfile ( input_file , temp_file ) <nl> temp_files . append ( temp_file ) <nl> - elif file_suffix . endswith ( ASSEMBLY_SUFFIXES ) : <nl> + elif file_suffix . endswith ( ASSEMBLY_ENDINGS ) : <nl> if not LEAVE_INPUTS_RAW : <nl> # Note that by assembling the . ll file , then disassembling it later , we will <nl> # remove annotations which is a good thing for compilation time <nl> try : <nl> if llvm_opts > 0 : <nl> for i , input_file in enumerate ( input_files ) : <nl> file_suffix = filename_type_suffix ( input_file ) <nl> - if file_suffix . endswith ( SOURCE_SUFFIXES ) : <nl> + if file_suffix . endswith ( SOURCE_ENDINGS ) : <nl> temp_file = temp_files [ i ] <nl> logging . debug ( ' optimizing % s with - O % s ' % ( input_file , llvm_opts ) ) <nl> shared . Building . llvm_opt ( temp_file , llvm_opts ) <nl> try : <nl> <nl> # First , combine the bitcode files if there are several . We must also link if we have a singleton . a <nl> if len ( input_files ) + len ( extra_files_to_link ) > 1 or \ <nl> - ( not LEAVE_INPUTS_RAW and not ( suffix ( temp_files [ 0 ] ) in BITCODE_SUFFIXES or suffix ( temp_files [ 0 ] ) in DYNAMICLIB_SUFFIXES ) and shared . Building . is_ar ( temp_files [ 0 ] ) ) : <nl> + ( not LEAVE_INPUTS_RAW and not ( suffix ( temp_files [ 0 ] ) in BITCODE_ENDINGS or suffix ( temp_files [ 0 ] ) in DYNAMICLIB_ENDINGS ) and shared . Building . is_ar ( temp_files [ 0 ] ) ) : <nl> linker_inputs = temp_files + extra_files_to_link <nl> logging . debug ( ' linking : ' + str ( linker_inputs ) ) <nl> t0 = time . time ( ) <nl> - shared . Building . link ( linker_inputs , in_temp ( target_basename + ' . bc ' ) , force_archive_contents = len ( filter ( lambda temp : not temp . endswith ( STATICLIB_SUFFIXES ) , temp_files ) ) = = 0 ) <nl> + shared . Building . link ( linker_inputs , in_temp ( target_basename + ' . bc ' ) , force_archive_contents = len ( filter ( lambda temp : not temp . endswith ( STATICLIB_ENDINGS ) , temp_files ) ) = = 0 ) <nl> t1 = time . time ( ) <nl> logging . debug ( ' linking took % . 2f seconds ' % ( t1 - t0 ) ) <nl> final = in_temp ( target_basename + ' . bc ' ) <nl>
clearly differentiate suffixes from endings ( dot + suffix ) in emcc
emscripten-core/emscripten
b1f10031a3a50c22f2d39fa4ebe0117a9a43d4be
2013-12-24T17:41:07Z
mmm a / src / core / hle / service / hid / controllers / npad . cpp <nl> ppp b / src / core / hle / service / hid / controllers / npad . cpp <nl> Controller_NPad : : LedPattern Controller_NPad : : GetLedPattern ( u32 npad_id ) { <nl> } <nl> } <nl> <nl> + bool Controller_NPad : : IsUnintendedHomeButtonInputProtectionEnabled ( u32 npad_id ) const { <nl> + return unintended_home_button_input_protection [ NPadIdToIndex ( npad_id ) ] ; <nl> + } <nl> + <nl> + void Controller_NPad : : SetUnintendedHomeButtonInputProtectionEnabled ( bool is_protection_enabled , <nl> + u32 npad_id ) { <nl> + unintended_home_button_input_protection [ NPadIdToIndex ( npad_id ) ] = is_protection_enabled ; <nl> + } <nl> + <nl> void Controller_NPad : : SetVibrationEnabled ( bool can_vibrate ) { <nl> can_controllers_vibrate = can_vibrate ; <nl> } <nl> mmm a / src / core / hle / service / hid / controllers / npad . h <nl> ppp b / src / core / hle / service / hid / controllers / npad . h <nl> class Controller_NPad final : public ControllerBase { <nl> bool IsSixAxisSensorAtRest ( ) const ; <nl> void SetSixAxisEnabled ( bool six_axis_status ) ; <nl> LedPattern GetLedPattern ( u32 npad_id ) ; <nl> + bool IsUnintendedHomeButtonInputProtectionEnabled ( u32 npad_id ) const ; <nl> + void SetUnintendedHomeButtonInputProtectionEnabled ( bool is_protection_enabled , u32 npad_id ) ; <nl> void SetVibrationEnabled ( bool can_vibrate ) ; <nl> bool IsVibrationEnabled ( ) const ; <nl> void ClearAllConnectedControllers ( ) ; <nl> class Controller_NPad final : public ControllerBase { <nl> std : : array < Kernel : : EventPair , 10 > styleset_changed_events ; <nl> Vibration last_processed_vibration { } ; <nl> std : : array < ControllerHolder , 10 > connected_controllers { } ; <nl> + std : : array < bool , 10 > unintended_home_button_input_protection { } ; <nl> GyroscopeZeroDriftMode gyroscope_zero_drift_mode { GyroscopeZeroDriftMode : : Standard } ; <nl> bool can_controllers_vibrate { true } ; <nl> bool sixaxis_sensors_enabled { true } ; <nl> mmm a / src / core / hle / service / hid / hid . cpp <nl> ppp b / src / core / hle / service / hid / hid . cpp <nl> Hid : : Hid ( Core : : System & system ) : ServiceFramework ( " hid " ) , system ( system ) { <nl> { 128 , & Hid : : SetNpadHandheldActivationMode , " SetNpadHandheldActivationMode " } , <nl> { 129 , & Hid : : GetNpadHandheldActivationMode , " GetNpadHandheldActivationMode " } , <nl> { 130 , & Hid : : SwapNpadAssignment , " SwapNpadAssignment " } , <nl> - { 131 , nullptr , " IsUnintendedHomeButtonInputProtectionEnabled " } , <nl> - { 132 , nullptr , " EnableUnintendedHomeButtonInputProtection " } , <nl> + { 131 , & Hid : : IsUnintendedHomeButtonInputProtectionEnabled , " IsUnintendedHomeButtonInputProtectionEnabled " } , <nl> + { 132 , & Hid : : EnableUnintendedHomeButtonInputProtection , " EnableUnintendedHomeButtonInputProtection " } , <nl> { 133 , nullptr , " SetNpadJoyAssignmentModeSingleWithDestination " } , <nl> { 134 , nullptr , " SetNpadAnalogStickUseCenterClamp " } , <nl> { 135 , nullptr , " SetNpadCaptureButtonAssignment " } , <nl> void Hid : : SwapNpadAssignment ( Kernel : : HLERequestContext & ctx ) { <nl> } <nl> } <nl> <nl> + void Hid : : IsUnintendedHomeButtonInputProtectionEnabled ( Kernel : : HLERequestContext & ctx ) { <nl> + IPC : : RequestParser rp { ctx } ; <nl> + const auto npad_id { rp . Pop < u32 > ( ) } ; <nl> + const auto applet_resource_user_id { rp . Pop < u64 > ( ) } ; <nl> + <nl> + LOG_WARNING ( Service_HID , " ( STUBBED ) called , npad_id = { } , applet_resource_user_id = { } " , npad_id , <nl> + applet_resource_user_id ) ; <nl> + <nl> + auto & controller = applet_resource - > GetController < Controller_NPad > ( HidController : : NPad ) ; <nl> + <nl> + IPC : : ResponseBuilder rb { ctx , 3 } ; <nl> + rb . Push ( RESULT_SUCCESS ) ; <nl> + rb . Push < bool > ( controller . IsUnintendedHomeButtonInputProtectionEnabled ( npad_id ) ) ; <nl> + } <nl> + <nl> + void Hid : : EnableUnintendedHomeButtonInputProtection ( Kernel : : HLERequestContext & ctx ) { <nl> + IPC : : RequestParser rp { ctx } ; <nl> + const auto unintended_home_button_input_protection { rp . Pop < bool > ( ) } ; <nl> + const auto npad_id { rp . Pop < u32 > ( ) } ; <nl> + const auto applet_resource_user_id { rp . Pop < u64 > ( ) } ; <nl> + <nl> + LOG_WARNING ( Service_HID , <nl> + " ( STUBBED ) called , unintended_home_button_input_protection = { } , npad_id = { } , " <nl> + " applet_resource_user_id = { } " , <nl> + npad_id , unintended_home_button_input_protection , applet_resource_user_id ) ; <nl> + <nl> + auto & controller = applet_resource - > GetController < Controller_NPad > ( HidController : : NPad ) ; <nl> + controller . SetUnintendedHomeButtonInputProtectionEnabled ( <nl> + unintended_home_button_input_protection , npad_id ) ; <nl> + <nl> + IPC : : ResponseBuilder rb { ctx , 2 } ; <nl> + rb . Push ( RESULT_SUCCESS ) ; <nl> + } <nl> + <nl> void Hid : : BeginPermitVibrationSession ( Kernel : : HLERequestContext & ctx ) { <nl> IPC : : RequestParser rp { ctx } ; <nl> const auto applet_resource_user_id { rp . Pop < u64 > ( ) } ; <nl> mmm a / src / core / hle / service / hid / hid . h <nl> ppp b / src / core / hle / service / hid / hid . h <nl> class Hid final : public ServiceFramework < Hid > { <nl> void SetNpadHandheldActivationMode ( Kernel : : HLERequestContext & ctx ) ; <nl> void GetNpadHandheldActivationMode ( Kernel : : HLERequestContext & ctx ) ; <nl> void SwapNpadAssignment ( Kernel : : HLERequestContext & ctx ) ; <nl> + void IsUnintendedHomeButtonInputProtectionEnabled ( Kernel : : HLERequestContext & ctx ) ; <nl> + void EnableUnintendedHomeButtonInputProtection ( Kernel : : HLERequestContext & ctx ) ; <nl> void BeginPermitVibrationSession ( Kernel : : HLERequestContext & ctx ) ; <nl> void EndPermitVibrationSession ( Kernel : : HLERequestContext & ctx ) ; <nl> void SendVibrationValue ( Kernel : : HLERequestContext & ctx ) ; <nl>
hid : Stub HomeButtonInputProtection service commands
yuzu-emu/yuzu
6380731486e687a0a6b60ac3a1bd68812e538e66
2020-09-30T10:38:24Z
mmm a / CMakeLists . txt <nl> ppp b / CMakeLists . txt <nl> find_package ( Threads REQUIRED ) <nl> if ( ENABLE_SDL2 ) <nl> if ( YUZU_USE_BUNDLED_SDL2 ) <nl> # Detect toolchain and platform <nl> - if ( ( MSVC_VERSION GREATER_EQUAL 1910 AND MSVC_VERSION LESS 1920 ) AND ARCHITECTURE_x86_64 ) <nl> + if ( ( MSVC_VERSION GREATER_EQUAL 1910 AND MSVC_VERSION LESS 1930 ) AND ARCHITECTURE_x86_64 ) <nl> set ( SDL2_VER " SDL2 - 2 . 0 . 8 " ) <nl> else ( ) <nl> message ( FATAL_ERROR " No bundled SDL2 binaries for your toolchain . Disable YUZU_USE_BUNDLED_SDL2 and provide your own . " ) <nl> if ( YUZU_USE_BUNDLED_UNICORN ) <nl> if ( MSVC ) <nl> message ( STATUS " unicorn not found , falling back to bundled " ) <nl> # Detect toolchain and platform <nl> - if ( ( MSVC_VERSION GREATER_EQUAL 1910 AND MSVC_VERSION LESS 1920 ) AND ARCHITECTURE_x86_64 ) <nl> + if ( ( MSVC_VERSION GREATER_EQUAL 1910 AND MSVC_VERSION LESS 1930 ) AND ARCHITECTURE_x86_64 ) <nl> set ( UNICORN_VER " unicorn - yuzu " ) <nl> else ( ) <nl> message ( FATAL_ERROR " No bundled Unicorn binaries for your toolchain . Disable YUZU_USE_BUNDLED_UNICORN and provide your own . " ) <nl> endif ( ) <nl> <nl> if ( ENABLE_QT ) <nl> if ( YUZU_USE_BUNDLED_QT ) <nl> - if ( ( MSVC_VERSION GREATER_EQUAL 1910 AND MSVC_VERSION LESS 1920 ) AND ARCHITECTURE_x86_64 ) <nl> + if ( ( MSVC_VERSION GREATER_EQUAL 1910 AND MSVC_VERSION LESS 1930 ) AND ARCHITECTURE_x86_64 ) <nl> set ( QT_VER qt - 5 . 12 . 0 - msvc2017_64 ) <nl> else ( ) <nl> message ( FATAL_ERROR " No bundled Qt binaries for your toolchain . Disable YUZU_USE_BUNDLED_QT and provide your own . " ) <nl>
Merge pull request from lioncash / vs2019
yuzu-emu/yuzu
ffd9a1f3ef47cf7dbcc9fa7e5f8bb48114ba008f
2019-05-19T13:33:28Z
mmm a / src / mongo / s / commands / cluster_commit_transaction_cmd . cpp <nl> ppp b / src / mongo / s / commands / cluster_commit_transaction_cmd . cpp <nl> class ClusterCommitTransactionCmd : public BasicCommand { <nl> " commitTransaction can only be run within a context of a session " , <nl> txnRouter ! = nullptr ) ; <nl> <nl> - auto cmdResponse = txnRouter - > commitTransaction ( opCtx ) ; <nl> - CommandHelpers : : filterCommandReplyForPassthrough ( cmdResponse . response , & result ) ; <nl> + txnRouter - > commitTransaction ( opCtx ) ; <nl> return true ; <nl> } <nl> } clusterCommitTransactionCmd ; <nl> mmm a / src / mongo / s / transaction_router . cpp <nl> ppp b / src / mongo / s / transaction_router . cpp <nl> void TransactionRouter : : beginOrContinueTxn ( OperationContext * opCtx , <nl> } <nl> } <nl> <nl> - <nl> - Shard : : CommandResponse TransactionRouter : : _commitSingleShardTransaction ( OperationContext * opCtx ) { <nl> + void TransactionRouter : : _commitSingleShardTransaction ( OperationContext * opCtx ) { <nl> auto shardRegistry = Grid : : get ( opCtx ) - > shardRegistry ( ) ; <nl> <nl> auto citer = _participants . cbegin ( ) ; <nl> Shard : : CommandResponse TransactionRouter : : _commitSingleShardTransaction ( Operatio <nl> commitCmd . setDbName ( " admin " ) ; <nl> <nl> const auto & participant = citer - > second ; <nl> - return uassertStatusOK ( shard - > runCommandWithFixedRetryAttempts ( <nl> + uassertStatusOK ( shard - > runCommandWithFixedRetryAttempts ( <nl> opCtx , <nl> ReadPreferenceSetting { ReadPreference : : PrimaryOnly } , <nl> " admin " , <nl> Shard : : CommandResponse TransactionRouter : : _commitSingleShardTransaction ( Operatio <nl> Shard : : RetryPolicy : : kIdempotent ) ) ; <nl> } <nl> <nl> - Shard : : CommandResponse TransactionRouter : : _commitMultiShardTransaction ( OperationContext * opCtx ) { <nl> + void TransactionRouter : : _commitMultiShardTransaction ( OperationContext * opCtx ) { <nl> invariant ( _coordinatorId ) ; <nl> <nl> auto shardRegistry = Grid : : get ( opCtx ) - > shardRegistry ( ) ; <nl> Shard : : CommandResponse TransactionRouter : : _commitMultiShardTransaction ( Operation <nl> auto coordinatorIter = _participants . find ( * _coordinatorId ) ; <nl> invariant ( coordinatorIter ! = _participants . end ( ) ) ; <nl> <nl> - return uassertStatusOK ( coordinatorShard - > runCommandWithFixedRetryAttempts ( <nl> + uassertStatusOK ( coordinatorShard - > runCommandWithFixedRetryAttempts ( <nl> opCtx , <nl> ReadPreferenceSetting { ReadPreference : : PrimaryOnly } , <nl> " admin " , <nl> Shard : : CommandResponse TransactionRouter : : _commitMultiShardTransaction ( Operation <nl> Shard : : RetryPolicy : : kIdempotent ) ) ; <nl> } <nl> <nl> - Shard : : CommandResponse TransactionRouter : : commitTransaction ( OperationContext * opCtx ) { <nl> + void TransactionRouter : : commitTransaction ( OperationContext * opCtx ) { <nl> uassert ( 50940 , " cannot commit with no participants " , ! _participants . empty ( ) ) ; <nl> <nl> if ( _participants . size ( ) = = 1 ) { <nl> - return _commitSingleShardTransaction ( opCtx ) ; <nl> + _commitSingleShardTransaction ( opCtx ) ; <nl> } <nl> <nl> - return _commitMultiShardTransaction ( opCtx ) ; <nl> + _commitMultiShardTransaction ( opCtx ) ; <nl> } <nl> <nl> std : : vector < AsyncRequestsSender : : Response > TransactionRouter : : abortTransaction ( <nl> mmm a / src / mongo / s / transaction_router . h <nl> ppp b / src / mongo / s / transaction_router . h <nl> <nl> # include " mongo / db / operation_context . h " <nl> # include " mongo / db / repl / read_concern_args . h " <nl> # include " mongo / s / async_requests_sender . h " <nl> - # include " mongo / s / client / shard . h " <nl> # include " mongo / s / shard_id . h " <nl> # include " mongo / util / string_map . h " <nl> <nl> class TransactionRouter { <nl> * Commits the transaction . For transactions with multiple participants , this will initiate <nl> * the two phase commit procedure . <nl> * / <nl> - Shard : : CommandResponse commitTransaction ( OperationContext * opCtx ) ; <nl> + void commitTransaction ( OperationContext * opCtx ) ; <nl> <nl> / * * <nl> * Sends abort to all participants and returns the responses from all shards . <nl> class TransactionRouter { <nl> / * * <nl> * Run basic commit for transactions that touched a single shard . <nl> * / <nl> - Shard : : CommandResponse _commitSingleShardTransaction ( OperationContext * opCtx ) ; <nl> + void _commitSingleShardTransaction ( OperationContext * opCtx ) ; <nl> <nl> / * * <nl> * Run two phase commit for transactions that touched multiple shards . <nl> * / <nl> - Shard : : CommandResponse _commitMultiShardTransaction ( OperationContext * opCtx ) ; <nl> + void _commitMultiShardTransaction ( OperationContext * opCtx ) ; <nl> <nl> / * * <nl> * Returns true if the current transaction can retry on a stale version error from a contacted <nl>
SERVER - 37703 TransactionRouter : : commitTransaction does not need to return the coordinator ' s response to the caller
mongodb/mongo
7a1cf7b8cc5751cd19ced4186ab575b8827d22dd
2018-10-22T20:17:05Z
mmm a / cocos / 2d / CCFontAtlas . cpp <nl> ppp b / cocos / 2d / CCFontAtlas . cpp <nl> bool FontAtlas : : prepareLetterDefinitions ( unsigned short * utf16String ) <nl> <nl> Rect tempRect ; <nl> <nl> - FontLetterDefinition tempDef ; <nl> - tempDef . offsetX = 0 ; <nl> + FontLetterDefinition tempDef ; <nl> tempDef . anchorX = 0 . 0f ; <nl> tempDef . anchorY = 1 . 0f ; <nl> <nl> bool FontAtlas : : prepareLetterDefinitions ( unsigned short * utf16String ) <nl> tempDef . width = 0 ; <nl> tempDef . height = 0 ; <nl> tempDef . U = 0 ; <nl> - tempDef . V = 0 ; <nl> + tempDef . V = 0 ; <nl> + tempDef . offsetX = 0 ; <nl> tempDef . offsetY = 0 ; <nl> tempDef . textureID = 0 ; <nl> } <nl> bool FontAtlas : : prepareLetterDefinitions ( unsigned short * utf16String ) <nl> tempDef . validDefinition = true ; <nl> tempDef . letteCharUTF16 = utf16String [ i ] ; <nl> tempDef . width = tempRect . size . width + _letterPadding ; <nl> - tempDef . height = _currentPageLineHeight - 1 ; <nl> + tempDef . height = _currentPageLineHeight - 1 ; <nl> + tempDef . offsetX = tempRect . origin . x ; <nl> tempDef . offsetY = tempRect . origin . y ; <nl> tempDef . commonLineHeight = _currentPageLineHeight ; <nl> <nl> mmm a / cocos / 2d / CCFontDefinition . cpp <nl> ppp b / cocos / 2d / CCFontDefinition . cpp <nl> FontAtlas * FontDefinitionTTF : : createFontAtlas ( ) <nl> if ( item . second . validDefinition ) <nl> { <nl> FontLetterDefinition tempDefinition = item . second ; <nl> - tempDefinition . offsetX = 0 ; <nl> tempDefinition . anchorX = 0 . 0f ; <nl> tempDefinition . anchorY = 1 . 0f ; <nl> retAtlas - > addLetterDefinition ( tempDefinition ) ; <nl> mmm a / cocos / 2d / CCFontFreeType . cpp <nl> ppp b / cocos / 2d / CCFontFreeType . cpp <nl> bool FontFreeType : : getBBOXFotChar ( unsigned short theChar , Rect & outRect ) const <nl> return false ; <nl> <nl> / / store result in the passed rectangle <nl> - outRect . origin . x = 0 ; <nl> + outRect . origin . x = _fontRef - > glyph - > metrics . horiBearingX > > 6 ; <nl> outRect . origin . y = - ( _fontRef - > glyph - > metrics . horiBearingY > > 6 ) ; <nl> outRect . size . width = ( _fontRef - > glyph - > metrics . width > > 6 ) ; <nl> outRect . size . height = ( _fontRef - > glyph - > metrics . height > > 6 ) ; <nl> Size * FontFreeType : : getAdvancesForTextUTF16 ( unsigned short * text , int & outNumLe <nl> int advance = 0 ; <nl> int kerning = 0 ; <nl> <nl> - advance = getAdvanceForChar ( text [ c ] ) - getBearingXForChar ( text [ c ] ) ; <nl> + advance = getAdvanceForChar ( text [ c ] ) ; <nl> <nl> if ( c < ( outNumLetters - 1 ) ) <nl> kerning = getHorizontalKerningForChars ( text [ c ] , text [ c + 1 ] ) ; <nl> int FontFreeType : : getAdvanceForChar ( unsigned short theChar ) const <nl> return 0 ; <nl> <nl> / / get to the advance for this glyph <nl> - return ( static_cast < int > ( _fontRef - > glyph - > advance . x > > 6 ) ) ; <nl> + return ( static_cast < int > ( _fontRef - > glyph - > metrics . horiAdvance > > 6 ) ) ; <nl> } <nl> <nl> int FontFreeType : : getBearingXForChar ( unsigned short theChar ) const <nl>
close : fix incorrect spacing between characters
cocos2d/cocos2d-x
db4dc28c1a5ba572857d9ddbb63672cef348cce9
2014-01-17T06:04:52Z
mmm a / drivers / gles3 / rasterizer_scene_gles3 . cpp <nl> ppp b / drivers / gles3 / rasterizer_scene_gles3 . cpp <nl> void RasterizerSceneGLES3 : : _copy_screen ( bool p_invalidate_color , bool p_invalida <nl> <nl> GLenum attachments [ 2 ] = { <nl> GL_COLOR_ATTACHMENT0 , <nl> - GL_DEPTH_STENCIL_ATTACHMENT <nl> + GL_DEPTH_ATTACHMENT <nl> } ; <nl> <nl> glInvalidateFramebuffer ( GL_FRAMEBUFFER , p_invalidate_depth ? 2 : 1 , attachments ) ; <nl> void RasterizerSceneGLES3 : : render_scene ( const Transform & p_cam_transform , const <nl> glBindFramebuffer ( GL_READ_FRAMEBUFFER , storage - > frame . current_rt - > buffers . fbo ) ; <nl> glReadBuffer ( GL_COLOR_ATTACHMENT0 ) ; <nl> glBindFramebuffer ( GL_DRAW_FRAMEBUFFER , storage - > frame . current_rt - > fbo ) ; <nl> - glBlitFramebuffer ( 0 , 0 , storage - > frame . current_rt - > width , storage - > frame . current_rt - > height , 0 , 0 , storage - > frame . current_rt - > width , storage - > frame . current_rt - > height , GL_DEPTH_BUFFER_BIT , GL_NEAREST ) ; <nl> + glBlitFramebuffer ( 0 , 0 , storage - > frame . current_rt - > width , storage - > frame . current_rt - > height , 0 , 0 , storage - > frame . current_rt - > width , storage - > frame . current_rt - > height , GL_COLOR_BUFFER_BIT , GL_NEAREST ) ; <nl> glBindFramebuffer ( GL_READ_FRAMEBUFFER , 0 ) ; <nl> glBindFramebuffer ( GL_DRAW_FRAMEBUFFER , 0 ) ; <nl> / / bind depth for read <nl> mmm a / drivers / gles3 / rasterizer_storage_gles3 . cpp <nl> ppp b / drivers / gles3 / rasterizer_storage_gles3 . cpp <nl> void RasterizerStorageGLES3 : : _render_target_allocate ( RenderTarget * rt ) { <nl> <nl> glGenTextures ( 1 , & rt - > exposure . color ) ; <nl> glBindTexture ( GL_TEXTURE_2D , rt - > exposure . color ) ; <nl> + # ifdef IPHONE_ENABLED <nl> + / / / @ TODO ugly hack to get around iOS not supporting 32bit single channel floating point textures . . . <nl> + glTexImage2D ( GL_TEXTURE_2D , 0 , GL_R16F , 1 , 1 , 0 , GL_RED , GL_FLOAT , NULL ) ; <nl> + # else <nl> glTexImage2D ( GL_TEXTURE_2D , 0 , GL_R32F , 1 , 1 , 0 , GL_RED , GL_FLOAT , NULL ) ; <nl> + # endif <nl> glFramebufferTexture2D ( GL_FRAMEBUFFER , GL_COLOR_ATTACHMENT0 , GL_TEXTURE_2D , rt - > exposure . color , 0 ) ; <nl> <nl> status = glCheckFramebufferStatus ( GL_FRAMEBUFFER ) ; <nl> RID RasterizerStorageGLES3 : : canvas_light_shadow_buffer_create ( int p_width ) { <nl> if ( config . use_rgba_2d_shadows ) { <nl> glTexImage2D ( GL_TEXTURE_2D , 0 , GL_RGBA8 , cls - > size , cls - > height , 0 , GL_RGBA , GL_UNSIGNED_BYTE , NULL ) ; <nl> } else { <nl> + # ifdef IPHONE_ENABLED <nl> + / / / @ TODO ugly hack to get around iOS not supporting 32bit single channel floating point textures . . . <nl> + glTexImage2D ( GL_TEXTURE_2D , 0 , GL_R16F , cls - > size , cls - > height , 0 , GL_RED , GL_FLOAT , NULL ) ; <nl> + # else <nl> glTexImage2D ( GL_TEXTURE_2D , 0 , GL_R32F , cls - > size , cls - > height , 0 , GL_RED , GL_FLOAT , NULL ) ; <nl> + # endif <nl> } <nl> <nl> glTexParameteri ( GL_TEXTURE_2D , GL_TEXTURE_MAG_FILTER , GL_NEAREST ) ; <nl>
Merge pull request from BastiaanOlij / fix_ios_issues
godotengine/godot
d747e3014039c2002262abbde6d5465674a3de07
2019-01-23T10:14:09Z
mmm a / src / Makefile <nl> ppp b / src / Makefile <nl> CXX_SRCS : = $ ( shell find caffe ! - name " test_ * . cpp " - name " * . cpp " ) <nl> CU_SRCS : = $ ( shell find caffe - name " * . cu " ) <nl> TEST_SRCS : = $ ( shell find caffe - name " test_ * . cpp " ) <nl> GTEST_SRC : = gtest / gtest - all . cpp <nl> + PROGRAM_SRCS : = $ ( shell find programs - name " * . cpp " ) <nl> PROTO_SRCS : = $ ( wildcard caffe / proto / * . proto ) <nl> PROTO_GEN_HEADER : = $ { PROTO_SRCS : . proto = . pb . h } <nl> PROTO_GEN_CC : = $ { PROTO_SRCS : . proto = . pb . cc } <nl> PROTO_GEN_PY : = $ { PROTO_SRCS : . proto = _pb2 . py } <nl> CXX_OBJS : = $ { CXX_SRCS : . cpp = . o } <nl> CU_OBJS : = $ { CU_SRCS : . cu = . cuo } <nl> + PROGRAM_OBJS : = $ { PROGRAM_SRCS : . cpp = . o } <nl> PROTO_OBJS : = $ { PROTO_SRCS : . proto = . pb . o } <nl> OBJS : = $ ( PROTO_OBJS ) $ ( CXX_OBJS ) $ ( CU_OBJS ) <nl> TEST_OBJS : = $ { TEST_SRCS : . cpp = . o } <nl> GTEST_OBJ : = $ { GTEST_SRC : . cpp = . o } <nl> TEST_BINS : = $ { TEST_OBJS : . o = . testbin } <nl> + PROGRAM_BINS : = $ { PROGRAM_OBJS : . o = . bin } <nl> <nl> CUDA_DIR : = / usr / local / cuda <nl> CUDA_ARCH : = - arch = sm_20 <nl> LDFLAGS + = $ ( foreach library , $ ( LIBRARIES ) , - l $ ( library ) ) <nl> LINK = $ ( CXX ) $ ( CXXFLAGS ) $ ( CPPFLAGS ) $ ( LDFLAGS ) $ ( WARNINGS ) <nl> NVCC = nvcc $ { CXXFLAGS : - fPIC = - Xcompiler - fPIC } $ ( CPPFLAGS ) $ ( CUDA_ARCH ) <nl> <nl> - . PHONY : all test clean distclean linecount <nl> + . PHONY : all test clean distclean linecount program <nl> <nl> all : $ ( NAME ) <nl> <nl> linecount : clean <nl> <nl> test : $ ( OBJS ) $ ( GTEST_OBJ ) $ ( TEST_BINS ) <nl> <nl> + program : $ ( OBJS ) $ ( PROGRAM_BINS ) <nl> + <nl> runtest : test <nl> for testbin in $ ( TEST_BINS ) ; do $ $ testbin ; done <nl> <nl> $ ( TEST_BINS ) : % . testbin : % . o <nl> $ ( CXX ) $ < $ ( OBJS ) $ ( GTEST_OBJ ) - o $ @ $ ( LDFLAGS ) $ ( WARNINGS ) <nl> <nl> + $ ( PROGRAM_BINS ) : % . bin : % . o <nl> + $ ( CXX ) $ < $ ( OBJS ) - o $ @ $ ( LDFLAGS ) $ ( WARNINGS ) <nl> + <nl> $ ( NAME ) : $ ( PROTO_GEN_CC ) $ ( OBJS ) <nl> $ ( LINK ) - shared $ ( OBJS ) - o $ ( NAME ) <nl> <nl> mmm a / src / caffe / layer . hpp <nl> ppp b / src / caffe / layer . hpp <nl> class Layer { <nl> / / If no gpu code is provided , we will simply use cpu code . <nl> virtual void Forward_gpu ( const vector < Blob < Dtype > * > & bottom , <nl> vector < Blob < Dtype > * > * top ) { <nl> - LOG ( WARNING ) < < " Using CPU code as backup . " ; <nl> + / / LOG ( WARNING ) < < " Using CPU code as backup . " ; <nl> Forward_cpu ( bottom , top ) ; <nl> } ; <nl> <nl> class Layer { <nl> virtual Dtype Backward_gpu ( const vector < Blob < Dtype > * > & top , <nl> const bool propagate_down , <nl> vector < Blob < Dtype > * > * bottom ) { <nl> - LOG ( WARNING ) < < " Using CPU code as backup . " ; <nl> + / / LOG ( WARNING ) < < " Using CPU code as backup . " ; <nl> return Backward_cpu ( top , propagate_down , bottom ) ; <nl> } ; <nl> <nl> mmm a / src / caffe / layers / loss_layer . cu <nl> ppp b / src / caffe / layers / loss_layer . cu <nl> void AccuracyLayer < Dtype > : : Forward_cpu ( const vector < Blob < Dtype > * > & bottom , <nl> } <nl> } <nl> accuracy / = num ; <nl> - LOG ( INFO ) < < " Accuracy : " < < accuracy ; <nl> + / / LOG ( INFO ) < < " Accuracy : " < < accuracy ; <nl> ( * top ) [ 0 ] - > mutable_cpu_data ( ) [ 0 ] = accuracy ; <nl> } <nl> <nl> mmm a / src / caffe / util / math_functions . cpp <nl> ppp b / src / caffe / util / math_functions . cpp <nl> double caffe_cpu_dot < double > ( const int n , const double * x , const double * y ) { <nl> return cblas_ddot ( n , x , 1 , y , 1 ) ; <nl> } <nl> <nl> + template < > <nl> + void caffe_gpu_dot < float > ( const int n , const float * x , const float * y , <nl> + float * out ) { <nl> + CUBLAS_CHECK ( cublasSdot ( Caffe : : cublas_handle ( ) , n , x , 1 , y , 1 , out ) ) ; <nl> + } <nl> + <nl> + template < > <nl> + void caffe_gpu_dot < double > ( const int n , const double * x , const double * y , <nl> + double * out ) { <nl> + CUBLAS_CHECK ( cublasDdot ( Caffe : : cublas_handle ( ) , n , x , 1 , y , 1 , out ) ) ; <nl> + } <nl> + <nl> } / / namespace caffe <nl> new file mode 100644 <nl> index 00000000000 . . e9305810e81 <nl> mmm / dev / null <nl> ppp b / src / caffe / util / math_functions . cu <nl> <nl> + / / Copyright 2013 Yangqing Jia <nl> + <nl> + # include < cmath > <nl> + # include < cstdlib > <nl> + # include < cstring > <nl> + <nl> + # include " caffe / common . hpp " <nl> + # include " caffe / util / math_functions . hpp " <nl> + <nl> + namespace caffe { <nl> + <nl> + template < typename Dtype > <nl> + __global__ void mul_kernel ( const int n , const Dtype * a , <nl> + const Dtype * b , Dtype * y ) { <nl> + int index = threadIdx . x + blockIdx . x * blockDim . x ; <nl> + if ( index < n ) { <nl> + y [ index ] = a [ index ] * b [ index ] ; <nl> + } <nl> + } <nl> + <nl> + template < > <nl> + void caffe_gpu_mul < float > ( const int N , const float * a , <nl> + const float * b , float * y ) { <nl> + mul_kernel < float > < < < CAFFE_GET_BLOCKS ( N ) , CAFFE_CUDA_NUM_THREADS > > > ( <nl> + N , a , b , y ) ; <nl> + } <nl> + <nl> + template < > <nl> + void caffe_gpu_mul < double > ( const int N , const double * a , <nl> + const double * b , double * y ) { <nl> + mul_kernel < double > < < < CAFFE_GET_BLOCKS ( N ) , CAFFE_CUDA_NUM_THREADS > > > ( <nl> + N , a , b , y ) ; <nl> + } <nl> + <nl> + <nl> + } / / namespace caffe <nl> mmm a / src / caffe / util / math_functions . hpp <nl> ppp b / src / caffe / util / math_functions . hpp <nl> void caffe_sub ( const int N , const Dtype * a , const Dtype * b , Dtype * y ) ; <nl> template < typename Dtype > <nl> void caffe_mul ( const int N , const Dtype * a , const Dtype * b , Dtype * y ) ; <nl> <nl> + template < typename Dtype > <nl> + void caffe_gpu_mul ( const int N , const Dtype * a , const Dtype * b , Dtype * y ) ; <nl> + <nl> template < typename Dtype > <nl> void caffe_div ( const int N , const Dtype * a , const Dtype * b , Dtype * y ) ; <nl> <nl> void caffe_exp ( const int n , const Dtype * a , Dtype * y ) ; <nl> template < typename Dtype > <nl> Dtype caffe_cpu_dot ( const int n , const Dtype * x , const Dtype * y ) ; <nl> <nl> + template < typename Dtype > <nl> + void caffe_gpu_dot ( const int n , const Dtype * x , const Dtype * y , Dtype * out ) ; <nl> + <nl> } / / namespace caffe <nl> <nl> <nl> deleted file mode 100644 <nl> index e69de29bb2d . . 00000000000 <nl> new file mode 100644 <nl> index 00000000000 . . 7c0937be91a <nl> mmm / dev / null <nl> ppp b / src / programs / demo_mnist . cpp <nl> <nl> + / / Copyright 2013 Yangqing Jia <nl> + <nl> + # include < cuda_runtime . h > <nl> + # include < fcntl . h > <nl> + # include < google / protobuf / text_format . h > <nl> + <nl> + # include < cstring > <nl> + <nl> + # include " caffe / blob . hpp " <nl> + # include " caffe / common . hpp " <nl> + # include " caffe / net . hpp " <nl> + # include " caffe / filler . hpp " <nl> + # include " caffe / proto / caffe . pb . h " <nl> + # include " caffe / util / io . hpp " <nl> + # include " caffe / optimization / solver . hpp " <nl> + <nl> + using namespace caffe ; <nl> + <nl> + int main ( int argc , char * * argv ) { <nl> + cudaSetDevice ( 1 ) ; <nl> + Caffe : : set_mode ( Caffe : : GPU ) ; <nl> + <nl> + NetParameter net_param ; <nl> + ReadProtoFromTextFile ( " caffe / test / data / lenet . prototxt " , <nl> + & net_param ) ; <nl> + vector < Blob < float > * > bottom_vec ; <nl> + Net < float > caffe_net ( net_param , bottom_vec ) ; <nl> + <nl> + / / Run the network without training . <nl> + LOG ( ERROR ) < < " Performing Forward " ; <nl> + caffe_net . Forward ( bottom_vec ) ; <nl> + LOG ( ERROR ) < < " Performing Backward " ; <nl> + LOG ( ERROR ) < < " Initial loss : " < < caffe_net . Backward ( ) ; <nl> + <nl> + SolverParameter solver_param ; <nl> + solver_param . set_base_lr ( 0 . 01 ) ; <nl> + solver_param . set_display ( 0 ) ; <nl> + solver_param . set_max_iter ( 6000 ) ; <nl> + solver_param . set_lr_policy ( " inv " ) ; <nl> + solver_param . set_gamma ( 0 . 0001 ) ; <nl> + solver_param . set_power ( 0 . 75 ) ; <nl> + solver_param . set_momentum ( 0 . 9 ) ; <nl> + <nl> + LOG ( ERROR ) < < " Starting Optimization " ; <nl> + SGDSolver < float > solver ( solver_param ) ; <nl> + solver . Solve ( & caffe_net ) ; <nl> + LOG ( ERROR ) < < " Optimization Done . " ; <nl> + <nl> + / / Run the network after training . <nl> + LOG ( ERROR ) < < " Performing Forward " ; <nl> + caffe_net . Forward ( bottom_vec ) ; <nl> + LOG ( ERROR ) < < " Performing Backward " ; <nl> + float loss = caffe_net . Backward ( ) ; <nl> + LOG ( ERROR ) < < " Final loss : " < < loss ; <nl> + <nl> + NetParameter trained_net_param ; <nl> + caffe_net . ToProto ( & trained_net_param ) ; <nl> + <nl> + NetParameter traintest_net_param ; <nl> + ReadProtoFromTextFile ( " caffe / test / data / lenet_traintest . prototxt " , <nl> + & traintest_net_param ) ; <nl> + Net < float > caffe_traintest_net ( traintest_net_param , bottom_vec ) ; <nl> + caffe_traintest_net . CopyTrainedLayersFrom ( trained_net_param ) ; <nl> + <nl> + / / Test run <nl> + double train_accuracy = 0 ; <nl> + int batch_size = traintest_net_param . layers ( 0 ) . layer ( ) . batchsize ( ) ; <nl> + for ( int i = 0 ; i < 60000 / batch_size ; + + i ) { <nl> + const vector < Blob < float > * > & result = <nl> + caffe_traintest_net . Forward ( bottom_vec ) ; <nl> + train_accuracy + = result [ 0 ] - > cpu_data ( ) [ 0 ] ; <nl> + } <nl> + train_accuracy / = 60000 / batch_size ; <nl> + LOG ( ERROR ) < < " Train accuracy : " < < train_accuracy ; <nl> + <nl> + NetParameter test_net_param ; <nl> + ReadProtoFromTextFile ( " caffe / test / data / lenet_test . prototxt " , & test_net_param ) ; <nl> + Net < float > caffe_test_net ( test_net_param , bottom_vec ) ; <nl> + caffe_test_net . CopyTrainedLayersFrom ( trained_net_param ) ; <nl> + <nl> + / / Test run <nl> + double test_accuracy = 0 ; <nl> + batch_size = test_net_param . layers ( 0 ) . layer ( ) . batchsize ( ) ; <nl> + for ( int i = 0 ; i < 10000 / batch_size ; + + i ) { <nl> + const vector < Blob < float > * > & result = <nl> + caffe_test_net . Forward ( bottom_vec ) ; <nl> + test_accuracy + = result [ 0 ] - > cpu_data ( ) [ 0 ] ; <nl> + } <nl> + test_accuracy / = 10000 / batch_size ; <nl> + LOG ( ERROR ) < < " Test accuracy : " < < test_accuracy ; <nl> + <nl> + return 0 ; <nl> + } <nl>
misc update . . .
BVLC/caffe
fb28244f8808b43b7b90b4d6015623000fa7ea35
2013-10-01T21:00:18Z
new file mode 100644 <nl> index 000000000000 . . 57ea82137135 <nl> mmm / dev / null <nl> ppp b / validation - test / compiler_crashers / 28532 - unreachable - executed - at - swift - lib - ast - type - cpp - 174 . swift <nl> <nl> + / / This source file is part of the Swift . org open source project <nl> + / / Copyright ( c ) 2014 - 2016 Apple Inc . and the Swift project authors <nl> + / / Licensed under Apache License v2 . 0 with Runtime Library Exception <nl> + / / <nl> + / / See http : / / swift . org / LICENSE . txt for license information <nl> + / / See http : / / swift . org / CONTRIBUTORS . txt for the list of Swift project authors <nl> + <nl> + / / RUN : not - - crash % target - swift - frontend % s - emit - ir <nl> + func t < T { weak var l : T <nl>
[ swiftc ( 141 vs . 5199 ) ] Add crasher in swift : : CanType : : isReferenceTypeImpl
apple/swift
8ce006cc8c687ff9a134cf12a25455b93d2bac11
2016-11-19T22:04:52Z
mmm a / doc / tools / makerst . py <nl> ppp b / doc / tools / makerst . py <nl> def make_rst_class ( node ) : <nl> s + = ' = * * ' + c . attrib [ ' value ' ] + ' * * ' <nl> if c . text . strip ( ) ! = ' ' : <nl> s + = ' mmm ' + rstize_text ( c . text . strip ( ) , name ) <nl> - f . write ( s + ' \ n ' ) <nl> - f . write ( ' \ n ' ) <nl> + f . write ( s + ' \ n \ n ' ) <nl> <nl> # Constants <nl> if len ( consts ) > 0 : <nl> def make_rst_class ( node ) : <nl> s + = ' = * * ' + c . attrib [ ' value ' ] + ' * * ' <nl> if c . text . strip ( ) ! = ' ' : <nl> s + = ' mmm ' + rstize_text ( c . text . strip ( ) , name ) <nl> - f . write ( s + ' \ n ' ) <nl> - f . write ( ' \ n ' ) <nl> + f . write ( s + ' \ n \ n ' ) <nl> <nl> # Class description <nl> descr = node . find ( ' description ' ) <nl>
Merge pull request from LikeLakers2 / docs - fix - enum - newlines
godotengine/godot
2da6d510bc3a84f4c6ed446c4fa4bfce29e31d25
2018-10-02T22:09:54Z
mmm a / validation - test / Evolution / Inputs / keypaths . swift . gyb <nl> ppp b / validation - test / Evolution / Inputs / keypaths . swift . gyb <nl> public enum AnEnum { <nl> } <nl> } <nl> <nl> - % for ( name , kind , before , after ) in testCases : <nl> + % for ( name , kind , before , after , addsAPI ) in testCases : <nl> <nl> % if kind = = " mutating " or kind = = " nonmutating " : <nl> <nl> public struct AStruct { <nl> <nl> public var sink : Int = 0 <nl> <nl> - % for ( name , kind , before , after ) in testCases : <nl> + % for ( name , kind , before , after , addsAPI ) in testCases : <nl> <nl> % if kind = = " mutating " or kind = = " nonmutating " or kind = = " stored " : <nl> <nl> public class AClass { <nl> <nl> public var sink : Int = 0 <nl> <nl> - % for ( name , kind , before , after ) in testCases : <nl> + % for ( name , kind , before , after , addsAPI ) in testCases : <nl> <nl> % if kind = = " nonmutating " or kind = = " stored " : <nl> <nl> public class AClass { <nl> <nl> } <nl> <nl> + public final class AFinalClass { <nl> + <nl> + public var sink : Int = 0 <nl> + <nl> + % for ( name , kind , before , after , addsAPI ) in testCases : <nl> + <nl> + % if kind = = " nonmutating " or kind = = " stored " : <nl> + <nl> + # if BEFORE <nl> + $ { before . format ( name = name , nonmutating = " " ) } <nl> + # else <nl> + $ { after . format ( name = name , nonmutating = " " ) } <nl> + # endif <nl> + <nl> + public static var keyPath_ $ { name } : PartialKeyPath < AFinalClass > { return \ AFinalClass . $ { name } } <nl> + <nl> + % elif kind = = " mutating " : <nl> + <nl> + % else : <nl> + % { raise ValueError ( " improper test case kind " ) } % <nl> + % end <nl> + <nl> + % end <nl> + <nl> + } <nl> + <nl> mmm a / validation - test / Evolution / Inputs / keypaths_gyb . py <nl> ppp b / validation - test / Evolution / Inputs / keypaths_gyb . py <nl> <nl> # - property kind , one of : <nl> # - stored ( only makes sense in structs or classes ) <nl> # - mutating ( only makes sense in structs or enums ) <nl> - # - struct ( only makes sense in structs ) <nl> # - nonmutating ( makes sense in classes , structs , and enums ) <nl> # - " before " definition <nl> # - " after " definition <nl> + # - whether the " after " definition adds API <nl> # <nl> # The definition strings are formatted with the following substitutions : <nl> # - { name } : property name <nl> # - { nonmutating } : nonmutating modifier spelling , if needed for context <nl> + <nl> + AddsAPI = True <nl> + DoesntAddAPI = False <nl> + <nl> testCases = [ <nl> ( <nl> " addsPrivateSetter " , <nl> <nl> mutating set { { self . sink = newValue } } <nl> } } <nl> " " " , <nl> + DoesntAddAPI , <nl> ) , <nl> ( <nl> " addsPublicSetter " , <nl> <nl> mutating set { { self . sink = newValue } } <nl> } } <nl> " " " , <nl> + AddsAPI , <nl> ) , <nl> ( <nl> " makesPrivateSetterPublic " , <nl> <nl> mutating set { { self . sink = newValue } } <nl> } } <nl> " " " , <nl> + AddsAPI , <nl> ) , <nl> ( <nl> " dropsPrivateSetter " , <nl> <nl> public var { name } : Int { { <nl> get { { return 0 } } <nl> } } <nl> - " " " <nl> + " " " , <nl> + DoesntAddAPI , <nl> ) , <nl> ( <nl> " makesPrivateSetterNonmutating " , <nl> <nl> get { { return 0 } } <nl> { nonmutating } set { { globalSink = newValue } } <nl> } } <nl> - " " " <nl> + " " " , <nl> + DoesntAddAPI , <nl> ) , <nl> ( <nl> " makesPrivateSetterMutating " , <nl> <nl> get { { return 0 } } <nl> set { { self . sink = newValue } } <nl> } } <nl> - " " " <nl> + " " " , <nl> + DoesntAddAPI , <nl> ) , <nl> ( <nl> " addsPrivateNonmutatingSetter " , <nl> <nl> get { { return 0 } } <nl> { nonmutating } set { { globalSink = newValue } } <nl> } } <nl> - " " " <nl> + " " " , <nl> + DoesntAddAPI , <nl> ) , <nl> ( <nl> " addsPublicNonmutatingSetter " , <nl> <nl> get { { return 0 } } <nl> { nonmutating } set { { globalSink = newValue } } <nl> } } <nl> - " " " <nl> + " " " , <nl> + AddsAPI , <nl> ) , <nl> ( <nl> " makesPrivateNonmutatingSetterPublic " , <nl> <nl> get { { return 0 } } <nl> { nonmutating } set { { globalSink = newValue } } <nl> } } <nl> - " " " <nl> + " " " , <nl> + AddsAPI , <nl> ) , <nl> ( <nl> " makesPrivateNonmutatingSetterPublicMutating " , <nl> <nl> get { { return 0 } } <nl> set { { self . sink = newValue } } <nl> } } <nl> - " " " <nl> + " " " , <nl> + AddsAPI , <nl> ) , <nl> ( <nl> " makesPrivateMutatingSetterPublicNonmutating " , <nl> <nl> get { { return 0 } } <nl> { nonmutating } set { { globalSink = newValue } } <nl> } } <nl> - " " " <nl> + " " " , <nl> + AddsAPI , <nl> ) , <nl> ( <nl> " storedToComputed " , <nl> <nl> get { { return 0 } } <nl> set { { self . sink = newValue } } <nl> } } <nl> - " " " <nl> + " " " , <nl> + DoesntAddAPI , <nl> ) , <nl> ( <nl> " computedToStored " , <nl> <nl> " " " , <nl> " " " <nl> public var { name } : Int = 0 <nl> - " " " <nl> + " " " , <nl> + DoesntAddAPI , <nl> ) , <nl> ( <nl> " storedToComputedPrivateSet " , <nl> <nl> get { { return 0 } } <nl> set { { self . sink = newValue } } <nl> } } <nl> - " " " <nl> + " " " , <nl> + DoesntAddAPI , <nl> ) , <nl> ( <nl> " storedToComputedDroppingPrivateSet " , <nl> <nl> public var { name } : Int { { <nl> get { { return 0 } } <nl> } } <nl> - " " " <nl> + " " " , <nl> + DoesntAddAPI , <nl> ) , <nl> ( <nl> " getOnlyComputedToSettableStored " , <nl> <nl> " " " , <nl> " " " <nl> public var { name } : Int = 0 <nl> - " " " <nl> + " " " , <nl> + AddsAPI , <nl> ) , <nl> ( <nl> " getOnlyComputedToPrivateSettableStored " , <nl> <nl> " " " , <nl> " " " <nl> public private ( set ) var { name } : Int = 0 <nl> - " " " <nl> + " " " , <nl> + DoesntAddAPI , <nl> ) , <nl> ( <nl> " storedMakesPrivateSetPublic " , <nl> <nl> " " " , <nl> " " " <nl> public var { name } : Int = 0 <nl> - " " " <nl> - ) , <nl> - ( <nl> - " computedGetOnlyToLet " , <nl> - " stored " , <nl> - " " " <nl> - public var { name } : Int { { <nl> - return 0 <nl> - } } <nl> - " " " , <nl> - " " " <nl> - public let { name } : Int = 0 <nl> - " " " <nl> - ) , <nl> - ( <nl> - " computedPrivateSetToLet " , <nl> - " stored " , <nl> - " " " <nl> - public private ( set ) var { name } : Int { { <nl> - get { { return 0 } } <nl> - set { { self . sink = newValue } } <nl> - } } <nl> " " " , <nl> - " " " <nl> - public let { name } : Int = 0 <nl> - " " " <nl> - ) , <nl> - ( <nl> - " computedPrivateNonmutatingSetToLet " , <nl> - " stored " , <nl> - " " " <nl> - public private ( set ) var { name } : Int { { <nl> - get { { return 0 } } <nl> - { nonmutating } set { { globalSink = newValue } } <nl> - } } <nl> - " " " , <nl> - " " " <nl> - public let { name } : Int = 0 <nl> - " " " <nl> - ) , <nl> - ( <nl> - " storedPrivateSetToLet " , <nl> - " stored " , <nl> - " " " <nl> - public private ( set ) var { name } : Int = 0 <nl> - " " " , <nl> - " " " <nl> - public let { name } : Int = 0 <nl> - " " " <nl> + AddsAPI , <nl> ) , <nl> + # TODO : Turning computed gets into lets without annotation drops method <nl> + # dispatch thunks and other ABI artifacts currently . <nl> + # TODO # ( <nl> + # TODO # " computedGetOnlyToLet " , <nl> + # TODO # " stored " , <nl> + # TODO # " " " <nl> + # TODO # public var { name } : Int { { <nl> + # TODO # return 0 <nl> + # TODO # } } <nl> + # TODO # " " " , <nl> + # TODO # " " " <nl> + # TODO # public let { name } : Int = 0 <nl> + # TODO # " " " , <nl> + # TODO # DoesntAddAPI , <nl> + # TODO # ) , <nl> + # TODO # ( <nl> + # TODO # " computedPrivateSetToLet " , <nl> + # TODO # " stored " , <nl> + # TODO # " " " <nl> + # TODO # public private ( set ) var { name } : Int { { <nl> + # TODO # get { { return 0 } } <nl> + # TODO # set { { self . sink = newValue } } <nl> + # TODO # } } <nl> + # TODO # " " " , <nl> + # TODO # " " " <nl> + # TODO # public let { name } : Int = 0 <nl> + # TODO # " " " , <nl> + # TODO # DoesntAddAPI , <nl> + # TODO # ) , <nl> + # TODO # ( <nl> + # TODO # " computedPrivateNonmutatingSetToLet " , <nl> + # TODO # " stored " , <nl> + # TODO # " " " <nl> + # TODO # public private ( set ) var { name } : Int { { <nl> + # TODO # get { { return 0 } } <nl> + # TODO # { nonmutating } set { { globalSink = newValue } } <nl> + # TODO # } } <nl> + # TODO # " " " , <nl> + # TODO # " " " <nl> + # TODO # public let { name } : Int = 0 <nl> + # TODO # " " " , <nl> + # TODO # DoesntAddAPI , <nl> + # TODO # ) , <nl> + # TODO # ( <nl> + # TODO # " storedPrivateSetToLet " , <nl> + # TODO # " stored " , <nl> + # TODO # " " " <nl> + # TODO # public private ( set ) var { name } : Int = 0 <nl> + # TODO # " " " , <nl> + # TODO # " " " <nl> + # TODO # public let { name } : Int = 0 <nl> + # TODO # " " " , <nl> + # TODO # DoesntAddAPI , <nl> + # TODO # ) , <nl> ] <nl> mmm a / validation - test / Evolution / test_keypaths . swift . gyb <nl> ppp b / validation - test / Evolution / test_keypaths . swift . gyb <nl> <nl> / / RUN : % empty - directory ( % t / rth ) <nl> / / RUN : env PYTHONPATH = % S / Inputs % gyb < % s > % t / test_keypaths . swift <nl> / / RUN : env PYTHONPATH = % S / Inputs % gyb < % S / Inputs / keypaths . swift . gyb > % t / Inputs / keypaths . swift <nl> - / / FIXME implement key path resilience <nl> - / / RUN : not % rth - - target - build - swift " % target - build - swift " - - target - run " % target - run " - - t " % t / rth " - - S " % t " - - s " % t / test_keypaths . swift " - - lib - prefix " lib " - - lib - suffix " . % target - dylib - extension " - - target - codesign " % target - codesign " <nl> + / / RUN : % rth - - target - build - swift " % target - build - swift " - - target - run " % target - run " - - t " % t / rth " - - S " % t " - - s " % t / test_keypaths . swift " - - lib - prefix " lib " - - lib - suffix " . % target - dylib - extension " - - target - codesign " % target - codesign " <nl> <nl> / / REQUIRES : executable_test <nl> <nl> from keypaths_gyb import testCases <nl> <nl> var tests = TestSuite ( " key path resilience " ) <nl> <nl> - % for ( name , kind , before , after ) in testCases : <nl> + % for ( name , kind , before , after , addsAPI ) in testCases : <nl> + <nl> + % if addsAPI : <nl> + # if BEFORE <nl> + % end <nl> <nl> % if kind = = " mutating " or kind = = " nonmutating " : <nl> <nl> tests . test ( " AnEnum . $ { name } " ) { <nl> % else : <nl> % { raise ValueError ( " improper test case kind " ) } % <nl> % end <nl> + <nl> + % if addsAPI : <nl> + # endif / / BEFORE <nl> + % end <nl> + <nl> % end <nl> <nl> - % for ( name , kind , before , after ) in testCases : <nl> + % for ( name , kind , before , after , addsAPI ) in testCases : <nl> + <nl> + % if addsAPI : <nl> + # if BEFORE <nl> + % end <nl> <nl> % if kind = = " mutating " or kind = = " nonmutating " or kind = = " stored " : <nl> <nl> tests . test ( " AStruct . $ { name } " ) { <nl> % else : <nl> % { raise ValueError ( " improper test case kind " ) } % <nl> % end <nl> + <nl> + % if addsAPI : <nl> + # endif / / BEFORE <nl> + % end <nl> + <nl> % end <nl> <nl> - % for ( name , kind , before , after ) in testCases : <nl> + % for ( name , kind , before , after , addsAPI ) in testCases : <nl> + <nl> + % if addsAPI : <nl> + # if BEFORE <nl> + % end <nl> <nl> % if kind = = " nonmutating " or kind = = " stored " : <nl> <nl> tests . test ( " AClass . $ { name } " ) { <nl> expectEqual ( fromModule , formedLocally ) <nl> } <nl> <nl> + tests . test ( " AFinalClass . $ { name } " ) { <nl> + let fromModule = AFinalClass . keyPath_ $ { name } <nl> + let formedLocally = \ AFinalClass . $ { name } <nl> + <nl> + expectEqual ( fromModule , formedLocally ) <nl> + } <nl> + <nl> % elif kind = = " mutating " : <nl> <nl> % else : <nl> % { raise ValueError ( " improper test case kind " ) } % <nl> % end <nl> + <nl> + % if addsAPI : <nl> + # endif <nl> + % end <nl> + <nl> % end <nl> <nl> runAllTests ( ) <nl>
Enable key path resilience test suite .
apple/swift
38e339db06a6a51db814544907f2642f3f136065
2018-07-30T17:09:40Z
mmm a / caffe2 / core / dispatch / DeviceId . h <nl> ppp b / caffe2 / core / dispatch / DeviceId . h <nl> enum class DeviceTypeId : uint8_t { <nl> UNDEFINED <nl> } ; <nl> <nl> - inline std : : ostream & operator < < ( std : : ostream & stream , DeviceTypeId device_type_id ) { <nl> - switch ( device_type_id ) { <nl> - case DeviceTypeId : : CPU : return stream < < " DeviceTypeId ( CPU ) " ; <nl> - case DeviceTypeId : : CUDA : return stream < < " DeviceTypeId ( CUDA ) " ; <nl> - case DeviceTypeId : : UNDEFINED : return stream < < " DeviceTypeId ( UNDEFINED ) " ; <nl> - } <nl> - throw std : : logic_error ( " Unknown DeviceTypeId : " + guts : : to_string ( static_cast < int > ( device_type_id ) ) ) ; <nl> } <nl> <nl> + inline std : : ostream & operator < < ( std : : ostream & stream , c10 : : DeviceTypeId device_type_id ) { <nl> + switch ( device_type_id ) { <nl> + case c10 : : DeviceTypeId : : CPU : return stream < < " DeviceTypeId ( CPU ) " ; <nl> + case c10 : : DeviceTypeId : : CUDA : return stream < < " DeviceTypeId ( CUDA ) " ; <nl> + case c10 : : DeviceTypeId : : UNDEFINED : return stream < < " DeviceTypeId ( UNDEFINED ) " ; <nl> + } <nl> + throw std : : logic_error ( " Unknown DeviceTypeId : " + c10 : : guts : : to_string ( static_cast < int > ( device_type_id ) ) ) ; <nl> } <nl> <nl> namespace std { <nl> mmm a / caffe2 / core / dispatch / DispatchKey . h <nl> ppp b / caffe2 / core / dispatch / DispatchKey . h <nl> struct TensorParameterDispatchKey final { <nl> inline constexpr bool operator = = ( const TensorParameterDispatchKey & lhs , const TensorParameterDispatchKey & rhs ) { <nl> return lhs . deviceTypeId = = rhs . deviceTypeId & & lhs . layoutId = = rhs . layoutId & & lhs . dataType = = rhs . dataType ; <nl> } <nl> - inline std : : ostream & operator < < ( std : : ostream & stream , const TensorParameterDispatchKey & key ) { <nl> - return stream < < " TensorKey ( " < < key . deviceTypeId < < " , " < < key . layoutId . value ( ) < < " , " < < key . dataType < < " ) " ; <nl> - } <nl> } / / namespace details <nl> } / / namespace c10 <nl> <nl> + inline std : : ostream & operator < < ( std : : ostream & stream , const c10 : : details : : TensorParameterDispatchKey & key ) { <nl> + return stream < < " TensorKey ( " < < key . deviceTypeId < < " , " < < key . layoutId . value ( ) < < " , " < < key . dataType < < " ) " ; <nl> + } <nl> + <nl> namespace std { <nl> template < > <nl> struct hash < c10 : : details : : TensorParameterDispatchKey > { <nl> inline constexpr bool operator = = ( const DispatchKey < num_dispatch_args > & lhs , cons <nl> / / TODO : Use AVX instructions to perform this equality test more quickly <nl> return lhs . argTypes = = rhs . argTypes ; <nl> } <nl> + <nl> + } / / namespace c10 <nl> + <nl> template < size_t num_dispatch_args > <nl> - inline std : : ostream & operator < < ( std : : ostream & stream , const DispatchKey < num_dispatch_args > & key ) { <nl> + inline std : : ostream & operator < < ( std : : ostream & stream , const c10 : : DispatchKey < num_dispatch_args > & key ) { <nl> stream < < " DispatchKey ( " ; <nl> if ( num_dispatch_args > 0 ) { <nl> stream < < " DispatchKey ( " < < key . argTypes [ 0 ] ; <nl> inline std : : ostream & operator < < ( std : : ostream & stream , const DispatchKey < num_disp <nl> return stream < < " ) " ; <nl> } <nl> <nl> - } / / namespace c10 <nl> - <nl> namespace std { <nl> template < size_t num_dispatch_args > <nl> struct hash < c10 : : DispatchKey < num_dispatch_args > > { <nl> mmm a / caffe2 / core / dispatch / TensorTypeId . cpp <nl> ppp b / caffe2 / core / dispatch / TensorTypeId . cpp <nl> <nl> # include " caffe2 / core / dispatch / TensorTypeId . h " <nl> <nl> - namespace c10 { <nl> - <nl> - std : : ostream & operator < < ( std : : ostream & str , TensorTypeId rhs ) { <nl> + std : : ostream & operator < < ( std : : ostream & str , c10 : : TensorTypeId rhs ) { <nl> return str < < rhs . underlyingId ( ) ; <nl> } <nl> - <nl> - } / / namespace c10 <nl> mmm a / caffe2 / core / dispatch / TensorTypeId . h <nl> ppp b / caffe2 / core / dispatch / TensorTypeId . h <nl> <nl> # include < mutex > <nl> # include < unordered_set > <nl> <nl> + namespace c10 { <nl> + class TensorTypeId ; <nl> + } <nl> + <nl> + std : : ostream & operator < < ( std : : ostream & , c10 : : TensorTypeId ) ; <nl> + <nl> namespace c10 { <nl> <nl> namespace details { <nl> class TensorTypeId final : public guts : : IdWrapper < TensorTypeId , details : : _tensor <nl> constexpr explicit TensorTypeId ( details : : _tensorTypeId_underlyingType id ) noexcept : IdWrapper ( id ) { } <nl> <nl> friend class TensorTypeIdCreator ; <nl> - friend std : : ostream & operator < < ( std : : ostream & , TensorTypeId ) ; <nl> + friend std : : ostream & : : operator < < ( std : : ostream & , TensorTypeId ) ; <nl> } ; <nl> <nl> } / / namespace c10 <nl> mmm a / caffe2 / core / typeid . h <nl> ppp b / caffe2 / core / typeid . h <nl> <nl> # include " caffe2 / core / common . h " <nl> # include " caffe2 / utils / IdWrapper . h " <nl> <nl> + namespace caffe2 { <nl> + class CaffeTypeId ; <nl> + } <nl> + <nl> + std : : ostream & operator < < ( std : : ostream & stream , caffe2 : : CaffeTypeId typeId ) ; <nl> + <nl> namespace caffe2 { <nl> <nl> / * * <nl> class CaffeTypeId final : public c10 : : guts : : IdWrapper < CaffeTypeId , uint16_t > { <nl> public : <nl> static CaffeTypeId createTypeId ( ) ; <nl> <nl> - friend std : : ostream & operator < < ( std : : ostream & stream , CaffeTypeId typeId ) { <nl> - return stream < < typeId . underlyingId ( ) ; <nl> - } <nl> + friend std : : ostream & : : operator < < ( std : : ostream & stream , CaffeTypeId typeId ) ; <nl> friend bool operator < ( CaffeTypeId lhs , CaffeTypeId rhs ) ; <nl> <nl> / / TODO Can we get rid of uninitialized ? <nl> inline bool operator < ( CaffeTypeId lhs , CaffeTypeId rhs ) { <nl> <nl> C10_DEFINE_HASH_FOR_IDWRAPPER ( caffe2 : : CaffeTypeId ) <nl> <nl> + inline std : : ostream & operator < < ( std : : ostream & stream , caffe2 : : CaffeTypeId typeId ) { <nl> + return stream < < typeId . underlyingId ( ) ; <nl> + } <nl> + <nl> namespace caffe2 { <nl> <nl> std : : unordered_map < CaffeTypeId , std : : string > & gTypeNames ( ) ; <nl>
Attempt to fix operator < < in Caffe2
pytorch/pytorch
6aa8b67ed0251f6ba4e1bd3b546c366c33ccee63
2018-06-27T21:54:45Z
mmm a / scripts / buildsystems / vcpkg . cmake <nl> ppp b / scripts / buildsystems / vcpkg . cmake <nl> if ( VCPKG_MANIFEST_MODE AND VCPKG_MANIFEST_INSTALL AND NOT _CMAKE_IN_TRY_COMPILE ) <nl> " - - x - manifest - root = $ { _VCPKG_MANIFEST_DIR } " <nl> " - - x - install - root = $ { _VCPKG_INSTALLED_DIR } " <nl> $ { _VCPKG_ADDITIONAL_MANIFEST_PARAMS } <nl> - RESULT_VARIABLE _VCPKG_INSTALL_RESULT ) <nl> + OUTPUT_FILE " $ { CMAKE_BINARY_DIR } / vcpkg - manifest - install - out . log " <nl> + ERROR_FILE " $ { CMAKE_BINARY_DIR } / vcpkg - manifest - install - err . log " <nl> + RESULT_VARIABLE _VCPKG_INSTALL_RESULT <nl> + ) <nl> <nl> if ( NOT _VCPKG_INSTALL_RESULT EQUAL 0 ) <nl> message ( FATAL_ERROR " Running vcpkg install - failed " ) <nl>
[ vcpkg / manifest ] write manifest install logs into the build dir . ( )
microsoft/vcpkg
c9027488970352953a59505234775b367d4cfd2a
2020-10-03T00:05:28Z
mmm a / tensorflow / contrib / distribute / python / mirrored_strategy . py <nl> ppp b / tensorflow / contrib / distribute / python / mirrored_strategy . py <nl> def _unwrap ( self , val ) : <nl> return [ val . get ( device = d ) for d in sorted ( val . devices ) ] <nl> return [ val ] <nl> <nl> + def value_container ( self , val ) : <nl> + return values . value_container ( val ) <nl> + <nl> @ property <nl> def is_single_tower ( self ) : <nl> return len ( self . _devices ) = = 1 <nl> mmm a / tensorflow / contrib / distribute / python / mirrored_strategy_multigpu_test . py <nl> ppp b / tensorflow / contrib / distribute / python / mirrored_strategy_multigpu_test . py <nl> <nl> from tensorflow . contrib . distribute . python import values <nl> from tensorflow . core . protobuf import config_pb2 <nl> from tensorflow . python . data . ops import dataset_ops <nl> + from tensorflow . python . eager import backprop <nl> from tensorflow . python . eager import context <nl> + from tensorflow . python . eager import function <nl> from tensorflow . python . eager import test <nl> from tensorflow . python . framework import constant_op <nl> from tensorflow . python . framework import dtypes <nl> <nl> from tensorflow . python . ops import rnn_cell_impl <nl> from tensorflow . python . ops import variable_scope <nl> from tensorflow . python . ops import variables <nl> + from tensorflow . python . training import device_util <nl> from tensorflow . python . training import distribute as distribute_lib <nl> <nl> <nl> class TowerLocalVariableAssignTest ( test . TestCase ) : <nl> <nl> def _skip_eager_if_gpus_less_than ( self , num_gpus ) : <nl> if context . num_gpus ( ) < num_gpus and context . executing_eagerly ( ) : <nl> - self . skipTest ( " Enough GPUs not available for this test in eager mode . " ) <nl> + self . skipTest ( " Not enough GPUs available for this test in eager mode . " ) <nl> <nl> @ test_util . run_in_graph_and_eager_modes ( config = config ) <nl> def testAssignTowerLocalVarSumAggregation ( self ) : <nl> def model_fn ( ) : <nl> self . assertEqual ( 6 . 0 , self . evaluate ( dist . read_var ( tower_local_var ) ) ) <nl> <nl> <nl> + class MockModel ( object ) : <nl> + <nl> + def __init__ ( self , two_variables = False ) : <nl> + self . variables = [ ] <nl> + self . variables . append ( variable_scope . variable ( 1 . 25 , name = " dummy_var1 " ) ) <nl> + if two_variables : <nl> + self . variables . append ( variable_scope . variable ( 2 . 0 , name = " dummy_var2 " ) ) <nl> + <nl> + def __call__ ( self , factor = 2 ) : <nl> + x = factor * self . variables [ 0 ] <nl> + if len ( self . variables ) > 1 : <nl> + x + = self . variables [ 1 ] <nl> + return x <nl> + <nl> + <nl> + class MirroredStrategyDefunTest ( test . TestCase ) : <nl> + <nl> + def _skip_eager_if_gpus_less_than ( self , num_gpus ) : <nl> + if context . num_gpus ( ) < num_gpus and context . executing_eagerly ( ) : <nl> + self . skipTest ( " Not enough GPUs available for this test in eager mode . " ) <nl> + <nl> + def _call_and_check ( self , model_fn , inputs , expected_result , defuns , <nl> + two_variables = False ) : <nl> + cpu_dev = device_util . canonicalize ( " CPU : 0 " ) <nl> + gpu_dev = device_util . canonicalize ( " GPU : 0 " ) <nl> + devices = [ cpu_dev , gpu_dev ] <nl> + dist = mirrored_strategy . MirroredStrategy ( devices ) <nl> + <nl> + with dist . scope ( ) : <nl> + mock_model = MockModel ( two_variables ) <nl> + self . evaluate ( variables . global_variables_initializer ( ) ) <nl> + <nl> + result = dist . call_for_each_tower ( model_fn , mock_model , * inputs , <nl> + run_concurrently = False ) <nl> + for device in devices : <nl> + device_result = values . select_device ( device , result ) <nl> + device_expected_result = values . select_device ( device , expected_result ) <nl> + self . assertAllClose ( device_expected_result , <nl> + self . evaluate ( device_result ) ) <nl> + <nl> + for defun in defuns : <nl> + self . assertEqual ( set ( mock_model . variables ) , set ( defun . variables ) ) <nl> + <nl> + @ test_util . run_in_graph_and_eager_modes ( ) <nl> + def testVariableInDefun ( self ) : <nl> + self . _skip_eager_if_gpus_less_than ( 1 ) <nl> + <nl> + @ function . defun <nl> + def times_two ( mock_model ) : <nl> + return mock_model ( ) <nl> + <nl> + def model_fn ( mock_model ) : <nl> + return times_two ( mock_model ) <nl> + <nl> + self . _call_and_check ( model_fn , [ ] , 2 . 5 , [ times_two ] ) <nl> + <nl> + @ test_util . run_in_graph_and_eager_modes ( ) <nl> + def testVariableInNestedDefun ( self ) : <nl> + self . _skip_eager_if_gpus_less_than ( 1 ) <nl> + <nl> + @ function . defun <nl> + def times_two ( mock_model ) : <nl> + return mock_model ( ) <nl> + <nl> + @ function . defun <nl> + def two_x_plus_one ( mock_model ) : <nl> + return times_two ( mock_model ) + 1 <nl> + <nl> + def model_fn ( mock_model ) : <nl> + return two_x_plus_one ( mock_model ) <nl> + <nl> + self . _call_and_check ( model_fn , [ ] , 3 . 5 , [ times_two , two_x_plus_one ] ) <nl> + <nl> + @ test_util . run_in_graph_and_eager_modes ( ) <nl> + def testTwoVariablesInNestedDefun ( self ) : <nl> + self . _skip_eager_if_gpus_less_than ( 1 ) <nl> + <nl> + @ function . defun <nl> + def fn1 ( mock_model ) : <nl> + return mock_model ( ) <nl> + <nl> + @ function . defun <nl> + def fn2 ( mock_model ) : <nl> + return fn1 ( mock_model ) + 1 <nl> + <nl> + def model_fn ( mock_model ) : <nl> + return fn2 ( mock_model ) <nl> + <nl> + self . _call_and_check ( model_fn , [ ] , 5 . 5 , [ fn1 , fn2 ] , two_variables = True ) <nl> + <nl> + @ test_util . run_in_graph_and_eager_modes ( ) <nl> + def testGradientTapeOverNestedDefuns ( self ) : <nl> + self . _skip_eager_if_gpus_less_than ( 1 ) <nl> + <nl> + @ function . defun <nl> + def fn1 ( mock_model ) : <nl> + return mock_model ( ) <nl> + <nl> + @ function . defun <nl> + def fn2 ( mock_model ) : <nl> + return fn1 ( mock_model ) + 1 <nl> + <nl> + def model_fn ( mock_model ) : <nl> + with backprop . GradientTape ( persistent = True ) as gtape : <nl> + result = fn2 ( mock_model ) <nl> + grads = gtape . gradient ( result , <nl> + [ v . get ( ) for v in mock_model . variables ] ) <nl> + return grads <nl> + <nl> + self . _call_and_check ( model_fn , [ ] , [ 2 . 0 , 1 . 0 ] , [ fn1 , fn2 ] , <nl> + two_variables = True ) <nl> + <nl> + @ test_util . run_in_graph_and_eager_modes ( ) <nl> + def testPassPerDevice ( self ) : <nl> + self . _skip_eager_if_gpus_less_than ( 1 ) <nl> + <nl> + @ function . defun <nl> + def fn1 ( mock_model , factor ) : <nl> + return mock_model ( factor ) <nl> + <nl> + factors = values . PerDevice ( { " CPU : 0 " : 5 . 0 , " GPU : 0 " : 3 . 0 } ) <nl> + expected_result = values . PerDevice ( { " CPU : 0 " : 5 . 0 * 1 . 25 , <nl> + " GPU : 0 " : 3 . 0 * 1 . 25 } ) <nl> + self . _call_and_check ( fn1 , [ factors ] , expected_result , [ fn1 ] ) <nl> + <nl> + <nl> if __name__ = = " __main__ " : <nl> test . main ( ) <nl> mmm a / tensorflow / contrib / distribute / python / one_device_strategy . py <nl> ppp b / tensorflow / contrib / distribute / python / one_device_strategy . py <nl> def read_var ( self , tower_local_var ) : <nl> def _unwrap ( self , value ) : <nl> return [ value ] <nl> <nl> + def value_container ( self , value ) : <nl> + return value <nl> + <nl> @ property <nl> def is_single_tower ( self ) : <nl> return True <nl> mmm a / tensorflow / contrib / distribute / python / parameter_server_strategy . py <nl> ppp b / tensorflow / contrib / distribute / python / parameter_server_strategy . py <nl> def _unwrap ( self , val ) : <nl> return [ val . get ( device = d ) for d in sorted ( val . devices ) ] <nl> return [ val ] <nl> <nl> + def value_container ( self , val ) : <nl> + return values . value_container ( val ) <nl> + <nl> def read_var ( self , var ) : <nl> # No need to distinguish between normal variables and tower - local variables . <nl> return array_ops . identity ( var ) <nl> mmm a / tensorflow / contrib / distribute / python / values . py <nl> ppp b / tensorflow / contrib / distribute / python / values . py <nl> def _verify_structure_shapes_types ( self , left , right ) : <nl> assert o . dtype = = i . dtype , ( <nl> " Dtype { } of left { } doesn ' t match dtype { } of right { } . " . <nl> format ( o . dtype , o , i . dtype , i ) ) <nl> + <nl> + <nl> + def value_container ( val ) : <nl> + " " " Returns the container that this per - device ` value ` belongs to . <nl> + <nl> + Args : <nl> + val : A value returned by ` call_for_each_tower ( ) ` or a variable <nl> + created in ` scope ( ) ` . <nl> + <nl> + Returns : <nl> + A container that ` value ` belongs to . <nl> + If value does not belong to any container ( including the case of <nl> + container having been destroyed ) , returns the value itself . <nl> + " " " <nl> + # pylint : disable = protected - access <nl> + if ( hasattr ( val , " _distributed_container " ) and <nl> + # DistributedVariable has _distributed_container defined <nl> + # but we don ' t want to return it . <nl> + not isinstance ( val , DistributedVariable ) ) : <nl> + container = val . _distributed_container ( ) <nl> + # pylint : disable = protected - access <nl> + if container is not None : <nl> + return container <nl> + return val <nl> mmm a / tensorflow / python / eager / function . py <nl> ppp b / tensorflow / python / eager / function . py <nl> <nl> from tensorflow . python . ops import functional_ops <nl> from tensorflow . python . ops import gradients_impl <nl> from tensorflow . python . ops import resource_variable_ops <nl> + from tensorflow . python . training import distribute <nl> from tensorflow . python . util import compat <nl> from tensorflow . python . util import nest <nl> from tensorflow . python . util import tf_decorator <nl> from tensorflow . python . util import tf_inspect <nl> <nl> <nl> + def create_substitute_placeholder ( value , name , dtype = None ) : <nl> + " " " Creates a placeholder for ` value ` and propagates shape info to it . " " " <nl> + # Note : setting ops . control_dependencies ( None ) ensures we always put <nl> + # capturing placeholders outside of any control flow context . <nl> + with ops . control_dependencies ( None ) : <nl> + placeholder = graph_placeholder ( <nl> + dtype = dtype or value . dtype , shape = value . shape , name = name ) <nl> + if placeholder . dtype = = dtypes_module . resource : <nl> + if isinstance ( value , ops . EagerTensor ) : <nl> + handle_data = value . _handle_data # pylint : disable = protected - access <nl> + else : <nl> + handle_data = resource_variable_ops . get_resource_handle_data ( value ) <nl> + if handle_data is not None and handle_data . is_set : <nl> + # pylint : disable = protected - access <nl> + pywrap_tensorflow . SetResourceHandleShapeAndType ( <nl> + placeholder . graph . _c_graph , placeholder . _as_tf_output ( ) , <nl> + handle_data . SerializeToString ( ) ) <nl> + # pylint : enable = protected - access <nl> + # Ensure that shapes and dtypes are propagated . <nl> + shapes , types = zip ( * [ ( pair . shape , pair . dtype ) <nl> + for pair in handle_data . shape_and_type ] ) <nl> + ranks = [ len ( s . dim ) if not s . unknown_rank else - 1 for s in shapes ] <nl> + shapes = [ [ d . size for d in s . dim ] <nl> + if not s . unknown_rank else None for s in shapes ] <nl> + pywrap_tensorflow . TF_GraphSetOutputHandleShapesAndTypes_wrapper ( <nl> + placeholder . _op . _graph . _c_graph , # pylint : disable = protected - access <nl> + placeholder . _as_tf_output ( ) , # pylint : disable = protected - access <nl> + shapes , ranks , types ) <nl> + <nl> + return placeholder <nl> + <nl> + <nl> def capture_value ( tensor_map , value , dtype , name ) : <nl> " " " Capture a value from outside the function , to pass in as an extra arg . " " " <nl> - captured_value = tensor_map . get ( ops . tensor_id ( value ) , None ) <nl> - if captured_value is None : <nl> - # Note : setting ops . control_dependencies ( None ) ensures we always put <nl> - # capturing placeholders outside of any control flow context . <nl> - with ops . control_dependencies ( None ) : <nl> - captured_value = graph_placeholder ( <nl> - dtype = dtype or value . dtype , shape = value . shape , name = name ) <nl> - if captured_value . dtype = = dtypes_module . resource : <nl> - if ops . _USE_C_SHAPES : # pylint : disable = protected - access <nl> - if isinstance ( value , ops . EagerTensor ) : <nl> - handle_data = value . _handle_data # pylint : disable = protected - access <nl> - else : <nl> - handle_data = resource_variable_ops . get_resource_handle_data ( value ) <nl> - else : <nl> - handle_data = value . _handle_data # pylint : disable = protected - access <nl> - if handle_data is not None and handle_data . is_set : <nl> - # pylint : disable = protected - access <nl> - if ops . _USE_C_SHAPES : <nl> - pywrap_tensorflow . SetResourceHandleShapeAndType ( <nl> - captured_value . graph . _c_graph , captured_value . _as_tf_output ( ) , <nl> - handle_data . SerializeToString ( ) ) <nl> - else : <nl> - captured_value . _handle_data = handle_data <nl> - # pylint : enable = protected - access <nl> - # Ensure that shapes and dtypes are propagated . <nl> - shapes , types = zip ( * [ ( pair . shape , pair . dtype ) <nl> - for pair in handle_data . shape_and_type ] ) <nl> - ranks = [ len ( s . dim ) if not s . unknown_rank else - 1 for s in shapes ] <nl> - shapes = [ [ d . size for d in s . dim ] <nl> - if not s . unknown_rank else None for s in shapes ] <nl> - pywrap_tensorflow . TF_GraphSetOutputHandleShapesAndTypes_wrapper ( <nl> - captured_value . _op . _graph . _c_graph , # pylint : disable = protected - access <nl> - captured_value . _as_tf_output ( ) , # pylint : disable = protected - access <nl> - shapes , ranks , types ) <nl> - <nl> + captured_tuple = tensor_map . get ( ops . tensor_id ( value ) , None ) <nl> + if captured_tuple is None : <nl> + captured_value = create_substitute_placeholder ( value , name = name , <nl> + dtype = dtype ) <nl> tensor_map [ ops . tensor_id ( value ) ] = ( value , captured_value ) <nl> else : <nl> - captured_value = captured_value [ 1 ] <nl> + captured_value = captured_tuple [ 1 ] <nl> tape . record_operation ( " captured_value " , [ captured_value ] , [ value ] , <nl> lambda x : [ x ] ) <nl> return captured_value <nl> def __init__ ( self , <nl> self . _output_shapes = output_shapes <nl> self . _variables = variables if variables is not None else [ ] <nl> <nl> + # Find the variables that are components of something distributed and <nl> + # put them into a { handle_tensor - > distributed variable object } map . <nl> + self . _distributed_variables = { } <nl> + strategy = distribute . get_distribution_strategy ( ) <nl> + for variable in self . _variables : <nl> + # If variable is not distributed , unwrap returns [ variable ] . <nl> + component_variables = strategy . unwrap ( variable ) <nl> + # Only add to the dictionary when the variable is actually distributed , <nl> + # i . e . more than one component or the component is different from the <nl> + # variable itself . component_variables cannot be empty . <nl> + if ( len ( component_variables ) > 1 or component_variables [ 0 ] ! = variable ) : <nl> + for component_variable in component_variables : <nl> + self . _distributed_variables [ component_variable . handle ] = variable <nl> + <nl> @ property <nl> def variables ( self ) : <nl> return self . _variables <nl> def _backprop_call ( self , args ) : <nl> ( Only records results on a tape if the function has outputs ) <nl> <nl> Args : <nl> - args : The tensor inputs to the function . <nl> + args : All inputs to the function , including resolved extra inputs <nl> Returns : <nl> The call output . <nl> " " " <nl> - all_args = args + self . _extra_inputs <nl> ctx = context . context ( ) <nl> - outputs = self . _forward_fdef . call ( ctx , all_args , self . _output_shapes ) <nl> + outputs = self . _forward_fdef . call ( ctx , args , self . _output_shapes ) <nl> if isinstance ( outputs , ops . Operation ) or outputs is None : <nl> return outputs <nl> <nl> def backward_function ( * args ) : <nl> tape . record_operation ( <nl> self . _forward_fdef . signature . name , <nl> real_outputs , <nl> - ( args + self . _extra_inputs ) , <nl> + args , <nl> backward_function ) <nl> <nl> return self . _build_call_outputs ( real_outputs ) <nl> def name ( self ) : <nl> " " " Returns the name of the function in Eager - compatible format . " " " <nl> return self . _function_def . name . encode ( " utf - 8 " ) <nl> <nl> + def _resolve_extra_inputs ( self ) : <nl> + " " " Resolve captured distributed variables to their current values . <nl> + <nl> + Some inputs can be distributed variables . Such variables yield a different <nl> + component ( i . e . actual tf . Variable ) variables depending on the context of <nl> + execution . <nl> + <nl> + Returns : <nl> + a list of resolved extra input tensors . <nl> + " " " <nl> + if self . _distributed_variables : <nl> + # Loop over each extra_inputs and check if it corresponds to something <nl> + # distributed . If so , get its _distributed_container and fetch the <nl> + # component appropriate for the current execution context . <nl> + resolved_extra_inputs = self . _extra_inputs [ : ] <nl> + for i , extra_input in enumerate ( self . _extra_inputs ) : <nl> + distributed_var = self . _distributed_variables . get ( extra_input , None ) <nl> + if distributed_var is not None : <nl> + # distributed variables override __getattr__ and substitute the <nl> + # right component variable . In here , ` distributed_var . handle ` <nl> + # actually does the equivalent of <nl> + # distributed_var . get_current_component_var ( ) . handle . <nl> + resolved_extra_inputs [ i ] = distributed_var . handle <nl> + return resolved_extra_inputs <nl> + <nl> + return self . _extra_inputs <nl> + <nl> def __call__ ( self , * args ) : <nl> " " " Executes the passed function in eager mode . " " " <nl> for v in self . _variables : <nl> if v . trainable : <nl> tape . watch_variable ( v ) <nl> <nl> + resolved_extra_inputs = self . _resolve_extra_inputs ( ) <nl> + <nl> tensor_inputs = [ x for x in nest . flatten ( args ) if isinstance ( x , ops . Tensor ) ] <nl> + args = tensor_inputs + resolved_extra_inputs <nl> if tape . should_record ( tensor_inputs ) or tape . should_record ( <nl> - self . _extra_inputs ) : <nl> + resolved_extra_inputs ) : <nl> if self . _backward_function is None : <nl> self . _construct_backprop_function ( ) <nl> - return self . _backprop_call ( tensor_inputs ) <nl> + return self . _backprop_call ( args ) <nl> <nl> ctx = context . context ( ) <nl> - args = tensor_inputs + self . _extra_inputs <nl> outputs = self . _function_def . call ( ctx , args , self . _output_shapes ) <nl> return self . _build_call_outputs ( outputs ) <nl> <nl> def check_mutation ( n1 , n2 ) : <nl> <nl> finally : <nl> tape . pop_tape ( this_tape ) <nl> - variables = this_tape . watched_variables ( ) <nl> + variables = list ( this_tape . watched_variables ( ) ) <nl> + <nl> + # Some variables captured by the tape can come from a DistributedValue . <nl> + # At call time , DistributedValue can return another variable ( e . g . if <nl> + # the function is run on a different device ) . Thus , instead of storing <nl> + # the specific captured variable , we replace it with its distributed <nl> + # container . <nl> + strategy = distribute . get_distribution_strategy ( ) <nl> + for i , variable in enumerate ( variables ) : <nl> + # If variable is not distributed value_container returns itself . <nl> + variables [ i ] = strategy . value_container ( variable ) <nl> <nl> # Returning a closed - over tensor as an output does not trigger a <nl> # call to convert_to_tensor , so we manually capture all such tensors . <nl> mmm a / tensorflow / python / training / distribute . py <nl> ppp b / tensorflow / python / training / distribute . py <nl> def unwrap ( self , value ) : <nl> A list of values contained in ` value ` . If ` value ` represents a single <nl> value , this returns ` [ value ] . ` <nl> " " " <nl> - _require_cross_tower_context ( self ) <nl> return self . _unwrap ( value ) <nl> <nl> + def value_container ( self , value ) : <nl> + " " " Returns the container that this per - device ` value ` belongs to . <nl> + <nl> + Args : <nl> + value : A value returned by ` call_for_each_tower ( ) ` or a variable <nl> + created in ` scope ( ) ` . <nl> + <nl> + Returns : <nl> + A container that ` value ` belongs to . <nl> + If value does not belong to any container ( including the case of <nl> + container having been destroyed ) , returns the value itself . <nl> + ` value in unwrap ( value_container ( value ) ) ` will always be true . <nl> + " " " <nl> + raise NotImplementedError ( " must be implemented in descendants " ) <nl> + <nl> def _unwrap ( self , distributed_value ) : <nl> raise NotImplementedError ( " must be implemented in descendants " ) <nl> <nl> def read_var ( self , tower_local_var ) : <nl> def _unwrap ( self , distributed_value ) : <nl> return [ distributed_value ] <nl> <nl> + def value_container ( self , value ) : <nl> + return value <nl> + <nl> @ property <nl> def is_single_tower ( self ) : <nl> return True <nl>
Resolve distributed variables captured by defun at call time
tensorflow/tensorflow
99f10ce2574995a5234409981fbf6df991dd3c7c
2018-08-07T01:01:04Z
deleted file mode 100644 <nl> index 9a0219ed434 . . 00000000000 <nl> mmm a / Examples / Image / Classification / GoogLeNet / BrainScript / InceptionBlocks . bs <nl> ppp / dev / null <nl> <nl> - # <nl> - # This file contains the basic build block of Inception Network as defined in : <nl> - # <nl> - # https : / / arxiv . org / pdf / 1512 . 00567 . pdf <nl> - # <nl> - # and in Tensorflow implementation <nl> - # <nl> - <nl> - # <nl> - # Convolution layer with Batch Normalization and Rectifier Linear activation . <nl> - # <nl> - ConvBNReLULayer { numOutputChannels , filterShape , stride , pad = true , bnTimeConst = 4096 } = Sequential ( <nl> - ConvolutionalLayer { numOutputChannels , filterShape , init = " glorotUniform " , stride = stride , pad = pad , bias = false } : <nl> - BatchNormalizationLayer { spatialRank = 2 , normalizationTimeConstant = bnTimeConst , useCntkEngine = false } : <nl> - ReLU <nl> - ) <nl> - <nl> - # <nl> - # Figure 5 from https : / / arxiv . org / pdf / 1512 . 00567 . pdf <nl> - # Modified with the added 5x5 branch to match Tensorflow implementation <nl> - # <nl> - InceptionBlock1 { numOutputChannels1x1 , numOutputChannels5x5 , numOutputChannels3x3_3x3 , numOutputChannelsPool , bnTimeConst } = <nl> - { <nl> - apply ( x ) = { <nl> - # 1x1 Convolution <nl> - branch1x1 = ConvBNReLULayer { numOutputChannels1x1 , ( 1 : 1 ) , ( 1 : 1 ) , pad = true , bnTimeConst = bnTimeConst } ( x ) <nl> - <nl> - # 5x5 Convolution <nl> - branch5x5 = Sequential ( <nl> - ConvBNReLULayer { numOutputChannels5x5 [ 0 ] , ( 1 : 1 ) , ( 1 : 1 ) , pad = true , bnTimeConst = bnTimeConst } : <nl> - ConvBNReLULayer { numOutputChannels5x5 [ 1 ] , ( 5 : 5 ) , ( 1 : 1 ) , pad = true , bnTimeConst = bnTimeConst } <nl> - ) ( x ) <nl> - <nl> - # 3x3 3x3 Convolution <nl> - branch3x3_3x3 = Sequential ( <nl> - ConvBNReLULayer { numOutputChannels3x3_3x3 [ 0 ] , ( 1 : 1 ) , ( 1 : 1 ) , pad = true , bnTimeConst = bnTimeConst } : <nl> - ConvBNReLULayer { numOutputChannels3x3_3x3 [ 1 ] , ( 3 : 3 ) , ( 1 : 1 ) , pad = true , bnTimeConst = bnTimeConst } : <nl> - ConvBNReLULayer { numOutputChannels3x3_3x3 [ 2 ] , ( 3 : 3 ) , ( 1 : 1 ) , pad = true , bnTimeConst = bnTimeConst } <nl> - ) ( x ) <nl> - <nl> - # Average pooling <nl> - branch_pool = Sequential ( <nl> - AveragePoolingLayer { ( 3 : 3 ) , stride = ( 1 : 1 ) , pad = true } : <nl> - ConvBNReLULayer { numOutputChannelsPool , ( 1 : 1 ) , ( 1 : 1 ) , pad = true , bnTimeConst = bnTimeConst } <nl> - ) ( x ) <nl> - <nl> - out = Splice ( ( branch1x1 : branch5x5 : branch3x3_3x3 : branch_pool ) , axis = 3 ) <nl> - } . out <nl> - } . apply <nl> - <nl> - InceptionBlock2 { numOutputChannels3x3 , numOutputChannels3x3_3x3 , bnTimeConst } = <nl> - { <nl> - apply ( x ) = { <nl> - # 3x3 Convolution <nl> - branch3x3 = ConvBNReLULayer { numOutputChannels3x3 , ( 3 : 3 ) , ( 2 : 2 ) , pad = false , bnTimeConst = bnTimeConst } ( x ) <nl> - <nl> - # 3x3 3x3 Convolution <nl> - branch3x3_3x3 = Sequential ( <nl> - ConvBNReLULayer { numOutputChannels3x3_3x3 [ 0 ] , ( 1 : 1 ) , ( 1 : 1 ) , pad = true , bnTimeConst = bnTimeConst } : <nl> - ConvBNReLULayer { numOutputChannels3x3_3x3 [ 1 ] , ( 3 : 3 ) , ( 1 : 1 ) , pad = true , bnTimeConst = bnTimeConst } : <nl> - ConvBNReLULayer { numOutputChannels3x3_3x3 [ 2 ] , ( 3 : 3 ) , ( 2 : 2 ) , pad = false , bnTimeConst = bnTimeConst } <nl> - ) ( x ) <nl> - <nl> - # Max pooling <nl> - branch_pool = MaxPoolingLayer { ( 3 : 3 ) , stride = ( 2 : 2 ) , pad = false } ( x ) <nl> - <nl> - out = Splice ( ( branch3x3 : branch3x3_3x3 : branch_pool ) , axis = 3 ) <nl> - } . out <nl> - } . apply <nl> - <nl> - # <nl> - # Figure 6 from https : / / arxiv . org / pdf / 1512 . 00567 . pdf <nl> - # <nl> - InceptionBlock3 { numOutputChannels1x1 , numOutputChannels7x7 , numOutputChannels7x7_7x7 , numOutputChannelsPool , bnTimeConst } = <nl> - { <nl> - apply ( x ) = { <nl> - # 1x1 Convolution <nl> - branch1x1 = ConvBNReLULayer { numOutputChannels1x1 , ( 1 : 1 ) , ( 1 : 1 ) , pad = true , bnTimeConst = bnTimeConst } ( x ) <nl> - <nl> - # 7x7 Convolution <nl> - branch7x7 = Sequential ( <nl> - ConvBNReLULayer { numOutputChannels7x7 [ 0 ] , ( 1 : 1 ) , ( 1 : 1 ) , pad = true , bnTimeConst = bnTimeConst } : <nl> - ConvBNReLULayer { numOutputChannels7x7 [ 1 ] , ( 1 : 7 ) , ( 1 : 1 ) , pad = true , bnTimeConst = bnTimeConst } : <nl> - ConvBNReLULayer { numOutputChannels7x7 [ 2 ] , ( 7 : 1 ) , ( 1 : 1 ) , pad = true , bnTimeConst = bnTimeConst } <nl> - ) ( x ) <nl> - <nl> - # 7x7 7x7 Convolution <nl> - branch7x7_7x7 = Sequential ( <nl> - ConvBNReLULayer { numOutputChannels7x7_7x7 [ 0 ] , ( 1 : 1 ) , ( 1 : 1 ) , pad = true , bnTimeConst = bnTimeConst } : <nl> - ConvBNReLULayer { numOutputChannels7x7_7x7 [ 1 ] , ( 7 : 1 ) , ( 1 : 1 ) , pad = true , bnTimeConst = bnTimeConst } : <nl> - ConvBNReLULayer { numOutputChannels7x7_7x7 [ 2 ] , ( 1 : 7 ) , ( 1 : 1 ) , pad = true , bnTimeConst = bnTimeConst } : <nl> - ConvBNReLULayer { numOutputChannels7x7_7x7 [ 3 ] , ( 7 : 1 ) , ( 1 : 1 ) , pad = true , bnTimeConst = bnTimeConst } : <nl> - ConvBNReLULayer { numOutputChannels7x7_7x7 [ 4 ] , ( 1 : 7 ) , ( 1 : 1 ) , pad = true , bnTimeConst = bnTimeConst } <nl> - ) ( x ) <nl> - <nl> - # Average pooling <nl> - branch_pool = Sequential ( <nl> - AveragePoolingLayer { ( 3 : 3 ) , stride = ( 1 : 1 ) , pad = true } : <nl> - ConvBNReLULayer { numOutputChannelsPool , ( 1 : 1 ) , ( 1 : 1 ) , pad = true , bnTimeConst = bnTimeConst } <nl> - ) ( x ) <nl> - <nl> - out = Splice ( ( branch1x1 : branch7x7 : branch7x7_7x7 : branch_pool ) , axis = 3 ) <nl> - } . out <nl> - } . apply <nl> - <nl> - InceptionBlock4 { numOutputChannels3x3 , numOutputChannels7x7x3 , bnTimeConst } = <nl> - { <nl> - apply ( x ) = { <nl> - # 3x3 Convolution <nl> - branch3x3 = Sequential ( <nl> - ConvBNReLULayer { numOutputChannels3x3 [ 0 ] , ( 1 : 1 ) , ( 1 : 1 ) , pad = true , bnTimeConst = bnTimeConst } : <nl> - ConvBNReLULayer { numOutputChannels3x3 [ 1 ] , ( 3 : 3 ) , ( 2 : 2 ) , pad = false , bnTimeConst = bnTimeConst } <nl> - ) ( x ) <nl> - <nl> - # 7x7x3 Convolution <nl> - branch7x7x3 = Sequential ( <nl> - ConvBNReLULayer { numOutputChannels7x7x3 [ 0 ] , ( 1 : 1 ) , ( 1 : 1 ) , pad = true , bnTimeConst = bnTimeConst } : <nl> - ConvBNReLULayer { numOutputChannels7x7x3 [ 1 ] , ( 1 : 7 ) , ( 1 : 1 ) , pad = true , bnTimeConst = bnTimeConst } : <nl> - ConvBNReLULayer { numOutputChannels7x7x3 [ 2 ] , ( 7 : 1 ) , ( 1 : 1 ) , pad = true , bnTimeConst = bnTimeConst } : <nl> - ConvBNReLULayer { numOutputChannels7x7x3 [ 3 ] , ( 3 : 3 ) , ( 2 : 2 ) , pad = false , bnTimeConst = bnTimeConst } <nl> - ) ( x ) <nl> - <nl> - # Max pooling <nl> - branch_pool = MaxPoolingLayer { ( 3 : 3 ) , stride = ( 2 : 2 ) , pad = false } ( x ) <nl> - <nl> - out = Splice ( ( branch3x3 : branch7x7x3 : branch_pool ) , axis = 3 ) <nl> - } . out <nl> - } . apply <nl> - <nl> - # <nl> - # Figure 7 from https : / / arxiv . org / pdf / 1512 . 00567 . pdf <nl> - # <nl> - InceptionBlock5 { numOutputChannels1x1 , numOutputChannels3x3 , numOutputChannels3x3_3x3 , numOutputChannelsPool , bnTimeConst } = <nl> - { <nl> - apply ( x ) = { <nl> - # 1x1 Convolution <nl> - branch1x1 = ConvBNReLULayer { numOutputChannels1x1 , ( 1 : 1 ) , ( 1 : 1 ) , pad = true , bnTimeConst = bnTimeConst } ( x ) <nl> - <nl> - # 3x3 Convolution <nl> - branch3x3_i = ConvBNReLULayer { numOutputChannels3x3 [ 0 ] , ( 1 : 1 ) , ( 1 : 1 ) , pad = true , bnTimeConst = bnTimeConst } ( x ) <nl> - branch3x3_1 = ConvBNReLULayer { numOutputChannels3x3 [ 1 ] , ( 1 : 3 ) , ( 1 : 1 ) , pad = true , bnTimeConst = bnTimeConst } ( branch3x3_i ) <nl> - branch3x3_2 = ConvBNReLULayer { numOutputChannels3x3 [ 2 ] , ( 3 : 1 ) , ( 1 : 1 ) , pad = true , bnTimeConst = bnTimeConst } ( branch3x3_i ) <nl> - branch3x3 = Splice ( ( branch3x3_1 : branch3x3_2 ) , axis = 3 ) <nl> - <nl> - # 3x3 3x3 Convolution <nl> - branch3x3_3x3_i = Sequential ( <nl> - ConvBNReLULayer { numOutputChannels3x3_3x3 [ 0 ] , ( 1 : 1 ) , ( 1 : 1 ) , pad = true , bnTimeConst = bnTimeConst } : <nl> - ConvBNReLULayer { numOutputChannels3x3_3x3 [ 1 ] , ( 3 : 3 ) , ( 1 : 1 ) , pad = true , bnTimeConst = bnTimeConst } <nl> - ) ( x ) <nl> - <nl> - branch3x3_3x3_1 = ConvBNReLULayer { numOutputChannels3x3_3x3 [ 2 ] , ( 1 : 3 ) , ( 1 : 1 ) , pad = true , bnTimeConst = bnTimeConst } ( branch3x3_3x3_i ) <nl> - branch3x3_3x3_2 = ConvBNReLULayer { numOutputChannels3x3_3x3 [ 3 ] , ( 3 : 1 ) , ( 1 : 1 ) , pad = true , bnTimeConst = bnTimeConst } ( branch3x3_3x3_i ) <nl> - branch3x3_3x3 = Splice ( ( branch3x3_3x3_1 : branch3x3_3x3_2 ) , axis = 3 ) <nl> - <nl> - # Average pooling <nl> - branch_pool = Sequential ( <nl> - AveragePoolingLayer { ( 3 : 3 ) , stride = ( 1 : 1 ) , pad = true } : <nl> - ConvBNReLULayer { numOutputChannelsPool , ( 1 : 1 ) , ( 1 : 1 ) , pad = true , bnTimeConst = bnTimeConst } <nl> - ) ( x ) <nl> - <nl> - out = Splice ( ( branch1x1 : branch3x3 : branch3x3_3x3 : branch_pool ) , axis = 3 ) <nl> - } . out <nl> - } . apply <nl> deleted file mode 100644 <nl> index 751150af153 . . 00000000000 <nl> mmm a / Examples / Image / Classification / GoogLeNet / BrainScript / InceptionV3 . bs <nl> ppp / dev / null <nl> <nl> - <nl> - # <nl> - # Inception V3 model from : <nl> - # <nl> - # https : / / arxiv . org / pdf / 1512 . 00567 . pdf <nl> - # <nl> - # and in Tensorflow implementation <nl> - # <nl> - InceptionV3 ( input , labelDim , bnTimeConst ) = <nl> - { <nl> - # 299 x 299 x 3 <nl> - conv_1 = ConvBNReLULayer { 32 , ( 3 : 3 ) , ( 2 : 2 ) , pad = false , bnTimeConst = bnTimeConst } ( input ) <nl> - # 149 x 149 x 32 <nl> - conv_2 = ConvBNReLULayer { 32 , ( 3 : 3 ) , ( 1 : 1 ) , pad = false , bnTimeConst = bnTimeConst } ( conv_1 ) <nl> - # 147 x 147 x 32 <nl> - conv_3 = ConvBNReLULayer { 64 , ( 3 : 3 ) , ( 1 : 1 ) , pad = true , bnTimeConst = bnTimeConst } ( conv_2 ) <nl> - # 147 x 147 x 64 <nl> - pool_1 = MaxPoolingLayer { ( 3 : 3 ) , stride = ( 2 : 2 ) , pad = false } ( conv_3 ) <nl> - # 73 x 73 x 64 <nl> - conv_4 = ConvBNReLULayer { 80 , ( 1 : 1 ) , ( 1 : 1 ) , pad = false , bnTimeConst = bnTimeConst } ( pool_1 ) <nl> - # 73 x 73 x 80 <nl> - conv_5 = ConvBNReLULayer { 192 , ( 3 : 3 ) , ( 1 : 1 ) , pad = false , bnTimeConst = bnTimeConst } ( conv_4 ) <nl> - # 71 x 71 x 192 <nl> - pool_2 = MaxPoolingLayer { ( 3 : 3 ) , stride = ( 2 : 2 ) , pad = false } ( conv_5 ) <nl> - # 35 x 35 x 192 <nl> - <nl> - # <nl> - # Inception Blocks <nl> - # <nl> - mixed_1 = InceptionBlock1 { 64 , ( 48 : 64 ) , ( 64 : 96 : 96 ) , 32 , bnTimeConst } ( pool_2 ) <nl> - # 35 x 35 x 256 <nl> - mixed_2 = InceptionBlock1 { 64 , ( 48 : 64 ) , ( 64 : 96 : 96 ) , 64 , bnTimeConst } ( mixed_1 ) <nl> - # 35 x 35 x 288 <nl> - mixed_3 = InceptionBlock1 { 64 , ( 48 : 64 ) , ( 64 : 96 : 96 ) , 64 , bnTimeConst } ( mixed_2 ) <nl> - # 35 x 35 x 288 <nl> - mixed_4 = InceptionBlock2 { 384 , ( 64 : 96 : 96 ) , bnTimeConst } ( mixed_3 ) <nl> - # 17 x 17 x 768 <nl> - mixed_5 = InceptionBlock3 { 192 , ( 128 : 128 : 192 ) , ( 128 : 128 : 128 : 128 : 192 ) , 192 , bnTimeConst } ( mixed_4 ) <nl> - # 17 x 17 x 768 <nl> - mixed_6 = InceptionBlock3 { 192 , ( 160 : 160 : 192 ) , ( 160 : 160 : 160 : 160 : 192 ) , 192 , bnTimeConst } ( mixed_5 ) <nl> - # 17 x 17 x 768 <nl> - mixed_7 = InceptionBlock3 { 192 , ( 160 : 160 : 192 ) , ( 160 : 160 : 160 : 160 : 192 ) , 192 , bnTimeConst } ( mixed_6 ) <nl> - # 17 x 17 x 768 <nl> - mixed_8 = InceptionBlock3 { 192 , ( 192 : 192 : 192 ) , ( 192 : 192 : 192 : 192 : 192 ) , 192 , bnTimeConst } ( mixed_7 ) <nl> - # 17 x 17 x 768 <nl> - mixed_9 = InceptionBlock4 { ( 192 : 320 ) , ( 192 : 192 : 192 : 192 ) , bnTimeConst } ( mixed_8 ) <nl> - # 17 x 17 x 1280 <nl> - mixed_10 = InceptionBlock5 { 320 , ( 384 : 384 : 384 ) , ( 448 : 384 : 384 : 384 ) , 192 , bnTimeConst } ( mixed_9 ) <nl> - # 8 x 8 x 2048 <nl> - mixed_11 = InceptionBlock5 { 320 , ( 384 : 384 : 384 ) , ( 448 : 384 : 384 : 384 ) , 192 , bnTimeConst } ( mixed_10 ) <nl> - # 8 x 8 x 2048 <nl> - <nl> - # <nl> - # Prediction <nl> - # <nl> - pool_3 = AveragePoolingLayer { ( 8 : 8 ) , pad = false } ( mixed_11 ) <nl> - # 1 x 1 x 2048 <nl> - drop = Dropout ( pool_3 ) <nl> - # 1 x 1 x 2048 <nl> - z = LinearLayer { labelDim } ( drop ) <nl> - <nl> - # <nl> - # Auxiliary <nl> - # <nl> - # 17 x 17 x 768 <nl> - aux_pool_1 = AveragePoolingLayer { ( 5 : 5 ) , stride = ( 3 : 3 ) , pad = false } ( mixed_8 ) <nl> - # 5 x 5 x 768 <nl> - aux_conv_1 = ConvBNReLULayer { 128 , ( 1 : 1 ) , ( 1 : 1 ) , pad = true , bnTimeConst = bnTimeConst } ( aux_pool_1 ) <nl> - # 5 x 5 x 128 <nl> - aux_conv_2 = ConvBNReLULayer { 768 , ( 5 : 5 ) , ( 1 : 1 ) , pad = false , bnTimeConst = bnTimeConst } ( aux_conv_1 ) <nl> - # 1 x 1 x 768 <nl> - aux = LinearLayer { labelDim } ( aux_conv_2 ) <nl> - } <nl> - <nl> - # <nl> - # Inception V3 model with normalized input , to use the below function <nl> - # remove " ImageNet1K_mean . xml " from each reader . <nl> - # <nl> - InceptionV3Norm ( input , labelDim , bnTimeConst ) = <nl> - { <nl> - # Normalize inputs to - 1 and 1 . <nl> - featMean = 128 <nl> - featScale = 1 / 128 <nl> - Normalize { m , f } = x = > f . * ( x - m ) <nl> - <nl> - inputNorm = Normalize { featMean , featScale } ( input ) <nl> - model = InceptionV3 ( inputNorm , labelDim , bnTimeConst ) <nl> - } . model <nl> deleted file mode 100644 <nl> index 5e31b5e719a . . 00000000000 <nl> mmm a / Examples / Image / Classification / GoogLeNet / BrainScript / InceptionV3 . cntk <nl> ppp / dev / null <nl> <nl> - # <nl> - # Inception V3 network <nl> - # Details are in https : / / arxiv . org / pdf / 1512 . 00567 . pdf <nl> - # <nl> - <nl> - command = Train : Eval <nl> - <nl> - deviceId = " Auto " <nl> - precision = " float " <nl> - # traceLevel = 1 <nl> - # perfTraceLevel = 1 <nl> - parallelTrain = true <nl> - <nl> - RootDir = " . " <nl> - ConfigDir = " $ RootDir $ " <nl> - ImageNetDir = " $ ConfigDir $ " <nl> - DataDir = " $ RootDir $ " <nl> - OutputDir = " $ RootDir $ / Output " <nl> - ModelDir = " $ OutputDir $ / Model " <nl> - stderr = " $ OutputDir $ / InceptionV3 . log " <nl> - modelPath = " $ ModelDir $ / InceptionV3 . model " <nl> - <nl> - ImageH = 299 <nl> - ImageW = 299 <nl> - ImageC = 3 <nl> - NumLabels = 1000 <nl> - <nl> - Train = { <nl> - action = " train " <nl> - <nl> - BrainScriptNetworkBuilder = { <nl> - include " $ ConfigDir $ / InceptionBlocks . bs " <nl> - include " $ ConfigDir $ / InceptionV3 . bs " <nl> - <nl> - imageShape = $ ImageH $ : $ ImageW $ : $ ImageC $ <nl> - labelDim = $ NumLabels $ <nl> - bnTimeConst = 4096 <nl> - auxWeight = Constant ( 0 . 3 ) <nl> - <nl> - # inputs <nl> - features = Input { imageShape } <nl> - labels = Input { labelDim } <nl> - <nl> - # apply model to features <nl> - model = InceptionV3Norm ( features , labelDim , bnTimeConst ) <nl> - z = model . z <nl> - aux = model . aux <nl> - <nl> - # connect to system <nl> - ceAux = CrossEntropyWithSoftmax ( labels , aux ) <nl> - ceZ = CrossEntropyWithSoftmax ( labels , z ) <nl> - errs = ClassificationError ( labels , z ) <nl> - top5Errs = ClassificationError ( labels , z , topN = 5 ) # only used in Eval action <nl> - ce = auxWeight . * ceAux + ceZ <nl> - <nl> - featureNodes = ( features ) <nl> - labelNodes = ( labels ) <nl> - criterionNodes = ( ce ) <nl> - evaluationNodes = ( errs ) # top5Errs only used in Eval <nl> - outputNodes = ( z ) <nl> - } <nl> - <nl> - SGD = { <nl> - epochSize = 0 <nl> - maxEpochs = 160 <nl> - minibatchSize = 512 # 16 GPUs , 32 per GPU . <nl> - dropoutRate = 0 . 2 <nl> - <nl> - learningRatesPerMB = 3 . 2 * 10 : 1 . 6 * 10 : 0 . 8 * 10 : 0 . 4 * 10 : 0 . 2 * 10 : 0 . 1 * 10 : 0 . 05 * 10 : 0 . 025 * 10 : 0 . 0125 * 10 : 0 . 00625 * 10 : 0 . 003125 * 10 : 0 . 0015625 * 10 : 0 . 00078125 * 10 : 0 . 000390625 * 10 : 0 . 0001953125 <nl> - momentumPerMB = 0 . 9 <nl> - <nl> - disableRegInBatchNormalization = true <nl> - <nl> - parallelTrain = { <nl> - parallelizationMethod = " dataParallelSGD " <nl> - parallelizationStartEpoch = 1 <nl> - distributedMBReading = true <nl> - dataParallelSGD = { <nl> - gradientBits = 32 <nl> - } <nl> - } <nl> - <nl> - firstMBsToShowResult = 10 ; numMBsToShowResult = 500 <nl> - } <nl> - <nl> - reader = { <nl> - verbosity = 0 ; randomize = true <nl> - deserializers = ( { <nl> - type = " ImageDeserializer " ; module = " ImageReader " <nl> - file = " $ DataDir $ / train_map . txt " <nl> - input = { <nl> - features = { transforms = ( <nl> - { type = " Crop " ; cropType = " randomArea " ; areaRatio = 0 . 08 : 1 . 0 ; jitterType = " uniRatio " ; aspectRatio = 0 . 75 : 1 . 0 } : <nl> - { type = " Color " ; brightnessRadius = 0 . 2 ; contrastRadius = 0 . 2 ; saturationRadius = 0 . 4 } : <nl> - { type = " Scale " ; width = $ ImageW $ ; height = $ ImageH $ ; channels = $ ImageC $ ; interpolations = " linear " } : <nl> - { type = " Transpose " } <nl> - ) } <nl> - labels = { labelDim = $ NumLabels $ } <nl> - } <nl> - } ) <nl> - } <nl> - <nl> - cvreader = { <nl> - verbosity = 0 ; randomize = false <nl> - deserializers = ( { <nl> - type = " ImageDeserializer " ; module = " ImageReader " <nl> - file = " $ DataDir $ / val_map . txt " <nl> - input = { <nl> - features = { transforms = ( <nl> - { type = " Scale " ; width = $ ImageW $ ; height = $ ImageH $ ; channels = $ ImageC $ ; interpolations = " linear " } : <nl> - { type = " Transpose " } <nl> - ) } <nl> - labels = { labelDim = $ NumLabels $ } <nl> - } <nl> - } ) <nl> - } <nl> - } <nl> - <nl> - # Eval action <nl> - Eval = { <nl> - action = " eval " <nl> - evalNodeNames = errs : top5Errs # also test top - 5 error rate <nl> - # Set minibatch size for testing . <nl> - minibatchSize = 32 <nl> - <nl> - reader = { <nl> - verbosity = 0 ; randomize = false <nl> - deserializers = ( { <nl> - type = " ImageDeserializer " ; module = " ImageReader " <nl> - file = " $ DataDir $ / val_map . txt " <nl> - input = { <nl> - features = { transforms = ( <nl> - { type = " Scale " ; width = $ ImageW $ ; height = $ ImageH $ ; channels = $ ImageC $ ; interpolations = " linear " } : <nl> - { type = " Transpose " } <nl> - ) } <nl> - labels = { labelDim = $ NumLabels $ } <nl> - } <nl> - } ) <nl> - } <nl> - } <nl> deleted file mode 100644 <nl> index ffde16399dc . . 00000000000 <nl> mmm a / Examples / Image / Classification / GoogLeNet / BrainScript / README . md <nl> ppp / dev / null <nl> <nl> - # CNTK Examples : Image / Classification / GoogLeNet <nl> - <nl> - # # BrainScript <nl> - <nl> - # # # InceptionV3 . cntk <nl> - <nl> - Our Inception V3 model is implemented strictly according to the original paper ( https : / / arxiv . org / abs / 1512 . 00567 ) . Unfortunately we have not been able to achieve similar accuracy as the paper claimed . Stay tuned and we will update the configuration file as we make progress . <nl> mmm a / Examples / Image / Classification / GoogLeNet / README . md <nl> ppp b / Examples / Image / Classification / GoogLeNet / README . md <nl> <nl> <nl> | Data : | The ILSVRC2012 dataset ( http : / / www . image - net . org / challenges / LSVRC / 2012 / ) for image classification . <nl> | : mmmmmmmmm | : mmm <nl> - | Purpose | This folder contains examples that demonstrate how to use CNTK to define GoogLeNet ( https : / / arxiv . org / abs / 1409 . 4842 ) for image classification . <nl> + | Purpose | This folder contains examples that demonstrate how to use CNTK to define GoogLeNet ( https : / / arxiv . org / abs / 1409 . 4842 ) and its derivations for image classification . <nl> | Network | Deep convolutional neural networks codenamed " Inception " ( GoogLeNet ) . <nl> - | Training | RMSProp . <nl> + | Training | See the details . <nl> | Comments | See below . <nl> <nl> # # Running the example <nl> ILSVRC2012 datasets are not included in the CNTK distribution . You may obtain it <nl> <nl> # # Details <nl> <nl> - We currently offer the Inception V3 model , published in December 2015 ( https : / / arxiv . org / abs / 1512 . 00567 ) . Only BrainScript version is available at this moment . <nl> + We currently offer the BN - Inception ( https : / / arxiv . org / abs / 1502 . 03167 ) and Inception V3 ( https : / / arxiv . org / abs / 1512 . 00567 ) models . <nl> <nl> - # # # [ BrainScript ] ( . / BrainScript ) <nl> + # # # [ BN - Inception ] ( . / BN - Inception ) <nl> + <nl> + # # # [ Inception V3 ] ( . / InceptionV3 ) <nl>
Add BN - Inception
microsoft/CNTK
170da7b4fa5e9d92647cbf0709fa7a11fb9ec08f
2017-01-19T09:24:25Z
mmm a / test / test_cuda . py <nl> ppp b / test / test_cuda . py <nl> def tmp ( t ) : <nl> <nl> custom_precision = { <nl> ' addbmm ' : 1e - 4 , <nl> + ' addmm ' : 1e - 4 , <nl> ' rsqrt ' : 1e - 4 , <nl> ' cumprod ' : 1e - 4 , <nl> } <nl>
Reduce precision of addmm CUDA test
pytorch/pytorch
a489884da4b63e33ede107261afd6a4a81d9401a
2016-09-24T00:52:08Z
mmm a / tensorflow / compiler / tf2xla / xla_compiler . cc <nl> ppp b / tensorflow / compiler / tf2xla / xla_compiler . cc <nl> Status BuildComputation ( <nl> return a - > arg_num ( ) < b - > arg_num ( ) ; <nl> } ) ; <nl> <nl> + std : : vector < xla : : XlaBuilder : : InputOutputAlias > aliases ; <nl> for ( const XlaResource * resource : arg_resources ) { <nl> DCHECK_LT ( resource - > arg_num ( ) , args . size ( ) ) ; <nl> const XlaCompiler : : Argument & arg = args [ resource - > arg_num ( ) ] ; <nl> Status BuildComputation ( <nl> update . type = resource - > type ( ) ; <nl> update . shape = resource - > shape ( ) ; <nl> update . modified = modified ; <nl> - if ( is_entry_computation & & always_return_tuple & & <nl> + if ( is_entry_computation & & <nl> arg . resource_kind ! = XlaResource : : kTensorArray & & <nl> alias_resource_update ) { <nl> / / Assuming tuple arg and results are used . <nl> - int64 output_index = elems . size ( ) ; <nl> - if ( use_tuple_arg ) { <nl> - builder - > SetUpAlias ( / * output_index = * / { output_index } , <nl> - / * param_number = * / 0 , <nl> - / * param_index = * / { update . input_index } ) ; <nl> - } else { <nl> - builder - > SetUpAlias ( / * output_index = * / { output_index } , <nl> - / * param_number = * / update . input_index , <nl> - / * param_index = * / { } ) ; <nl> - } <nl> + xla : : ShapeIndex param_index = <nl> + use_tuple_arg ? xla : : ShapeIndex ( { update . input_index } ) <nl> + : xla : : ShapeIndex { } ; <nl> + int param_number = use_tuple_arg ? 0 : update . input_index ; <nl> + int64 output_index_num = elems . size ( ) ; <nl> + xla : : ShapeIndex output_index = xla : : ShapeIndex ( { output_index_num } ) ; <nl> + VLOG ( 3 ) < < " Storing alias : " < < output_index . ToString ( ) < < " : ( " <nl> + < < param_number < < " , " < < param_index . ToString ( ) < < " ) " ; <nl> + aliases . push_back ( { output_index , param_number , param_index } ) ; <nl> } <nl> for ( const auto & grad : resource - > tensor_array_gradients ( ) ) { <nl> update . tensor_array_gradients_accessed . insert ( grad . first ) ; <nl> Status BuildComputation ( <nl> xla : : XlaScopedShardingAssignment assign_sharding ( builder , op_sharding ) ; <nl> tuple = xla : : Tuple ( builder , elems ) ; <nl> } <nl> - if ( ! always_return_tuple & & elems . size ( ) = = 1 ) { <nl> + bool returns_tuple = always_return_tuple | | elems . size ( ) ! = 1 ; <nl> + VLOG ( 3 ) < < " Computation returns a tuple = " < < returns_tuple ; <nl> + if ( ! returns_tuple ) { <nl> xla : : GetTupleElement ( tuple , 0 ) ; <nl> + <nl> + for ( xla : : XlaBuilder : : InputOutputAlias & alias : aliases ) { <nl> + if ( alias . output_index = = xla : : ShapeIndex ( { 0 } ) ) { <nl> + VLOG ( 3 ) < < " For aliased parameter " < < alias . param_number < < " : " <nl> + < < alias . param_index . ToString ( ) <nl> + < < " normalizing output_index from { 0 } to { } , as a scalar is " <nl> + " returned from the cluster " ; <nl> + alias . output_index = xla : : ShapeIndex ( { } ) ; <nl> + } <nl> + } <nl> + } <nl> + <nl> + for ( xla : : XlaBuilder : : InputOutputAlias & alias : aliases ) { <nl> + builder - > SetUpAlias ( alias . output_index , alias . param_number , <nl> + alias . param_index ) ; <nl> } <nl> <nl> xla : : StatusOr < xla : : XlaComputation > computation_status = builder - > Build ( ) ; <nl>
[ TF2XLA ] Set up aliasing for resource variables even when not returning a tuple
tensorflow/tensorflow
aa7ff6aa28977826e7acae379e82da22482b2bf2
2020-06-20T01:20:41Z
mmm a / core - tests / src / network / aio_thread . cpp <nl> ppp b / core - tests / src / network / aio_thread . cpp <nl> <nl> # include " tests . h " <nl> # include " async . h " <nl> <nl> - # include < mutex > <nl> - # include < condition_variable > <nl> # include < atomic > <nl> <nl> using namespace std ; <nl>
remove unused code
swoole/swoole-src
700e9d53bd285edb71530273b01489a7cbfb31e5
2019-01-13T10:53:16Z
mmm a / benchmark / single - source / StringTests . swift <nl> ppp b / benchmark / single - source / StringTests . swift <nl> import TestsUtils <nl> <nl> public let StringTests = [ <nl> BenchmarkInfo ( name : " StringEqualPointerComparison " , runFunction : run_StringEqualPointerComparison , tags : [ . validation , . api , . String ] ) , <nl> - BenchmarkInfo ( name : " StringHasPrefix " , runFunction : run_StringHasPrefix , tags : [ . validation , . api , . String ] ) , <nl> + BenchmarkInfo ( name : " StringHasPrefixAscii " , runFunction : run_StringHasPrefixAscii , tags : [ . validation , . api , . String ] ) , <nl> BenchmarkInfo ( name : " StringHasPrefixUnicode " , runFunction : run_StringHasPrefixUnicode , tags : [ . validation , . api , . String ] ) , <nl> - BenchmarkInfo ( name : " StringHasSuffix " , runFunction : run_StringHasSuffix , tags : [ . validation , . api , . String ] ) , <nl> + BenchmarkInfo ( name : " StringHasSuffixAscii " , runFunction : run_StringHasSuffixAscii , tags : [ . validation , . api , . String ] ) , <nl> BenchmarkInfo ( name : " StringHasSuffixUnicode " , runFunction : run_StringHasSuffixUnicode , tags : [ . validation , . api , . String ] ) , <nl> ] <nl> <nl> / / FIXME ( string ) <nl> - public func run_StringHasPrefix ( _ N : Int ) { <nl> + public func run_StringHasPrefixAscii ( _ N : Int ) { <nl> # if _runtime ( _ObjC ) <nl> let prefix = " prefix " <nl> let testString = " prefixedString " <nl> public func run_StringHasPrefix ( _ N : Int ) { <nl> } <nl> <nl> / / FIXME ( string ) <nl> - public func run_StringHasSuffix ( _ N : Int ) { <nl> + public func run_StringHasSuffixAscii ( _ N : Int ) { <nl> # if _runtime ( _ObjC ) <nl> let suffix = " Suffixed " <nl> let testString = " StringSuffixed " <nl>
Merge pull request from eeckstein / rename - bench
apple/swift
f7a310a6076fc452f38492fd864daf09a28908b7
2017-12-01T00:24:49Z
mmm a / editor / filesystem_dock . cpp <nl> ppp b / editor / filesystem_dock . cpp <nl> void FileSystemDock : : _notification ( int p_what ) { <nl> case NOTIFICATION_DRAG_BEGIN : { <nl> Dictionary dd = get_viewport ( ) - > gui_get_drag_data ( ) ; <nl> if ( tree - > is_visible_in_tree ( ) & & dd . has ( " type " ) ) { <nl> - if ( ( String ( dd [ " type " ] ) = = " files " ) | | ( String ( dd [ " type " ] ) = = " files_and_dirs " ) | | ( String ( dd [ " type " ] ) = = " resource " ) ) { <nl> + if ( dd . has ( " favorite " ) ) { <nl> + if ( ( String ( dd [ " favorite " ] ) = = " all " ) ) <nl> + tree - > set_drop_mode_flags ( Tree : : DROP_MODE_INBETWEEN ) ; <nl> + } else if ( ( String ( dd [ " type " ] ) = = " files " ) | | ( String ( dd [ " type " ] ) = = " files_and_dirs " ) | | ( String ( dd [ " type " ] ) = = " resource " ) ) { <nl> tree - > set_drop_mode_flags ( Tree : : DROP_MODE_ON_ITEM | Tree : : DROP_MODE_INBETWEEN ) ; <nl> - } else if ( ( String ( dd [ " type " ] ) = = " favorite " ) ) { <nl> - tree - > set_drop_mode_flags ( Tree : : DROP_MODE_INBETWEEN ) ; <nl> } <nl> } <nl> } break ; <nl> Variant FileSystemDock : : get_drag_data_fw ( const Point2 & p_point , Control * p_from ) <nl> all_not_favorites & = ! is_favorite ; <nl> selected = tree - > get_next_selected ( selected ) ; <nl> } <nl> - if ( all_favorites ) { <nl> + if ( ! all_not_favorites ) { <nl> paths = _tree_get_selected ( false ) ; <nl> } else { <nl> paths = _tree_get_selected ( ) ; <nl> Variant FileSystemDock : : get_drag_data_fw ( const Point2 & p_point , Control * p_from ) <nl> if ( paths . empty ( ) ) <nl> return Variant ( ) ; <nl> <nl> - if ( ! all_favorites & & ! all_not_favorites ) <nl> - return Variant ( ) ; <nl> - <nl> Dictionary drag_data = EditorNode : : get_singleton ( ) - > drag_files_and_dirs ( paths , p_from ) ; <nl> - if ( all_favorites ) { <nl> - drag_data [ " type " ] = " favorite " ; <nl> + if ( ! all_not_favorites ) { <nl> + drag_data [ " favorite " ] = all_favorites ? " all " : " mixed " ; <nl> } <nl> return drag_data ; <nl> } <nl> Variant FileSystemDock : : get_drag_data_fw ( const Point2 & p_point , Control * p_from ) <nl> bool FileSystemDock : : can_drop_data_fw ( const Point2 & p_point , const Variant & p_data , Control * p_from ) const { <nl> Dictionary drag_data = p_data ; <nl> <nl> - if ( drag_data . has ( " type " ) & & String ( drag_data [ " type " ] ) = = " favorite " ) { <nl> + if ( drag_data . has ( " favorite " ) ) { <nl> + <nl> + if ( String ( drag_data [ " favorite " ] ) ! = " all " ) { <nl> + return false ; <nl> + } <nl> <nl> / / Moving favorite around . <nl> TreeItem * ti = tree - > get_item_at_position ( p_point ) ; <nl> void FileSystemDock : : drop_data_fw ( const Point2 & p_point , const Variant & p_data , <nl> <nl> Vector < String > dirs = EditorSettings : : get_singleton ( ) - > get_favorites ( ) ; <nl> <nl> - if ( drag_data . has ( " type " ) & & String ( drag_data [ " type " ] ) = = " favorite " ) { <nl> + if ( drag_data . has ( " favorite " ) ) { <nl> + <nl> + if ( String ( drag_data [ " favorite " ] ) ! = " all " ) { <nl> + return ; <nl> + } <nl> / / Moving favorite around . <nl> TreeItem * ti = tree - > get_item_at_position ( p_point ) ; <nl> if ( ! ti ) <nl>
Favorites dragable
godotengine/godot
f1265541ee164092878ca27f644a1f87338863e2
2019-10-20T17:39:21Z
mmm a / docs / en / query_language / functions / array_functions . md <nl> ppp b / docs / en / query_language / functions / array_functions . md <nl> If you want to get a list of unique items in an array , you can use arrayReduce ( ' <nl> <nl> A special function . See the section [ " ArrayJoin function " ] ( array_join . md # functions_arrayjoin ) . <nl> <nl> - # # arrayDifference ( arr ) <nl> + # # arrayDifference ( arr ) { # array_functions - arraydifference } <nl> <nl> - Takes an array , returns an array with the difference between all pairs of neighboring elements . For example : <nl> + Takes an array , returns an array of differences between adjacent elements . The first element will be 0 , the second is the difference between the second and first elements of the original array , etc . The type of elements in the resulting array is determined by the rules for type inference by subtraction ( e . g . UInt8 - UInt8 = Int16 ) . UInt * / Int * / Float * types are supported ( Decimal type is not supported ) . <nl> + <nl> + Example : <nl> <nl> ` ` ` sql <nl> SELECT arrayDifference ( [ 1 , 2 , 3 , 4 ] ) <nl> SELECT arrayDifference ( [ 1 , 2 , 3 , 4 ] ) <nl> β”” ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ β”˜ <nl> ` ` ` <nl> <nl> - # # arrayDistinct ( arr ) <nl> + Example of the overflow due to result type Int64 : <nl> + <nl> + ` ` ` sql <nl> + SELECT arrayDifference ( [ 0 , 10000000000000000000 ] ) <nl> + ` ` ` <nl> + <nl> + ` ` ` text <nl> + β”Œ ─ arrayDifference ( [ 0 , 10000000000000000000 ] ) ─ ┐ <nl> + β”‚ [ 0 , - 8446744073709551616 ] β”‚ <nl> + β”” ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ β”˜ <nl> + ` ` ` <nl> + <nl> + # # arrayDistinct ( arr ) { # array_functions - arraydistinct } <nl> <nl> Takes an array , returns an array containing the distinct elements . For example : <nl> <nl> SELECT arrayDistinct ( [ 1 , 2 , 2 , 3 , 1 ] ) <nl> β”” ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ β”˜ <nl> ` ` ` <nl> <nl> - # # arrayEnumerateDense ( arr ) <nl> + # # arrayEnumerateDense ( arr ) { # array_functions - arrayenumeratedense } <nl> + <nl> + Returns an array of the same size as the source array , indicating where each element first appears in the source array . <nl> + <nl> + Example : <nl> + <nl> + ` ` ` sql <nl> + SELECT arrayEnumerateDense ( [ 10 , 20 , 10 , 30 ] ) <nl> + ` ` ` <nl> + <nl> + ` ` ` text <nl> + β”Œ ─ arrayEnumerateDense ( [ 10 , 20 , 10 , 30 ] ) ─ ┐ <nl> + β”‚ [ 1 , 2 , 1 , 3 ] β”‚ <nl> + β”” ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ β”˜ <nl> + ` ` ` <nl> <nl> - Returns an array of the same size as the source array , indicating where each element first appears in the source array . For example : arrayEnumerateDense ( [ 10 , 20 , 10 , 30 ] ) = [ 1 , 2 , 1 , 3 ] . <nl> + # # arrayIntersect ( arr ) { # array_functions - arrayintersect } <nl> <nl> - # # arrayIntersect ( arr ) <nl> + Takes multiple arrays , returns an array with elements present in all source arrays . Elements at the output follow in the order in the first array . <nl> <nl> - Takes an array , returns the intersection of all array elements . For example : <nl> + Example : <nl> <nl> ` ` ` sql <nl> SELECT <nl> SELECT <nl> β”” ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ β”΄ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ β”˜ <nl> ` ` ` <nl> <nl> - # # arrayReduce ( agg_func , arr1 , . . . ) <nl> + # # arrayReduce ( agg_func , arr1 , . . . ) { # array_functions - arrayreduce } <nl> + <nl> + Applies an aggregate function to array elements and returns its result . The name of the aggregation function is passed as a string in single quotes ` ' max ' ` , ` ' sum ' ` . When using parametric aggregate functions , the parameter is indicated after the function name in parentheses ` ' uniqUpTo ( 6 ) ' ` . <nl> <nl> - Applies an aggregate function to array and returns its result . If aggregate function has multiple arguments , then this function can be applied to multiple arrays of the same size . <nl> + Example : <nl> + <nl> + ` ` ` sql <nl> + SELECT arrayReduce ( ' max ' , [ 1 , 2 , 3 ] ) <nl> + ` ` ` <nl> <nl> - arrayReduce ( ' agg_func ' , arr1 , . . . ) - apply the aggregate function ` agg_func ` to arrays ` arr1 . . . ` . If multiple arrays passed , then elements on corresponding positions are passed as multiple arguments to the aggregate function . For example : SELECT arrayReduce ( ' max ' , [ 1 , 2 , 3 ] ) = 3 <nl> + ` ` ` text <nl> + β”Œ ─ arrayReduce ( ' max ' , [ 1 , 2 , 3 ] ) ─ ┐ <nl> + β”‚ 3 β”‚ <nl> + β”” ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ β”˜ <nl> + ` ` ` <nl> <nl> - # # arrayReverse ( arr ) <nl> + If aggregate function has multiple arguments , then this function can be applied to multiple arrays of the same size . <nl> + <nl> + Example : <nl> + <nl> + ` ` ` sql <nl> + SELECT arrayReduce ( ' maxIf ' , [ 3 , 5 ] , [ 1 , 0 ] ) <nl> + ` ` ` <nl> + <nl> + ` ` ` text <nl> + β”Œ ─ arrayReduce ( ' maxIf ' , [ 3 , 5 ] , [ 1 , 0 ] ) ─ ┐ <nl> + β”‚ 3 β”‚ <nl> + β”” ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ β”˜ <nl> + ` ` ` <nl> + <nl> + Example with a parametric aggregate function : <nl> + <nl> + ` ` ` sql <nl> + SELECT arrayReduce ( ' uniqUpTo ( 3 ) ' , [ 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 ] ) <nl> + ` ` ` <nl> + <nl> + ` ` ` text <nl> + β”Œ ─ arrayReduce ( ' uniqUpTo ( 3 ) ' , [ 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 ] ) ─ ┐ <nl> + β”‚ 4 β”‚ <nl> + β”” ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ β”˜ <nl> + ` ` ` <nl> + <nl> + # # arrayReverse ( arr ) { # array_functions - arrayreverse } <nl> + <nl> + Returns an array of the same size as the original array containing the elements in reverse order . <nl> + <nl> + Example : <nl> + <nl> + ` ` ` sql <nl> + SELECT arrayReverse ( [ 1 , 2 , 3 ] ) <nl> + ` ` ` <nl> + <nl> + ` ` ` text <nl> + β”Œ ─ arrayReverse ( [ 1 , 2 , 3 ] ) ─ ┐ <nl> + β”‚ [ 3 , 2 , 1 ] β”‚ <nl> + β”” ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ β”˜ <nl> + ` ` ` <nl> <nl> - Returns an array of the same size as the source array , containing the result of inverting all elements of the source array . <nl> + # # reverse ( arr ) { # array_functions - reverse } <nl> <nl> + Synonym for [ " arrayReverse " ] ( # array_functions - arrayreverse ) <nl> <nl> <nl> [ Original article ] ( https : / / clickhouse . yandex / docs / en / query_language / functions / array_functions / ) < ! - - hide - - > <nl>
Update array_functions . md
ClickHouse/ClickHouse
c224ae0afd3626b431bebc0a80575775b70039d4
2019-09-30T22:26:30Z
mmm a / lib / SIL / TypeLowering . cpp <nl> ppp b / lib / SIL / TypeLowering . cpp <nl> namespace { <nl> / / If any of the union elements have address - only data , the union is <nl> / / address - only . <nl> for ( auto elt : D - > getAllElements ( ) ) { <nl> - / / Singleton elements do not affect address - only - ness . <nl> + / / No - payload elements do not affect address - only - ness . <nl> if ( ! elt - > hasArgumentType ( ) ) <nl> continue ; <nl> <nl> - / / FIXME : Apply type substitution to the case ' s argument type . <nl> - auto eltType = elt - > getArgumentType ( ) - > getCanonicalType ( ) ; <nl> + auto eltType = unionType - > getTypeOfMember ( D - > getModuleContext ( ) , <nl> + elt , nullptr , <nl> + elt - > getArgumentType ( ) ) <nl> + - > getCanonicalType ( ) ; <nl> auto & lowering = TC . getTypeLowering ( eltType ) ; <nl> if ( lowering . isAddressOnly ( ) ) <nl> return handleAddressOnly ( unionType ) ; <nl>
SIL : Apply type substitutions to union cases during type lowering .
apple/swift
12ea948067eed1277abe405484df7ea2ddadab7e
2013-09-13T22:12:12Z
mmm a / src / video_core / color . h <nl> ppp b / src / video_core / color . h <nl> inline u32 DecodeD24 ( const u8 * bytes ) { <nl> * @ return Resulting values stored as a Math : : Vec2 <nl> * / <nl> inline const Math : : Vec2 < u32 > DecodeD24S8 ( const u8 * bytes ) { <nl> - return { ( bytes [ 2 ] < < 16 ) | ( bytes [ 1 ] < < 8 ) | bytes [ 0 ] , bytes [ 3 ] } ; <nl> + return { static_cast < u32 > ( ( bytes [ 2 ] < < 16 ) | ( bytes [ 1 ] < < 8 ) | bytes [ 0 ] ) , bytes [ 3 ] } ; <nl> } <nl> <nl> / * * <nl> mmm a / src / video_core / debug_utils / debug_utils . cpp <nl> ppp b / src / video_core / debug_utils / debug_utils . cpp <nl> const Math : : Vec4 < u8 > LookupTexture ( const u8 * source , int x , int y , const Texture <nl> case Regs : : TextureFormat : : RGBA8 : <nl> { <nl> auto res = Color : : DecodeRGBA8 ( source + VideoCore : : GetMortonOffset ( x , y , 4 ) ) ; <nl> - return { res . r ( ) , res . g ( ) , res . b ( ) , disable_alpha ? 255 : res . a ( ) } ; <nl> + return { res . r ( ) , res . g ( ) , res . b ( ) , static_cast < u8 > ( disable_alpha ? 255 : res . a ( ) ) } ; <nl> } <nl> <nl> case Regs : : TextureFormat : : RGB8 : <nl> const Math : : Vec4 < u8 > LookupTexture ( const u8 * source , int x , int y , const Texture <nl> case Regs : : TextureFormat : : RGB5A1 : <nl> { <nl> auto res = Color : : DecodeRGB5A1 ( source + VideoCore : : GetMortonOffset ( x , y , 2 ) ) ; <nl> - return { res . r ( ) , res . g ( ) , res . b ( ) , disable_alpha ? 255 : res . a ( ) } ; <nl> + return { res . r ( ) , res . g ( ) , res . b ( ) , static_cast < u8 > ( disable_alpha ? 255 : res . a ( ) ) } ; <nl> } <nl> <nl> case Regs : : TextureFormat : : RGB565 : <nl> const Math : : Vec4 < u8 > LookupTexture ( const u8 * source , int x , int y , const Texture <nl> case Regs : : TextureFormat : : RGBA4 : <nl> { <nl> auto res = Color : : DecodeRGBA4 ( source + VideoCore : : GetMortonOffset ( x , y , 2 ) ) ; <nl> - return { res . r ( ) , res . g ( ) , res . b ( ) , disable_alpha ? 255 : res . a ( ) } ; <nl> + return { res . r ( ) , res . g ( ) , res . b ( ) , static_cast < u8 > ( disable_alpha ? 255 : res . a ( ) ) } ; <nl> } <nl> <nl> case Regs : : TextureFormat : : IA8 : <nl>
VideoCore : Add static_cast around expressions where the compiler doesn ’ t deduce the right type .
yuzu-emu/yuzu
92fd2a1ee30b4c0b5af9ebb268f8f1ace649f371
2015-03-16T14:14:04Z
mmm a / xbmc / utils / Weather . cpp <nl> ppp b / xbmc / utils / Weather . cpp <nl> void CWeather : : OnSettingChanged ( const CSetting * setting ) <nl> <nl> const std : : string settingId = setting - > GetId ( ) ; <nl> if ( settingId = = " weather . addon " ) <nl> + { <nl> + / / clear " WeatherProviderLogo " property that some weather addons set <nl> + CGUIWindow * window = g_windowManager . GetWindow ( WINDOW_WEATHER ) ; <nl> + window - > SetProperty ( " WeatherProviderLogo " , " " ) ; ; <nl> Refresh ( ) ; <nl> + } <nl> } <nl> <nl> void CWeather : : OnSettingAction ( const CSetting * setting ) <nl>
Merge pull request from amet / weatherIcon_cleanup
xbmc/xbmc
8647a8e1b6375b00f4c941e6bf9e8f99f0883778
2013-10-18T08:57:16Z
mmm a / android / playground / app / src / main / java / com / alibaba / weex / WXPageActivity . java <nl> ppp b / android / playground / app / src / main / java / com / alibaba / weex / WXPageActivity . java <nl> private void loadWXfromService ( final String url ) { <nl> public void onSuccess ( WXHttpTask task ) { <nl> Log . e ( TAG , " into - - [ http : onSuccess ] url : " + url ) ; <nl> try { <nl> - mConfigMap . put ( " bundleUrl " , url + Constants . WEEX_SAMPLES_KEY ) ; <nl> + mConfigMap . put ( " bundleUrl " , url ) ; <nl> mInstance . render ( TAG , new String ( task . response . data , " utf - 8 " ) , mConfigMap , null , ScreenUtil . getDisplayWidth ( WXPageActivity . this ) , ScreenUtil . getDisplayHeight ( WXPageActivity . this ) , WXRenderStrategy . APPEND_ASYNC ) ; <nl> - <nl> - / / mInstance . render ( new String ( task . response . data , " utf - 8 " ) , mContainer . getWidth ( ) , mContainer . getHeight ( ) ) ; <nl> } catch ( UnsupportedEncodingException e ) { <nl> e . printStackTrace ( ) ; <nl> } <nl>
* [ android ] update WXpageActivity . java
apache/incubator-weex
24c11e950acb2a990a2f4b4a7b540192bfa99d06
2016-06-15T08:13:48Z
new file mode 100644 <nl> index 000000000000 . . fc1cf7e8571a <nl> mmm / dev / null <nl> ppp b / jstests / multiVersion / update_shard_key_disallowed_fcv40 . js <nl> <nl> + / / Test that shard key fields cannot be updated when one or more shards is in FCV 4 . 0 . <nl> + / / @ tags : [ uses_transactions , uses_multi_shard_transaction ] <nl> + <nl> + ( function ( ) { <nl> + " use strict " ; <nl> + <nl> + load ( " jstests / libs / feature_compatibility_version . js " ) ; <nl> + <nl> + let st = new ShardingTest ( { <nl> + shards : [ { binVersion : " latest " } , { binVersion : " latest " } ] , <nl> + mongos : 1 , <nl> + other : { mongosOptions : { binVersion : " latest " } , configOptions : { binVersion : " latest " } } <nl> + } ) ; <nl> + let mongos = st . s0 ; <nl> + let kDbName = " test " ; <nl> + let collName = " foo " ; <nl> + let ns = kDbName + " . " + collName ; <nl> + <nl> + assert . commandWorked ( mongos . adminCommand ( { enableSharding : kDbName } ) ) ; <nl> + st . ensurePrimaryShard ( kDbName , st . shard0 . shardName ) ; <nl> + <nl> + function shardCollectionAndMoveChunks ( docsToInsert , shardKey , splitDoc , moveDoc ) { <nl> + for ( let i = 0 ; i < docsToInsert . length ; i + + ) { <nl> + assert . writeOK ( mongos . getDB ( kDbName ) . foo . insert ( docsToInsert [ i ] ) ) ; <nl> + } <nl> + <nl> + assert . commandWorked ( mongos . getDB ( kDbName ) . foo . createIndex ( shardKey ) ) ; <nl> + assert . commandWorked ( mongos . adminCommand ( { shardCollection : ns , key : shardKey } ) ) ; <nl> + assert . commandWorked ( mongos . adminCommand ( { split : ns , find : splitDoc } ) ) ; <nl> + assert . commandWorked ( <nl> + mongos . adminCommand ( { moveChunk : ns , find : moveDoc , to : st . shard1 . shardName } ) ) ; <nl> + <nl> + assert . commandWorked ( mongos . adminCommand ( { flushRouterConfig : 1 } ) ) ; <nl> + st . rs0 . getPrimary ( ) . adminCommand ( { _flushRoutingTableCacheUpdates : ns } ) ; <nl> + st . rs1 . getPrimary ( ) . adminCommand ( { _flushRoutingTableCacheUpdates : ns } ) ; <nl> + st . rs0 . getPrimary ( ) . adminCommand ( { _flushDatabaseCacheUpdates : kDbName } ) ; <nl> + st . rs1 . getPrimary ( ) . adminCommand ( { _flushDatabaseCacheUpdates : kDbName } ) ; <nl> + } <nl> + <nl> + function assertCannotUpdateShardKey ( ) { <nl> + let session = st . s . startSession ( { retryWrites : true } ) ; <nl> + let sessionDB = session . getDatabase ( kDbName ) ; <nl> + <nl> + / / Updates to full shard key <nl> + shardCollectionAndMoveChunks ( [ { x : 30 } , { x : 50 } , { x : 80 } ] , { x : 1 } , { x : 50 } , { x : 80 } ) ; <nl> + <nl> + / / Assert that updating the shard key when the doc would remain on the same shard fails for <nl> + / / both modify and replacement updates <nl> + assert . writeError ( sessionDB . foo . update ( { x : 30 } , { $ set : { x : 5 } } ) ) ; <nl> + assert . writeError ( sessionDB . foo . update ( { x : 30 } , { x : 5 } ) ) ; <nl> + assert . throws ( function ( ) { <nl> + sessionDB . foo . findAndModify ( { query : { x : 80 } , update : { $ set : { x : 100 } } } ) ; <nl> + } ) ; <nl> + assert . throws ( function ( ) { <nl> + sessionDB . foo . findAndModify ( { query : { x : 80 } , update : { x : 100 } } ) ; <nl> + } ) ; <nl> + <nl> + / / Assert that updating the shard key when the doc would move shards fails for both modify <nl> + / / and replacement updates <nl> + assert . writeError ( sessionDB . foo . update ( { x : 30 } , { $ set : { x : 100 } } ) ) ; <nl> + / / TODO : SERVER - 39158 . Currently , this update will not fail but will not update the doc . <nl> + / / After SERVER - 39158 is finished , this should fail . <nl> + assert . writeOK ( sessionDB . foo . update ( { x : 30 } , { x : 100 } ) ) ; <nl> + assert . eq ( 1 , mongos . getDB ( kDbName ) . foo . find ( { x : 30 } ) . toArray ( ) . length ) ; <nl> + assert . eq ( 0 , mongos . getDB ( kDbName ) . foo . find ( { x : 100 } ) . toArray ( ) . length ) ; <nl> + <nl> + assert . throws ( function ( ) { <nl> + sessionDB . foo . findAndModify ( { query : { x : 80 } , update : { $ set : { x : 3 } } } ) ; <nl> + } ) ; <nl> + assert . throws ( function ( ) { <nl> + sessionDB . foo . findAndModify ( { query : { x : 80 } , update : { x : 3 } } ) ; <nl> + } ) ; <nl> + <nl> + mongos . getDB ( kDbName ) . foo . drop ( ) ; <nl> + <nl> + / / Updates to partial shard key <nl> + shardCollectionAndMoveChunks ( [ { x : 30 , y : 4 } , { x : 50 , y : 50 } , { x : 80 , y : 100 } ] , <nl> + { x : 1 , y : 1 } , <nl> + { x : 50 , y : 50 } , <nl> + { x : 80 , y : 100 } ) ; <nl> + <nl> + / / Assert that updating the shard key when the doc would remain on the same shard fails for <nl> + / / both modify and replacement updates <nl> + assert . writeError ( sessionDB . foo . update ( { x : 30 } , { $ set : { x : 5 } } ) ) ; <nl> + assert . writeError ( sessionDB . foo . update ( { x : 30 } , { x : 5 } ) ) ; <nl> + assert . throws ( function ( ) { <nl> + sessionDB . foo . findAndModify ( { query : { x : 80 } , update : { $ set : { x : 100 } } } ) ; <nl> + } ) ; <nl> + assert . throws ( function ( ) { <nl> + sessionDB . foo . findAndModify ( { query : { x : 80 } , update : { x : 100 } } ) ; <nl> + } ) ; <nl> + <nl> + / / Assert that updating the shard key when the doc would move shards fails for both modify <nl> + / / and replacement updates <nl> + assert . writeError ( sessionDB . foo . update ( { x : 30 } , { $ set : { x : 100 } } ) ) ; <nl> + assert . writeError ( sessionDB . foo . update ( { x : 30 } , { x : 100 } ) ) ; <nl> + assert . throws ( function ( ) { <nl> + sessionDB . foo . findAndModify ( { query : { x : 80 } , update : { $ set : { x : 3 } } } ) ; <nl> + } ) ; <nl> + assert . throws ( function ( ) { <nl> + sessionDB . foo . findAndModify ( { query : { x : 80 } , update : { x : 3 } } ) ; <nl> + } ) ; <nl> + <nl> + mongos . getDB ( kDbName ) . foo . drop ( ) ; <nl> + <nl> + / / Test that we fail when attempt to run in a transaction as well <nl> + session = st . s . startSession ( ) ; <nl> + sessionDB = session . getDatabase ( kDbName ) ; <nl> + <nl> + / / Updates to full shard key <nl> + shardCollectionAndMoveChunks ( [ { x : 30 } , { x : 50 } , { x : 80 } ] , { x : 1 } , { x : 50 } , { x : 80 } ) ; <nl> + <nl> + / / Assert that updating the shard key when the doc would remain on the same shard fails for <nl> + / / both modify and replacement updates <nl> + session . startTransaction ( ) ; <nl> + assert . writeError ( sessionDB . foo . update ( { x : 30 } , { $ set : { x : 5 } } ) ) ; <nl> + session . abortTransaction ( ) ; <nl> + <nl> + session . startTransaction ( ) ; <nl> + assert . throws ( function ( ) { <nl> + sessionDB . foo . findAndModify ( { query : { x : 80 } , update : { x : 100 } } ) ; <nl> + } ) ; <nl> + session . abortTransaction ( ) ; <nl> + <nl> + mongos . getDB ( kDbName ) . foo . drop ( ) ; <nl> + } <nl> + <nl> + / / Check that updating the shard key fails when all shards are in FCV 4 . 0 <nl> + assert . commandWorked ( st . s . getDB ( " admin " ) . runCommand ( { setFeatureCompatibilityVersion : " 4 . 0 " } ) ) ; <nl> + checkFCV ( st . configRS . getPrimary ( ) . getDB ( " admin " ) , " 4 . 0 " ) ; <nl> + checkFCV ( st . rs0 . getPrimary ( ) . getDB ( " admin " ) , " 4 . 0 " ) ; <nl> + checkFCV ( st . rs1 . getPrimary ( ) . getDB ( " admin " ) , " 4 . 0 " ) ; <nl> + <nl> + assertCannotUpdateShardKey ( ) ; <nl> + <nl> + / / Check that updating the shard key fails when shard0 is in FCV 4 . 2 but shard 1 is in FCV 4 . 0 <nl> + assert . commandWorked ( <nl> + st . rs0 . getPrimary ( ) . getDB ( " admin " ) . runCommand ( { setFeatureCompatibilityVersion : " 4 . 2 " } ) ) ; <nl> + checkFCV ( st . configRS . getPrimary ( ) . getDB ( " admin " ) , " 4 . 0 " ) ; <nl> + checkFCV ( st . rs0 . getPrimary ( ) . getDB ( " admin " ) , " 4 . 2 " ) ; <nl> + checkFCV ( st . rs1 . getPrimary ( ) . getDB ( " admin " ) , " 4 . 0 " ) ; <nl> + <nl> + assertCannotUpdateShardKey ( ) ; <nl> + <nl> + st . stop ( ) ; <nl> + } ) ( ) ; <nl>
SERVER - 40027 Add targeted test that we cannot modify shard key fields in FCV 4 . 0
mongodb/mongo
467f34475b55942bc4f81ff7b34dcd7c958c1ab6
2019-03-18T15:10:27Z
mmm a / . travis . yml <nl> ppp b / . travis . yml <nl> env : <nl> - secure : " HrsaCb + N66EG1HR + LWH1u51SjaJyRwJEDzqJGYMB7LJ / bfqb9mWKF1fLvZGk46W5t7TVaXRDD5KHFx9DPWvKn4gRUVkwTHEy262ah5ORh8M6n / 6VVVajeV / AYt2C0sswdkDBDO4Xq + xy5gdw3G8s1A4Inbm73pUh + 6vx + 7ltBbk = " <nl> <nl> before_install : <nl> - - sudo apt - add - repository - y ppa : ubuntu - toolchain - r / test <nl> + - sudo apt - add - repository - y ppa : ubuntu - toolchain - r / test - - allow - unauthenticated <nl> - sudo apt - get update - qq <nl> - - sudo apt - get install - y cmake valgrind g + + - multilib libc6 - dbg : i386 <nl> + - sudo apt - get install - y cmake valgrind g + + - multilib libc6 - dbg : i386 - - allow - unauthenticated <nl> <nl> matrix : <nl> include : <nl>
Update . travis . yml
Tencent/rapidjson
d3c4b2b2b1cd7e5f984eb5061abf1d083d7a1bcd
2019-09-25T02:17:39Z
mmm a / libraries / cmake / formula / openssl / CMakeLists . txt <nl> ppp b / libraries / cmake / formula / openssl / CMakeLists . txt <nl> <nl> project ( thirdparty_openssl ) <nl> <nl> - set ( OPENSSL_VERSION " 1 . 1 . 1g " ) <nl> - set ( OPENSSL_ARCHIVE_SHA256 " ddb04774f1e32f0c49751e21b67216ac87852ceb056b75209af2443400636d46 " ) <nl> + set ( OPENSSL_VERSION " 1 . 1 . 1i " ) <nl> + set ( OPENSSL_ARCHIVE_SHA256 " e8be6a35fe41d10603c3cc635e93289ed00bf34b79671a3a4de64fcee00d5242 " ) <nl> <nl> include ( ExternalProject ) <nl> <nl>
Update openssl to version 1 . 1 . 1i ( )
osquery/osquery
1e3e4bc6535abdb1f55ca2207714c5f13e15d618
2020-12-20T00:00:26Z
mmm a / . github / ISSUE_TEMPLATE / config . yml <nl> ppp b / . github / ISSUE_TEMPLATE / config . yml <nl> blank_issues_enabled : false <nl> contact_links : <nl> - name : Discussions <nl> url : https : / / github . com / commaai / openpilot / discussions <nl> - about : For questions and discussions about openpilot <nl> + about : For questions and discussion about openpilot <nl> - name : Community Wiki <nl> url : https : / / github . com / commaai / openpilot / wiki <nl> about : Check out our community wiki <nl> mmm a / . github / ISSUE_TEMPLATE / enhancement . md <nl> ppp b / . github / ISSUE_TEMPLATE / enhancement . md <nl> <nl> mmm <nl> name : Enhancement <nl> - about : For suggestions for openpilot enhancements <nl> + about : For openpilot enhancement suggestions <nl> title : ' ' <nl> labels : ' enhancement ' <nl> assignees : ' ' <nl>
this sounds better
commaai/openpilot
562cde2022fe1abf2176b4766e045bdf623b05e6
2020-09-28T20:48:09Z
mmm a / src / mongo / db / cloner . cpp <nl> ppp b / src / mongo / db / cloner . cpp <nl> <nl> <nl> # include " mongo / pch . h " <nl> <nl> - # include " mongo / db / cloner . h " <nl> + # include " mongo / base / init . h " <nl> + # include " mongo / base / status . h " <nl> # include " mongo / bson / util / builder . h " <nl> + # include " mongo / db / cloner . h " <nl> # include " mongo / db / commands . h " <nl> # include " mongo / db / db . h " <nl> # include " mongo / db / instance . h " <nl> namespace mongo { <nl> return c . go ( masterHost . c_str ( ) , options , * clonedCollections , errmsg , errCode ) ; <nl> } <nl> <nl> - <nl> / * Usage : <nl> mydb . $ cmd . findOne ( { clone : " fromhost " } ) ; <nl> + Note : doesn ' t work with authentication enabled <nl> * / <nl> class CmdClone : public Command { <nl> public : <nl> namespace mongo { <nl> help < < " clone this database from an instance of the db on another host \ n " ; <nl> help < < " { clone : \ " host13 \ " } " ; <nl> } <nl> + virtual void addRequiredPrivileges ( const std : : string & dbname , <nl> + const BSONObj & cmdObj , <nl> + std : : vector < Privilege > * out ) { <nl> + / / Should never get here because this command shouldn ' t get registered when auth is <nl> + / / enabled <nl> + verify ( 0 ) ; <nl> + } <nl> CmdClone ( ) : Command ( " clone " ) { } <nl> virtual bool run ( const string & dbname , BSONObj & cmdObj , int , string & errmsg , BSONObjBuilder & result , bool fromRepl ) { <nl> string from = cmdObj . getStringField ( " clone " ) ; <nl> namespace mongo { <nl> return rval ; <nl> <nl> } <nl> - } cmdclone ; <nl> + } ; <nl> <nl> + / / Note : doesn ' t work with authentication enabled <nl> class CmdCloneCollection : public Command { <nl> public : <nl> virtual bool slaveOk ( ) const { <nl> namespace mongo { <nl> } <nl> virtual LockType locktype ( ) const { return NONE ; } <nl> CmdCloneCollection ( ) : Command ( " cloneCollection " ) { } <nl> + virtual void addRequiredPrivileges ( const std : : string & dbname , <nl> + const BSONObj & cmdObj , <nl> + std : : vector < Privilege > * out ) { <nl> + / / Should never get here because this command shouldn ' t get registered when auth is <nl> + / / enabled <nl> + verify ( 0 ) ; <nl> + } <nl> virtual void help ( stringstream & help ) const { <nl> help < < " { cloneCollection : < collection > , from : < host > [ , query : < query_filter > ] [ , copyIndexes : < bool > ] } " <nl> " \ nCopies a collection from one server to another . Do not use on a single server as the destination " <nl> namespace mongo { <nl> <nl> return c . copyCollection ( collection , query , errmsg , true , false , copyIndexes ) ; <nl> } <nl> - } cmdclonecollection ; <nl> + } ; <nl> <nl> <nl> / / SERVER - 4328 todo review for concurrency <nl> thread_specific_ptr < DBClientConnection > authConn_ ; <nl> / * Usage : <nl> admindb . $ cmd . findOne ( { copydbgetnonce : 1 , fromhost : < hostname > } ) ; <nl> + Note : doesn ' t work with authentication enabled <nl> * / <nl> class CmdCopyDbGetNonce : public Command { <nl> public : <nl> namespace mongo { <nl> return false ; <nl> } <nl> virtual LockType locktype ( ) const { return WRITE ; } <nl> + virtual void addRequiredPrivileges ( const std : : string & dbname , <nl> + const BSONObj & cmdObj , <nl> + std : : vector < Privilege > * out ) { <nl> + / / Should never get here because this command shouldn ' t get registered when auth is <nl> + / / enabled <nl> + verify ( 0 ) ; <nl> + } <nl> virtual void help ( stringstream & help ) const { <nl> help < < " get a nonce for subsequent copy db request from secure server \ n " ; <nl> help < < " usage : { copydbgetnonce : 1 , fromhost : < hostname > } " ; <nl> namespace mongo { <nl> result . appendElements ( ret ) ; <nl> return true ; <nl> } <nl> - } cmdcopydbgetnonce ; <nl> + } ; <nl> <nl> / * Usage : <nl> admindb . $ cmd . findOne ( { copydb : 1 , fromhost : < hostname > , fromdb : < db > , todb : < db > [ , username : < username > , nonce : < nonce > , key : < key > ] } ) ; <nl> + Note : doesn ' t work with authentication enabled <nl> * / <nl> class CmdCopyDb : public Command { <nl> public : <nl> namespace mongo { <nl> return false ; <nl> } <nl> virtual LockType locktype ( ) const { return NONE ; } <nl> + virtual void addRequiredPrivileges ( const std : : string & dbname , <nl> + const BSONObj & cmdObj , <nl> + std : : vector < Privilege > * out ) { <nl> + / / Should never get here because this command shouldn ' t get registered when auth is <nl> + / / enabled <nl> + verify ( 0 ) ; <nl> + } <nl> virtual void help ( stringstream & help ) const { <nl> help < < " copy a database from another host to this host \ n " ; <nl> help < < " usage : { copydb : 1 , fromhost : < hostname > , fromdb : < db > , todb : < db > [ , slaveOk : < bool > , username : < username > , nonce : < nonce > , key : < key > ] } " ; <nl> namespace mongo { <nl> bool res = c . go ( fromhost . c_str ( ) , errmsg , fromdb , / * logForReplication = * / ! fromRepl , slaveOk , / * replauth * / false , / * snapshot * / true , / * mayYield * / true , / * mayBeInterrupted * / false ) ; <nl> return res ; <nl> } <nl> - } cmdcopydb ; <nl> + } ; <nl> + <nl> + / / This will be registered instead of the real implementations of any commands that don ' t work <nl> + / / when auth is enabled . <nl> + class NotWithAuthCmd : public Command { <nl> + public : <nl> + NotWithAuthCmd ( const char * cmdName ) : Command ( cmdName ) { } <nl> + virtual bool slaveOk ( ) const { return true ; } <nl> + virtual LockType locktype ( ) const { return NONE ; } <nl> + virtual bool requiresAuth ( ) { return false ; } <nl> + virtual void addRequiredPrivileges ( const std : : string & dbname , <nl> + const BSONObj & cmdObj , <nl> + std : : vector < Privilege > * out ) { } <nl> + virtual void help ( stringstream & help ) const { <nl> + help < < name < < " is not supported when running with authentication enabled " ; <nl> + } <nl> + virtual bool run ( const string & , <nl> + BSONObj & cmdObj , <nl> + int , <nl> + string & errmsg , <nl> + BSONObjBuilder & result , <nl> + bool fromRepl ) { <nl> + errmsg = name + " is not supported when running with authentication enabled " ; <nl> + return false ; <nl> + } <nl> + } ; <nl> + <nl> + MONGO_INITIALIZER ( RegisterGodInsertCmd ) ( InitializerContext * context ) { <nl> + if ( noauth ) { <nl> + / / Leaked intentionally : a Command registers itself when constructed . <nl> + new CmdClone ( ) ; <nl> + new CmdCloneCollection ( ) ; <nl> + new CmdCopyDb ( ) ; <nl> + new CmdCopyDbGetNonce ( ) ; <nl> + } else { <nl> + new NotWithAuthCmd ( " clone " ) ; <nl> + new NotWithAuthCmd ( " cloneCollection " ) ; <nl> + new NotWithAuthCmd ( " copydb " ) ; <nl> + new NotWithAuthCmd ( " copydbgetnonce " ) ; <nl> + } <nl> + return Status : : OK ( ) ; <nl> + } <nl> + <nl> <nl> class CmdRenameCollection : public Command { <nl> public : <nl>
SERVER - 7122 Make cloning commands not work with auth is enabled
mongodb/mongo
ef198e0c58f709760c01fb0d44e01de9e67e788c
2012-12-05T22:35:28Z
mmm a / tensorflow / python / saved_model / nested_structure_coder . py <nl> ppp b / tensorflow / python / saved_model / nested_structure_coder . py <nl> def can_decode ( self , value ) : <nl> return value . HasField ( " tensor_spec_value " ) <nl> <nl> def do_decode ( self , value , decode_fn ) : <nl> + name = value . tensor_spec_value . name <nl> return tensor_spec . TensorSpec ( <nl> shape = decode_fn ( <nl> struct_pb2 . StructuredValue ( <nl> def do_decode ( self , value , decode_fn ) : <nl> dtype = decode_fn ( <nl> struct_pb2 . StructuredValue ( <nl> tensor_dtype_value = value . tensor_spec_value . dtype ) ) , <nl> - name = value . tensor_spec_value . name ) <nl> + name = ( name if name else None ) ) <nl> <nl> <nl> StructureCoder . register_codec ( _TensorSpecCodec ( ) ) <nl> mmm a / tensorflow / python / saved_model / nested_structure_coder_test . py <nl> ppp b / tensorflow / python / saved_model / nested_structure_coder_test . py <nl> def testEncodeDecodeTensorSpec ( self ) : <nl> decoded = self . _coder . decode_proto ( encoded ) <nl> self . assertEqual ( structure , decoded ) <nl> <nl> + def testEncodeDecodeTensorSpecWithNoName ( self ) : <nl> + structure = [ tensor_spec . TensorSpec ( [ 1 , 2 , 3 ] , dtypes . int64 ) ] <nl> + self . assertTrue ( self . _coder . can_encode ( structure ) ) <nl> + encoded = self . _coder . encode_structure ( structure ) <nl> + expected = struct_pb2 . StructuredValue ( ) <nl> + expected_list = expected . list_value <nl> + expected_tensor_spec = expected_list . values . add ( ) . tensor_spec_value <nl> + expected_tensor_spec . shape . dim . add ( ) . size = 1 <nl> + expected_tensor_spec . shape . dim . add ( ) . size = 2 <nl> + expected_tensor_spec . shape . dim . add ( ) . size = 3 <nl> + expected_tensor_spec . name = " " <nl> + expected_tensor_spec . dtype = dtypes . int64 . as_datatype_enum <nl> + self . assertEqual ( expected , encoded ) <nl> + decoded = self . _coder . decode_proto ( encoded ) <nl> + self . assertEqual ( structure , decoded ) <nl> + <nl> def testNotEncodable ( self ) : <nl> <nl> class NotEncodable ( object ) : <nl>
In NestedStructureCoder : fixed bug where a TensorSpec with name = None would get deserialized with name = ' ' .
tensorflow/tensorflow
d1a7879a2590b05191da86b4989e502e70e9d0e3
2019-07-11T15:26:43Z
mmm a / bin / import_lingua_libre . py <nl> ppp b / bin / import_lingua_libre . py <nl> def handle_args ( ) : <nl> ALPHABET = Alphabet ( CLI_ARGS . filter_alphabet ) if CLI_ARGS . filter_alphabet else None <nl> <nl> bogus_regexes = [ ] <nl> - for line in CLI_ARGS . bogus_records : <nl> - bogus_regexes . append ( re . compile ( line . strip ( ) ) ) <nl> + if CLI_ARGS . bogus_records : <nl> + for line in CLI_ARGS . bogus_records : <nl> + bogus_regexes . append ( re . compile ( line . strip ( ) ) ) <nl> <nl> def record_filter ( path ) : <nl> if any ( regex . match ( path ) for regex in bogus_regexes ) : <nl>
Do not fail without - - bogus - records
mozilla/DeepSpeech
32a73b7224c6037024cae1d41103e40af88767dd
2019-06-05T14:04:45Z
new file mode 100644 <nl> index 000000000 . . 7c51d7468 <nl> mmm / dev / null <nl> ppp b / files / LaunchDaemons / org . pqrs . karabiner . karabiner_observer . plist <nl> <nl> + < ? xml version = " 1 . 0 " encoding = " UTF - 8 " ? > <nl> + < ! DOCTYPE plist PUBLIC " - / / Apple Computer / / DTD PLIST 1 . 0 / / EN " " http : / / www . apple . com / DTDs / PropertyList - 1 . 0 . dtd " > <nl> + < plist version = " 1 . 0 " > <nl> + < dict > <nl> + < key > Label < / key > <nl> + < string > org . pqrs . karabiner . karabiner_observer < / string > <nl> + < key > Disabled < / key > <nl> + < false / > <nl> + < key > KeepAlive < / key > <nl> + < true / > <nl> + < key > ProgramArguments < / key > <nl> + < array > <nl> + < string > / Library / Application Support / org . pqrs / Karabiner - Elements / bin / karabiner_observer < / string > <nl> + < / array > <nl> + < / dict > <nl> + < / plist > <nl> mmm a / make - package . sh <nl> ppp b / make - package . sh <nl> mkdir - p " $ basedir " <nl> cp src / bin / cli / build_xcode / build / Release / karabiner_cli " $ basedir " <nl> cp src / core / console_user_server / build_xcode / build / Release / karabiner_console_user_server " $ basedir " <nl> cp src / core / grabber / build_xcode / build / Release / karabiner_grabber " $ basedir " <nl> + cp src / core / observer / build_xcode / build / Release / karabiner_observer " $ basedir " <nl> <nl> basedir = " pkgroot / Library / Application Support / org . pqrs / Karabiner - Elements / updater " <nl> mkdir - p " $ basedir " <nl> mmm a / pkginfo / Scripts / postinstall <nl> ppp b / pkginfo / Scripts / postinstall <nl> PATH = / bin : / sbin : / usr / bin : / usr / sbin ; export PATH <nl> # Relaunch karabiner_grabber <nl> <nl> killall karabiner_grabber <nl> + killall karabiner_observer <nl> killall karabiner_console_user_server <nl> <nl> # If plistFilePath is already bootstrapped and disabled , launchctl bootstrap will fail until it is enabled again . <nl> launchctl enable system / org . pqrs . karabiner . karabiner_grabber <nl> launchctl bootstrap system / Library / LaunchDaemons / org . pqrs . karabiner . karabiner_grabber . plist <nl> launchctl enable system / org . pqrs . karabiner . karabiner_grabber <nl> <nl> + launchctl enable system / org . pqrs . karabiner . karabiner_observer <nl> + launchctl bootstrap system / Library / LaunchDaemons / org . pqrs . karabiner . karabiner_observer . plist <nl> + launchctl enable system / org . pqrs . karabiner . karabiner_observer <nl> + <nl> exit 0 <nl> mmm a / src / core / observer / include / device_observer . hpp <nl> ppp b / src / core / observer / include / device_observer . hpp <nl> class device_observer final { <nl> device_observer ( const device_observer & ) = delete ; <nl> <nl> device_observer ( void ) { <nl> + grabbable_state_manager_ . grabbable_state_updated . connect ( [ ] ( auto & & registry_entry_id , <nl> + auto & & grabbable_state , <nl> + auto & & ungrabbable_temporarily_reason , <nl> + auto & & time_stamp ) { <nl> + } ) ; <nl> + <nl> hid_manager_ . device_detecting . connect ( [ ] ( auto & & device ) { <nl> if ( iokit_utility : : is_karabiner_virtual_hid_device ( device ) ) { <nl> return false ; <nl> mmm a / src / scripts / uninstall_core . sh <nl> ppp b / src / scripts / uninstall_core . sh <nl> if [ / Library / LaunchDaemons / org . pqrs . karabiner . karabiner_grabber . plist ] ; then <nl> launchctl bootout system / Library / LaunchDaemons / org . pqrs . karabiner . karabiner_grabber . plist <nl> fi <nl> <nl> + if [ / Library / LaunchDaemons / org . pqrs . karabiner . karabiner_observer . plist ] ; then <nl> + launchctl bootout system / Library / LaunchDaemons / org . pqrs . karabiner . karabiner_observer . plist <nl> + fi <nl> + <nl> # mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> # uninstall <nl> bash ' / Library / Application Support / org . pqrs / Karabiner - Elements / scripts / uninstall - Karabiner - VirtualHIDDevice . sh ' <nl> rm - f ' / Library / LaunchDaemons / org . pqrs . karabiner . karabiner_grabber . plist ' <nl> + rm - f ' / Library / LaunchDaemons / org . pqrs . karabiner . karabiner_observer . plist ' <nl> rm - f ' / Library / LaunchAgents / org . pqrs . karabiner . karabiner_console_user_server . plist ' <nl> rm - rf ' / Applications / Karabiner - Elements . app ' <nl> rm - rf ' / Applications / Karabiner - EventViewer . app ' <nl>
add karabiner_observer into package
pqrs-org/Karabiner-Elements
a2d14eb5bfd1a2f59b0bc1db99ccaab1f84bd259
2018-06-21T15:38:58Z