Re: [Zorba-coders] [Merge] lp:~zorba-coders/zorba/skiplimit into lp:zorba
Hi William, I think that count$i-where$i aka offset/limit can be optimized, but in most cases not in terms of subsequence: it sets an offset or a limit on the number of tuples, not on the number of items (a tuple may well produce zero, or more than one item in the end). I think that an early exit, or skipping, in FLWOR iterators should be possible when encountering a count$i-where$i. Markos is probably more familiar with this code than I am though. Does it make sense? -- https://code.launchpad.net/~zorba-coders/zorba/skiplimit/+merge/173126 Your team Zorba Coders is subscribed to branch lp:zorba. -- Mailing list: https://launchpad.net/~zorba-coders Post to : zorba-coders@lists.launchpad.net Unsubscribe : https://launchpad.net/~zorba-coders More help : https://help.launchpad.net/ListHelp
Re: [Zorba-coders] [Merge] lp:~zorba-coders/zorba/skiplimit into lp:zorba
It feels that the current proposal is actually quite efficient and has a predictable performance. But I like the beauty of having the count/where syntactic sugar. So I'm not sure what do to. -- https://code.launchpad.net/~zorba-coders/zorba/skiplimit/+merge/173126 Your team Zorba Coders is subscribed to branch lp:zorba. -- Mailing list: https://launchpad.net/~zorba-coders Post to : zorba-coders@lists.launchpad.net Unsubscribe : https://launchpad.net/~zorba-coders More help : https://help.launchpad.net/ListHelp
[Zorba-coders] [Merge] lp:~zorba-coders/zorba/skip-items into lp:zorba
Nicolae Brinza has proposed merging lp:~zorba-coders/zorba/skip-items into lp:zorba. Commit message: Implemented the Skip-items facility Requested reviews: Nicolae Brinza (nbrinza) For more details, see: https://code.launchpad.net/~zorba-coders/zorba/skip-items/+merge/174723 Implemented the Skip-items facility -- https://code.launchpad.net/~zorba-coders/zorba/skip-items/+merge/174723 Your team Zorba Coders is subscribed to branch lp:zorba. === modified file 'src/functions/func_sequences_impl.cpp' --- src/functions/func_sequences_impl.cpp 2013-05-14 05:21:11 + +++ src/functions/func_sequences_impl.cpp 2013-07-15 10:38:33 + @@ -43,127 +43,6 @@ /*** - -/ -bool rewriteSubsequenceCollection( -static_context* aSctx, -const QueryLoc aLoc, -std::vectorPlanIter_t aArgs, -bool aIsIntSubsequence) -{ - ZorbaCollectionIterator* collIter = - dynamic_castZorbaCollectionIterator*(aArgs[0].getp()); - assert(collIter); - - std::vectorPlanIter_t lCollectionArgs = collIter-getChildren(); - - SingletonIterator* lPosIter = dynamic_castSingletonIterator*(aArgs[1].getp()); - if (lPosIter == NULL) - { -return false; - } - - xs_long pos; - const store::Item_t lPosItem = lPosIter-getValue(); - - try - { -if (aIsIntSubsequence) -{ - pos = lPosItem-getLongValue(); -} -else -{ - xs_double dpos = lPosItem-getDoubleValue().round(); - xs_integer ipos(dpos.getNumber()); - pos = to_xs_long(ipos); -} - } - catch (std::exception const) - { -return false; - } - - if (pos = 1) - { -// if the start position is less than 1 we can't push this down into -// the collection skip parameter because the result won't be equivalent. -return false; - } - - // prepare helper - store::Item_t lItemOne; - GENV_ITEMFACTORY-createInteger(lItemOne, Integer(1)); - - int lNumCollArgs = lCollectionArgs.size(); - if (lNumCollArgs == 1) - { -// argument is of type collection(qname) -// simply move the (pos-1) of subsequence into the skip of -// collection function -// subsequence(collection(qname), 10, 20) -// - subsequence(collection(qname, 10-1), 1, 20) -PlanIter_t lNewCollSkipIter = aArgs[1]; -PlanIter_t lOneIter = new SingletonIterator(aSctx, aLoc, lItemOne); - -lCollectionArgs.push_back( - new NumArithIteratorzorba::SubtractOperation(aSctx, - collIter-getLocation(), - lNewCollSkipIter, - lOneIter) - ); - } - else if (lNumCollArgs = 3 lNumCollArgs != 0) - { -// argument is of type collection(qname,skip) or -// collection(qname,start_uri,skip) -int lSkipPosition = 1; -if (lNumCollArgs == 3) -{ - // collection function with start reference - skip is the 3rd param - lSkipPosition = 2; -} - -// add position-1 of subsequence to collection skip -// subsequence(collection(qname, 10), 10, 20) -// - subsequence(collection(qname, 10+10-1), 10, 20) -PlanIter_t lOldCollSkipIter = lCollectionArgs[lSkipPosition]; -PlanIter_t lOneIter = new SingletonIterator (aSctx, aLoc, lItemOne); -PlanIter_t lSubseqPosIter = aArgs[1]; - -PlanIter_t lCollSkipAdditionIter = -new NumArithIteratorzorba::SubtractOperation(aSctx, - collIter-getLocation(), - lSubseqPosIter, - lOneIter); -lCollectionArgs[lSkipPosition] = -new NumArithIteratorzorba::AddOperation(aSctx, - collIter-getLocation(), - lOldCollSkipIter, - lCollSkipAdditionIter); - } - else - { -// no collection function with 0 or 3 params -assert(false); - } - - aArgs[0] = new ZorbaCollectionIterator(aSctx, - collIter-getLocation(), - lCollectionArgs, - collIter-isDynamic()); - - // after pushing the position param down we need to rewrite the actual - // position to 1: - // subsequence(collection(qname, 10+10-1), 10, 20) - // - subsequence(collection(qname, 10+10-1), 1, 20) - aArgs[1] = new SingletonIterator(aSctx, aLoc, lItemOne); - - return true; -} - - -/*** / xqtref_t fn_unordered::getReturnType(const fo_expr* caller) const { @@ -573,8 +452,7 @@ const QueryLoc aLoc,
[Zorba-coders] [Merge] lp:~zorba-coders/zorba/skip-items into lp:zorba
Validation queue starting for the following merge proposals: https://code.launchpad.net/~zorba-coders/zorba/skip-items/+merge/174723 Progress dashboard at http://jenkins.lambda.nu/view/ValidationQueue -- https://code.launchpad.net/~zorba-coders/zorba/skip-items/+merge/174723 Your team Zorba Coders is subscribed to branch lp:zorba. -- Mailing list: https://launchpad.net/~zorba-coders Post to : zorba-coders@lists.launchpad.net Unsubscribe : https://launchpad.net/~zorba-coders More help : https://help.launchpad.net/ListHelp
[Zorba-coders] [Merge] lp:~paul-lucas/zorba/pjl-misc into lp:zorba
Paul J. Lucas has proposed merging lp:~paul-lucas/zorba/pjl-misc into lp:zorba. Commit message: The JSON parser now reports different start/end line/col for invalid numbers, literals, and string literals. Requested reviews: Paul J. Lucas (paul-lucas) For more details, see: https://code.launchpad.net/~paul-lucas/zorba/pjl-misc/+merge/174785 The JSON parser now reports different start/end line/col for invalid numbers, literals, and string literals. -- https://code.launchpad.net/~paul-lucas/zorba/pjl-misc/+merge/174785 Your team Zorba Coders is subscribed to branch lp:zorba. === modified file 'include/zorba/internal/diagnostic.h' --- include/zorba/internal/diagnostic.h 2013-06-15 18:13:33 + +++ include/zorba/internal/diagnostic.h 2013-07-15 15:07:34 + @@ -17,11 +17,14 @@ #ifndef ZORBA_INTERNAL_DIAGNOSTIC_H #define ZORBA_INTERNAL_DIAGNOSTIC_H +// standard #include string #include vector +// Zorba #include zorba/diagnostic.h +// local #include ztd.h namespace zorba { @@ -177,7 +180,6 @@ /** * Sets the %location information. * - * @param file The name of the file where the error occurred. * @param line The line number of the file where the error occurred. * @param column The column number, if any, of the file where the error * occurred. @@ -185,15 +187,50 @@ * @param column_end The column number, if any, where the error ends. * occurred. */ - void set( char const *file, line_type line, column_type column = 0, -line_type line_end = 0, column_type column_end = 0 ) { -file_ = file; + void set( line_type line, column_type column = 0, line_type line_end = 0, +column_type column_end = 0 ) { line_ = line; column_ = column; line_end_ = line_end; column_end_ = column_end; } + /** + * Sets the %location information. + * + * @param file The name of the file where the error occurred. + * @param line The line number of the file where the error occurred. + * @param column The column number, if any, of the file where the error + * occurred. + * @param line_end The end line of the file where the error occured. + * @param column_end The column number, if any, where the error ends. + * occurred. + */ + void set( char const *file, line_type line, column_type column = 0, +line_type line_end = 0, column_type column_end = 0 ) { +file_ = file; +set( line, column, line_end, column_end ); + } + + /** + * Sets the %location information. + * + * @tparam StringType The string type for \a file. + * @param file The name of the file where the error occurred. + * @param line The line number of the file where the error occurred. + * @param column The column number, if any, of the file where the error + * occurred. + * @param line_end The end line of the file where the error occured. + * @param column_end The column number, if any, where the error ends. + * occurred. + */ + templateclass StringType + typename std::enable_ifZORBA_HAS_C_STR(StringType),void::type + set( StringType const file, line_type line, column_type column = 0, + line_type line_end = 0, column_type column_end = 0 ) { +set( file.c_str(), line, column, line_end, column_end ); + } + private: std::string file_; line_type line_; === modified file 'src/util/json_parser.cpp' --- src/util/json_parser.cpp 2013-06-19 14:39:43 + +++ src/util/json_parser.cpp 2013-07-15 15:07:34 + @@ -193,6 +193,10 @@ /// +inline void lexer::set_loc() { + cur_loc_.set( line_, col_, line_, col_ ); +} + lexer::lexer( istream in ) : in_( in ), line_( 1 ), @@ -221,7 +225,7 @@ bool lexer::next( token *t ) { while ( true ) { -cur_loc_ = cur_loc(); +set_loc(); char c; if ( !get_char( c ) ) return false; @@ -344,7 +348,7 @@ if ( !get_char( c ) || c != *s ) throw illegal_literal( cur_loc_ ); } - if ( peek_char( c ) ascii::is_alnum( c ) ) + if ( peek_char( c ) (ascii::is_alnum( c ) || c == '_') ) throw illegal_literal( cur_loc_ ); return tt; @@ -432,7 +436,7 @@ location const start_loc( cur_loc_ ); while ( true ) { -cur_loc_ = cur_loc(); +set_loc(); char c; if ( !get_char( c ) ) throw unterminated_string( start_loc ); @@ -481,10 +485,12 @@ } void lexer::set_loc( char const *file, line_type line, column_type col ) { - if ( file ) -file_ = file; line_ = line; col_ = col; + if ( file ) { +file_ = file; +cur_loc_.set( file, line_, col_, line_, col_ ); + } } /// === modified file 'src/util/json_parser.h' --- src/util/json_parser.h 2013-06-19 14:39:43 + +++ src/util/json_parser.h 2013-07-15 15:07:34 + @@ -499,16 +499,13 @@ void set_loc( char const *file, line_type line, column_type col ); private: - location
Re: [Zorba-coders] [Merge] lp:~paul-lucas/zorba/pjl-misc into lp:zorba
Review: Approve -- https://code.launchpad.net/~paul-lucas/zorba/pjl-misc/+merge/174785 Your team Zorba Coders is subscribed to branch lp:zorba. -- Mailing list: https://launchpad.net/~zorba-coders Post to : zorba-coders@lists.launchpad.net Unsubscribe : https://launchpad.net/~zorba-coders More help : https://help.launchpad.net/ListHelp
[Zorba-coders] [Merge] lp:~paul-lucas/zorba/pjl-misc into lp:zorba
Validation queue starting for the following merge proposals: https://code.launchpad.net/~paul-lucas/zorba/pjl-misc/+merge/174785 Progress dashboard at http://jenkins.lambda.nu/view/ValidationQueue -- https://code.launchpad.net/~paul-lucas/zorba/pjl-misc/+merge/174785 Your team Zorba Coders is subscribed to branch lp:zorba. -- Mailing list: https://launchpad.net/~zorba-coders Post to : zorba-coders@lists.launchpad.net Unsubscribe : https://launchpad.net/~zorba-coders More help : https://help.launchpad.net/ListHelp
[Zorba-coders] [Merge] lp:~paul-lucas/zorba/pjl-misc into lp:zorba
Validation queue result for https://code.launchpad.net/~paul-lucas/zorba/pjl-misc/+merge/174785 Stage TestZorbaUbuntu failed. 2 tests failed (8344 total tests run). Check test results at http://jenkins.lambda.nu/job/TestZorbaUbuntu/82/testReport/ to view the results. -- https://code.launchpad.net/~paul-lucas/zorba/pjl-misc/+merge/174785 Your team Zorba Coders is subscribed to branch lp:zorba. -- Mailing list: https://launchpad.net/~zorba-coders Post to : zorba-coders@lists.launchpad.net Unsubscribe : https://launchpad.net/~zorba-coders More help : https://help.launchpad.net/ListHelp
[Zorba-coders] [Merge] lp:~zorba-coders/zorba/win64-build into lp:zorba
Chris Hillery has proposed merging lp:~zorba-coders/zorba/win64-build into lp:zorba. Requested reviews: Zorba Coders (zorba-coders) Related bugs: Bug #1151966 in Zorba: 64-bit support on Windows https://bugs.launchpad.net/zorba/+bug/1151966 For more details, see: https://code.launchpad.net/~zorba-coders/zorba/win64-build/+merge/174890 -- https://code.launchpad.net/~zorba-coders/zorba/win64-build/+merge/174890 Your team Zorba Coders is requested to review the proposed merge of lp:~zorba-coders/zorba/win64-build into lp:zorba. === modified file 'src/debugger/socket.h' --- src/debugger/socket.h 2013-02-07 17:24:36 + +++ src/debugger/socket.h 2013-07-15 23:03:33 + @@ -21,12 +21,16 @@ #include zorba/debugger_exception.h -#ifdef WIN32 +#ifdef _WIN64 + typedef unsigned __int64 SOCKET; +#else +#ifdef _WIN32 typedef unsigned int __w64 SOCKET; #else # define INVALID_SOCKET -1 typedef int SOCKET; #endif +#endif namespace zorba { -- Mailing list: https://launchpad.net/~zorba-coders Post to : zorba-coders@lists.launchpad.net Unsubscribe : https://launchpad.net/~zorba-coders More help : https://help.launchpad.net/ListHelp
Re: [Zorba-coders] [Merge] lp:~zorba-coders/zorba/win64-build into lp:zorba
Review: Approve -- https://code.launchpad.net/~zorba-coders/zorba/win64-build/+merge/174890 Your team Zorba Coders is subscribed to branch lp:zorba. -- Mailing list: https://launchpad.net/~zorba-coders Post to : zorba-coders@lists.launchpad.net Unsubscribe : https://launchpad.net/~zorba-coders More help : https://help.launchpad.net/ListHelp
[Zorba-coders] [Merge] lp:~zorba-coders/zorba/python_installer_fix into lp:zorba
Juan Zacarias has proposed merging lp:~zorba-coders/zorba/python_installer_fix into lp:zorba. Commit message: Fix for python installer on Windows. Requested reviews: Juan Zacarias (juan457) Rodolfo Ochoa (rodolfo-ochoa) For more details, see: https://code.launchpad.net/~zorba-coders/zorba/python_installer_fix/+merge/174895 Fix for python installer on Windows. -- https://code.launchpad.net/~zorba-coders/zorba/python_installer_fix/+merge/174895 Your team Zorba Coders is subscribed to branch lp:zorba. === modified file 'swig/python/CMakeLists.txt' --- swig/python/CMakeLists.txt 2013-02-07 17:24:36 + +++ swig/python/CMakeLists.txt 2013-07-16 00:00:41 + @@ -56,6 +56,7 @@ ELSE(NOT WIN32) INSTALL ( FILES ${CMAKE_CURRENT_BINARY_DIR}/_zorba_api.pyd + ${CMAKE_CURRENT_BINARY_DIR}/zorba_api.py DESTINATION share/python COMPONENT python_swig ) ENDIF(NOT WIN32) -- Mailing list: https://launchpad.net/~zorba-coders Post to : zorba-coders@lists.launchpad.net Unsubscribe : https://launchpad.net/~zorba-coders More help : https://help.launchpad.net/ListHelp
Re: [Zorba-coders] [Merge] lp:~zorba-coders/zorba/python_installer_fix into lp:zorba
Review: Approve -- https://code.launchpad.net/~zorba-coders/zorba/python_installer_fix/+merge/174895 Your team Zorba Coders is subscribed to branch lp:zorba. -- Mailing list: https://launchpad.net/~zorba-coders Post to : zorba-coders@lists.launchpad.net Unsubscribe : https://launchpad.net/~zorba-coders More help : https://help.launchpad.net/ListHelp
Re: [Zorba-coders] [Merge] lp:~zorba-coders/zorba/win64-build into lp:zorba
Review: Approve -- https://code.launchpad.net/~zorba-coders/zorba/win64-build/+merge/174890 Your team Zorba Coders is subscribed to branch lp:zorba. -- Mailing list: https://launchpad.net/~zorba-coders Post to : zorba-coders@lists.launchpad.net Unsubscribe : https://launchpad.net/~zorba-coders More help : https://help.launchpad.net/ListHelp
Re: [Zorba-coders] [Merge] lp:~zorba-coders/zorba/python_installer_fix into lp:zorba
Review: Approve -- https://code.launchpad.net/~zorba-coders/zorba/python_installer_fix/+merge/174895 Your team Zorba Coders is subscribed to branch lp:zorba. -- Mailing list: https://launchpad.net/~zorba-coders Post to : zorba-coders@lists.launchpad.net Unsubscribe : https://launchpad.net/~zorba-coders More help : https://help.launchpad.net/ListHelp
[Zorba-coders] [Merge] lp:~paul-lucas/zorba/pjl-misc into lp:zorba
Validation queue starting for the following merge proposals: https://code.launchpad.net/~paul-lucas/zorba/pjl-misc/+merge/174785 Progress dashboard at http://jenkins.lambda.nu/view/ValidationQueue -- https://code.launchpad.net/~paul-lucas/zorba/pjl-misc/+merge/174785 Your team Zorba Coders is subscribed to branch lp:zorba. -- Mailing list: https://launchpad.net/~zorba-coders Post to : zorba-coders@lists.launchpad.net Unsubscribe : https://launchpad.net/~zorba-coders More help : https://help.launchpad.net/ListHelp
[Zorba-coders] [Merge] lp:~paul-lucas/zorba/pjl-misc into lp:zorba
Voting criteria failed for the following merge proposals: https://code.launchpad.net/~paul-lucas/zorba/pjl-misc/+merge/174785 : Votes: {'Approve': 1, 'Pending': 1} -- https://code.launchpad.net/~paul-lucas/zorba/pjl-misc/+merge/174785 Your team Zorba Coders is subscribed to branch lp:zorba. -- Mailing list: https://launchpad.net/~zorba-coders Post to : zorba-coders@lists.launchpad.net Unsubscribe : https://launchpad.net/~zorba-coders More help : https://help.launchpad.net/ListHelp
[Zorba-coders] [Merge] lp:~paul-lucas/zorba/pjl-misc into lp:zorba
Validation queue result for https://code.launchpad.net/~paul-lucas/zorba/pjl-misc/+merge/174785 Stage CommitZorba failed. Check console output at http://jenkins.lambda.nu/job/CommitZorba/32/console to view the results. -- https://code.launchpad.net/~paul-lucas/zorba/pjl-misc/+merge/174785 Your team Zorba Coders is subscribed to branch lp:zorba. -- Mailing list: https://launchpad.net/~zorba-coders Post to : zorba-coders@lists.launchpad.net Unsubscribe : https://launchpad.net/~zorba-coders More help : https://help.launchpad.net/ListHelp
Re: [Zorba-coders] [Merge] lp:~zorba-coders/zorba/fix-basename-tests into lp:zorba
Review: Approve -- https://code.launchpad.net/~zorba-coders/zorba/fix-basename-tests/+merge/174117 Your team Zorba Coders is subscribed to branch lp:zorba. -- Mailing list: https://launchpad.net/~zorba-coders Post to : zorba-coders@lists.launchpad.net Unsubscribe : https://launchpad.net/~zorba-coders More help : https://help.launchpad.net/ListHelp
[Zorba-coders] [Merge] lp:~zorba-coders/zorba/fix-basename-tests into lp:zorba
Validation queue starting for the following merge proposals: https://code.launchpad.net/~zorba-coders/zorba/fix-basename-tests/+merge/174117 Progress dashboard at http://jenkins.lambda.nu/view/ValidationQueue -- https://code.launchpad.net/~zorba-coders/zorba/fix-basename-tests/+merge/174117 Your team Zorba Coders is subscribed to branch lp:zorba. -- Mailing list: https://launchpad.net/~zorba-coders Post to : zorba-coders@lists.launchpad.net Unsubscribe : https://launchpad.net/~zorba-coders More help : https://help.launchpad.net/ListHelp
[Zorba-coders] [Merge] lp:~zorba-coders/zorba/fix-basename-tests into lp:zorba
Validation queue succeeded - proposal merged! -- https://code.launchpad.net/~zorba-coders/zorba/fix-basename-tests/+merge/174117 Your team Zorba Coders is subscribed to branch lp:zorba. -- Mailing list: https://launchpad.net/~zorba-coders Post to : zorba-coders@lists.launchpad.net Unsubscribe : https://launchpad.net/~zorba-coders More help : https://help.launchpad.net/ListHelp
[Zorba-coders] [Merge] lp:~zorba-coders/zorba/fix-basename-tests into lp:zorba
The proposal to merge lp:~zorba-coders/zorba/fix-basename-tests into lp:zorba has been updated. Status: Needs review = Merged For more details, see: https://code.launchpad.net/~zorba-coders/zorba/fix-basename-tests/+merge/174117 -- https://code.launchpad.net/~zorba-coders/zorba/fix-basename-tests/+merge/174117 Your team Zorba Coders is subscribed to branch lp:zorba. -- Mailing list: https://launchpad.net/~zorba-coders Post to : zorba-coders@lists.launchpad.net Unsubscribe : https://launchpad.net/~zorba-coders More help : https://help.launchpad.net/ListHelp