Contribute to Open Source. Search issue labels to find the right project for you!

Update to Catch instead of UnitTest-cpp

Microsoft/GSL

I have an updated Travis CI script that adds Clang Format, Clang 3.9, Clang 4.0, and Git Check. Apparently, Clang 3.9 and Clang 4.0 have been broken for some time now as UnitTest-cpp segfaults with these compilers on it’s own unit tests.

To add to the issues with UnitTest-cpp, on my own project, UnitTest-cpp cannot compile at all on Cygwin, which means neither can the GSL which prevents automated testing with the GSL on AppVeyor Cygwin builds. We currently patch the GSL to remove UnitTest-cpp so that the GSL works in all environments (GCC, Clang, Cygwin and Windows).

The simple solution is to move to Catch.hpp which is a simple, header only library that works in all of these environments. Furthermore, the syntax is very similar to UnitTest-cpp, so the diff will not be that large. Catch.hpp is also a much larger project with regular updates, while UnitTest-cpp hasn’t been updated in 3 months.

My Proposal: - PR#1: Move to Catch.cpp, update unit tests - PR#2: Update Travis CI script

I already have PR#2 done, but I don’t want to start PR#1 without a blessing from @neilmacintosh

Updated 26/04/2017 00:19 10 Comments

Game Poker & Domino QQ - User Buy in được giá trị nhiều hơn max của room.

nguyenphuquang/cardgame

Trước lúc start lại sever, các User đã có chơi vài game. Sau khi start lại sever, các User đăng nhập -> game -> buy in. Bug: số chip buy in được > buy in max của room.

Với 2 bản report bên dưới, 2 account VN-test06 và vn-test07 đã đều buy in 1k chip, Sau khi hoàn thành xong 1 game với time hơn 20s, 2 account trên sell lần lượt 2k747 và 5k022 chip. sau_start_sv Trong khi report game này, vn-test chỉ win của VN-test06 100 chip. game_detail

Updated 20/04/2017 10:25

Game Poker & Domino QQ - 2 User cùng chọn 1 seat nhưng khác thời điểm buy in.

nguyenphuquang/cardgame

2 User khác thời điểm buy in là 1. BuyIn bình thường. - Người còn lại BuyIn vào khoảng thời gian end game. Bug: Start game tiếp theo thì cả 3 User đều nhận được card và bet bình thường.

Video: https://drive.google.com/open?id=0B1NczfWkep_qQVBOc1NUZjBMZmM

  • Tương tự với thời điểm Start game, bug cũng xảy ra.

buy_in

Updated 21/04/2017 06:59

Make install will also install UnitTest++

Microsoft/GSL

Currently, if you run make install it will also install UnitTest++. AFAIU every install command in a cmake file is run during install. There is no way to select which one to install. Since GSL adds UnitTest++ through a subfolder and UnitTest++ has an install command it will also get installed.

I will try to patch the UnitTest++ cmake file to avoid this.

[ 32%] Built target UnitTest++
[ 35%] Built target algorithm_tests
[ 38%] Built target multi_span_tests
[ 41%] Built target span_tests
[ 44%] Built target strided_span_tests
[ 47%] Built target string_span_tests
[ 50%] Built target at_tests
[ 52%] Built target bounds_tests
[ 55%] Built target byte_tests
[ 58%] Built target owner_tests
[ 61%] Built target notnull_tests
[ 64%] Built target assertion_tests
[ 67%] Built target utils_tests
[100%] Built target TestUnitTest++
Install the project...
-- Install configuration: ""
-- Installing: /mnt/c/Users/Mac/GitHub/GSL/build_linux/include/gsl
-- Installing: /mnt/c/Users/Mac/GitHub/GSL/build_linux/include/gsl/gsl
-- Installing: /mnt/c/Users/Mac/GitHub/GSL/build_linux/include/gsl/gsl_algorithm
-- Installing: /mnt/c/Users/Mac/GitHub/GSL/build_linux/include/gsl/gsl_assert
-- Installing: /mnt/c/Users/Mac/GitHub/GSL/build_linux/include/gsl/gsl_byte
-- Installing: /mnt/c/Users/Mac/GitHub/GSL/build_linux/include/gsl/gsl_util
-- Installing: /mnt/c/Users/Mac/GitHub/GSL/build_linux/include/gsl/multi_span
-- Installing: /mnt/c/Users/Mac/GitHub/GSL/build_linux/include/gsl/span
-- Installing: /mnt/c/Users/Mac/GitHub/GSL/build_linux/include/gsl/string_span
-- Installing: /mnt/c/Users/Mac/GitHub/GSL/build_linux/lib/libUnitTest++.a
-- Installing: /mnt/c/Users/Mac/GitHub/GSL/build_linux/include/UnitTest++/AssertException.h
-- Installing: /mnt/c/Users/Mac/GitHub/GSL/build_linux/include/UnitTest++/CheckMacros.h
-- Installing: /mnt/c/Users/Mac/GitHub/GSL/build_linux/include/UnitTest++/Checks.h
-- Installing: /mnt/c/Users/Mac/GitHub/GSL/build_linux/include/UnitTest++/CompositeTestReporter.h
-- Installing: /mnt/c/Users/Mac/GitHub/GSL/build_linux/include/UnitTest++/Config.h
-- Installing: /mnt/c/Users/Mac/GitHub/GSL/build_linux/include/UnitTest++/CurrentTest.h
-- Installing: /mnt/c/Users/Mac/GitHub/GSL/build_linux/include/UnitTest++/DeferredTestReporter.h
-- Installing: /mnt/c/Users/Mac/GitHub/GSL/build_linux/include/UnitTest++/DeferredTestResult.h
-- Installing: /mnt/c/Users/Mac/GitHub/GSL/build_linux/include/UnitTest++/ExceptionMacros.h
-- Installing: /mnt/c/Users/Mac/GitHub/GSL/build_linux/include/UnitTest++/ExecuteTest.h
-- Installing: /mnt/c/Users/Mac/GitHub/GSL/build_linux/include/UnitTest++/HelperMacros.h
-- Installing: /mnt/c/Users/Mac/GitHub/GSL/build_linux/include/UnitTest++/MemoryOutStream.h
-- Installing: /mnt/c/Users/Mac/GitHub/GSL/build_linux/include/UnitTest++/ReportAssert.h
-- Installing: /mnt/c/Users/Mac/GitHub/GSL/build_linux/include/UnitTest++/ReportAssertImpl.h
-- Installing: /mnt/c/Users/Mac/GitHub/GSL/build_linux/include/UnitTest++/RequireMacros.h
-- Installing: /mnt/c/Users/Mac/GitHub/GSL/build_linux/include/UnitTest++/RequiredCheckException.h
-- Installing: /mnt/c/Users/Mac/GitHub/GSL/build_linux/include/UnitTest++/RequiredCheckTestReporter.h
-- Installing: /mnt/c/Users/Mac/GitHub/GSL/build_linux/include/UnitTest++/Test.h
-- Installing: /mnt/c/Users/Mac/GitHub/GSL/build_linux/include/UnitTest++/TestDetails.h
-- Installing: /mnt/c/Users/Mac/GitHub/GSL/build_linux/include/UnitTest++/TestList.h
-- Installing: /mnt/c/Users/Mac/GitHub/GSL/build_linux/include/UnitTest++/TestMacros.h
-- Installing: /mnt/c/Users/Mac/GitHub/GSL/build_linux/include/UnitTest++/TestReporter.h
-- Installing: /mnt/c/Users/Mac/GitHub/GSL/build_linux/include/UnitTest++/TestReporterStdout.h
-- Installing: /mnt/c/Users/Mac/GitHub/GSL/build_linux/include/UnitTest++/TestResults.h
-- Installing: /mnt/c/Users/Mac/GitHub/GSL/build_linux/include/UnitTest++/TestRunner.h
-- Installing: /mnt/c/Users/Mac/GitHub/GSL/build_linux/include/UnitTest++/TestSuite.h
-- Installing: /mnt/c/Users/Mac/GitHub/GSL/build_linux/include/UnitTest++/ThrowingTestReporter.h
-- Installing: /mnt/c/Users/Mac/GitHub/GSL/build_linux/include/UnitTest++/TimeConstraint.h
-- Installing: /mnt/c/Users/Mac/GitHub/GSL/build_linux/include/UnitTest++/TimeHelpers.h
-- Installing: /mnt/c/Users/Mac/GitHub/GSL/build_linux/include/UnitTest++/UnitTest++.h
-- Installing: /mnt/c/Users/Mac/GitHub/GSL/build_linux/include/UnitTest++/UnitTestPP.h
-- Installing: /mnt/c/Users/Mac/GitHub/GSL/build_linux/include/UnitTest++/XmlTestReporter.h
-- Installing: /mnt/c/Users/Mac/GitHub/GSL/build_linux/include/UnitTest++/Posix/SignalTranslator.h
-- Installing: /mnt/c/Users/Mac/GitHub/GSL/build_linux/include/UnitTest++/Posix/TimeHelpers.h
-- Installing: /mnt/c/Users/Mac/GitHub/GSL/build_linux/lib/cmake/UnitTest++/UnitTest++Config.cmake
-- Installing: /mnt/c/Users/Mac/GitHub/GSL/build_linux/lib/cmake/UnitTest++/UnitTest++Targets.cmake
-- Installing: /mnt/c/Users/Mac/GitHub/GSL/build_linux/lib/cmake/UnitTest++/UnitTest++Targets-noconfig.cmake
-- Installing: /mnt/c/Users/Mac/GitHub/GSL/build_linux/lib/pkgconfig/UnitTest++.pc
Updated 29/04/2017 20:58 2 Comments

not_null dereference operator

Microsoft/GSL

Is there a reason why not_null has no dereference operator? It seems like the presence of operator -> should imply that there should be some way to dereference the not_null<T> to get at *T, just like any other pointer type. Or am I missing something?

Updated 19/04/2017 21:21 1 Comments

Change from double to float for floating point values

mikebmcl/io2dts

double is overkill presently and would non-trivially degrade performance on many platforms. There are times when double is the right choice (see, e.g., Random ASCII - Don’t Store That in a Float), but none of the usages in this API appear to meet that criteria. Further, using double rather than float would hurt performance both when using modern GPUs for hardware acceleration and when running on low power, non-freestanding devices.

Updated 14/04/2017 17:46

Avatar - Không thay đổi avatar khi User change image lúc ván bài đang diễn ra.

nguyenphuquang/cardgame

Trên cả 3 game, đang lúc User1 chơi game cùng User khác, thực hiện hành động edit avatar. Sau đó chỉ trên browser của User 1 thay đổi, các User khác không nhận thấy sự thay đổi đó. Riêng game Domino QQ, khi start game tiếp theo, avatar của User1 thì show lại image cũ. Video: https://drive.google.com/open?id=0B1NczfWkep_qTkhqRVdPa19jeDg change01

Updated 14/04/2017 09:08 4 Comments

PHP Warning. WP Debug Enabled

wpbakery/visual-composer-theme

Warning: Missing argument 2 for visualcomposerstarter_give_linked_images_class() in /Users/raitissevelis/Sites/wp-content/themes/visual-composer-theme-ver-1.2/functions.php on line 510

Warning: Missing argument 3 for visualcomposerstarter_give_linked_images_class() in /Users/raitissevelis/Sites/wp-content/themes/visual-composer-theme-ver-1.2/functions.php on line 510

Warning: Missing argument 4 for visualcomposerstarter_give_linked_images_class() in /Users/raitissevelis/Sites/wp-content/themes/visual-composer-theme-ver-1.2/functions.php on line 510

Warning: Missing argument 5 for visualcomposerstarter_give_linked_images_class() in /Users/raitissevelis/Sites/wp-content/themes/visual-composer-theme-ver-1.2/functions.php on line 510

Warning: Missing argument 6 for visualcomposerstarter_give_linked_images_class() in /Users/raitissevelis/Sites/wp-content/themes/visual-composer-theme-ver-1.2/functions.php on line 510

Warning: Missing argument 7 for visualcomposerstarter_give_linked_images_class() in /Users/raitissevelis/Sites/wp-content/themes/visual-composer-theme-ver-1.2/functions.php on line 510 Art Exhibition of City An art museum or art gallery is a building or space for the exhibition of art, usually visual art. Museums can be public or private, but what distinguishes a museum is the ownership of a collection. Although primarily concerned with providing a space to show works of visual art, art galleries are […]

Updated 19/04/2017 13:31

Clean up clause 5 "Error reporting" and related matters

mikebmcl/io2dts

5/3.3 explicitly references C++14 and uses a section number reference rather than a stable name.

Should 5/3.2 be restricted to throwing only system_error? Also note that it requires (“shall”) implementations to document error causes while 5/4.2, dealing with the same subject matter only strongly recommends (“should”) that they do.

These are just some examples of problems; others undoubtedly exist.

Updated 31/03/2017 22:49

Comparison of not_null<shared_ptr> doesn't compile

Microsoft/GSL

Comparison of not_null’s works for raw pointers, but causes compilation errors for smart pointers such as std::shared_ptr. This makes difficult storing not_null<shared_ptr> in a set or using them as keys in a map. c++ { gsl::not_null<std::shared_ptr<int>> p(std::make_shared<int>(42)); assert(p == p); // does not compile } { int fourtyTwo = 42; gsl::not_null<int*> p(&fourtyTwo); assert(p == p); // ok } The proposed pull request #473 solves this issue by explicitly defining comparison operators.

Updated 02/04/2017 19:32

Popup - Profile User - Tie: dòng biểu diễn số trận hòa của User trong game chạy sai.

nguyenphuquang/cardgame

Đối với game Poker và Domino QQ: Khi ván bài diễn ra có 2 User Hòa nhau thì: - Nếu User đó còn ngồi yên đến khi start game tiếp theo, Tie +1. - Nếu User đó stand up khi đang end game, Tie +0. =>Nên xét khi User đã out room và game đã kết thúc thì thông số vẫn được tính. Đối với game Ceme: khi xảy ra game hòa giữa player với Bandar, Tie không tăng. Nhưng đối với game này sẽ không có trường hợp hòa. Nên dòng Tie nên xóa.

Video: Poker:https://drive.google.com/open?id=0B1NczfWkep_qbDJuaXRTYkljNTA Domino QQ:https://drive.google.com/open?id=0B1NczfWkep_qZXBaNnRGbHppRHc Ceme: https://drive.google.com/open?id=0B1NczfWkep_qVmlZbjdmUWtGeUk (Phút thứ 5:50') Trên nhánh dinosys.mana.vn. (Ceme), trên nhánh New Design với 2 game còn lại.

Updated 29/03/2017 10:30

Game Domino QQ - Game Poker: Time line đang start trước khi card trên tay User show.

nguyenphuquang/cardgame

Khi bắt đầu 1 ván trên cả 2 game (Poker hay Domino QQ), Người chơi phải chờ Dealer chia card, xếp card và show card trên tay User, Nhưng thời gian đã được tính từ lúc dealer chia lá bài đầu tiên. < Game Domino QQ >< Đến lúc VN-test07 trông thấy card trên tay thì đã mất 1 khoảng time nhất định.> < Game Poker >< Cũng giống như vậy nhưng do chạy ít effect hơn nên time ít mất hơn.> start_game

Updated 13/04/2017 09:34 1 Comments

Explore ways to make it easy for people to draw to an existing surface that they control

mikebmcl/io2dts

Right now, the display_surface class displays the results of using this library to users. It does so by doing all of the underlying native work itself, which means it controls things and only allows users to take certain actions.

As some people have mentioned, it would be nice if there was a way to use this library to draw things and then let them output the results to an output “surface” that they already have created and control. I like this idea but for it to be useful, it needs to be (mostly) portable.

My initial thought was a factory function that takes an implementation-defined set of arguments and returns an opaque object that acts as a token. There would then be some sort of standalone draw function that would essentially do a paint operation, taking the token and all the same arguments that surface::paint takes and drawing data accordingly. Then I thought about actually implementing it and… I’m not so sure.

So I’m opening this as an issue with suggestions welcome. I may post this to the LEWG reflector at some point. I need to think about that more before deciding whether to do it. For now, anyone with suggestions, please post them here!

Updated 20/03/2017 21:58

Identify areas that might be extended in the future so they can be made forward-compatible

mikebmcl/io2dts

There was concern that the path item types in the path_data::path_data_types type alias for a variant might need to be extended added to in the future, which would be an ABI break.

For path items, I don’t think it’s a problem since the core set of required instructions for path components is essentially fixed. Though I didn’t think of it at the time, [paths.processing] in the paper itself demonstrates that all of the current path item types can be reduced to a core set of four:

  • move;
  • line;
  • cubic Bezier (or quadratic); and,
  • close path.

All others can be implemented either precisely or within a tolerable margin of error, e.g. Beziers can’t exactly replicate circles or arcs, but they come close enough to be unnoticeable in the context of 2D raster graphics. Indeed, even Beziers could be eliminated though doing everything with Bresenham algorithms would be painful to implement in software.

Regardless, the request was to review the API and identify areas that we will or might want to make extensible so that they can be designed in a way that avoids the need for ABI breaks. Off we go!

Updated 20/03/2017 20:21 1 Comments

Fit box to container

FNNDSC/ami

First of all, thank you for releasing such an impressive viewer!

I need to fit the camera to the containing element, but I can’t find a way to do it. Take for example lesson #3 of your tutorial: how can I set the size of the camera such that it occupies the maximum available space (keeping the proportions, of course…). I played around with zoom but I can’t find a way to determine the zoom factor based on container size.

Updated 27/03/2017 21:27 6 Comments

Compile without exception support

Microsoft/GSL

I am trying to use this in an other project which compiles without exception support.
I would not mind substituting the exceptions with asserts, and let it fire only in debug.

currently I use only the <gsl/span> header, my problem lies in <gsl/gsl_util>.
Could we get something like: ```

if defined ( __cpp_exceptions) || \

    (defined (_MSC_VER) && defined (__CPPUNWIND)) || \
    (defined (__GNUC__) && defined (__EXCEPTIONS))
#define ABORT_THROW (x) throw x

else

#define ABORT_THROW (x) (x, std::abort())

endif

`` and then useABORT_THROW` when needed?

Updated 04/04/2017 21:55 12 Comments

Consider reducing Boolean to Integral

ericniebler/stl2

From LWG Kona review of #155. Boolean is an enormously complicated hunk of specification for what is essentially intended to allow people to return integers from comparison operators in addition to bool. LWG made the suggestion to simply define Boolean as: c++ template <class T> concept bool Boolean() { return Integral<T>(); } which achieves the same goal with two lines of spec. At the very least, it’s a reasonable idea to apply this simplification for the TS and see if anyone complains.

Proposed Resolution

Replace the entire contents of [concepts.lib.compare.boolean] with:

template <class T>
concept bool Boolean() {
  return Integral<T>();
}
Updated 15/03/2017 20:52

Be consistent about explicitly requiring typename constraints

ericniebler/stl2

…in concept definitions. This came up in LWG Kona discussion of D0541R1’s definition of Assignable: c++ template <class T, class U> concept bool Assignable() { return is_lvalue_reference<T>::value && // see below CommonReference< const remove_reference_t<T>&, const remove_reference_t<U>&>() && requires(T t, U&& u) { { t = std::forward<U>(u) } -> Same<T>&&; }; } which forms const remove_reference_t<U>& without any assurance that type is valid (U could be void, for example). In many other places, e.g. Readable, we explicitly require the validity of types despite that substitution failure will handle an ill-formed type similarly. We need to consistently choose one or the other, or at least develop a guideline for when we use which approach.

Updated 15/03/2017 20:45

Writable should work with rvalues

ericniebler/stl2

During LWG Kona review of D0547R1. Writable is defined therein as: c++ template <class Out, class T> concept bool Writable() { return requires(Out& o, T&& t) { *o = std::forward<T>(t); }; } The concept only requires writability for lvalues, but it seems reasonable to require that writability is oblivious to value category.

Proposed Resolution

Wording relative to D0547R1. Change the definition of the concept Writable in [iterators.writable] as follows: diff template <class Out, class T> concept bool Writable() { - return requires(Out& o, T&& t) { - *o = std::forward<T>(t); + return requires(Out& o1, Out&& o2, T&& t) { + *o1 = std::forward<T>(t); + *std::forward<Out>(o2) = std::forward<T>(t); }; }

Updated 15/03/2017 21:26 1 Comments

P0541: basic exception guarantee in counted_iterator's postincrement

ericniebler/stl2

Comment from LWG Kona review:

basic guarantee in counted_iterator’s postincrement and postdecrement. (If that results in inconsistently ordered operations, STL wants a note to explain why.)

These operators are specified to update the count member and then directly return the result of postincrementing/postdecrementing the iterator member. My concern was that the count and iterator members could become desynchronized of the iterator operation throws. We’ve avoided the issue in the past by updating the count after updating the iterator.

The real issue here is that we would like for adaptors to preserve whatever exception guarantee the adapted type provides. This is trivially the case for reverse_iterator, move_iterator, and I think common_iterator, but counted_iterator needs to try a little harder or explicitly warn users that counted_iterator’s postincrement operation for single-pass iterators doesn’t maintain the guarantee of the adapted iterator.

Proposed Resolution

Wording relative to D0541R1. Change the specification of operator++(int): ```diff decltype(auto) operator++(int);

4 Requires: cnt > 0. 5 Effects: Equivalent to:

–cnt -return current++; +try { return current++; } +catch(…) { ++cnt; throw; } ```

Updated 15/03/2017 21:06 3 Comments

Change the name of "implicit expression variants"

ericniebler/stl2

As defined in [concepts.lib.general.equality]/6:

Where a requires-expression declares an expression that is non-modifying for some constant lvalue operand, additional variants of that expression that accept a non-constant lvalue or (possibly constant) rvalue for the given operand are also required except where such an expression variant is explicitly required with differing semantics. Such implicit expression variants must meet the semantic requirements of the declared expression. The extent to which an implementation validates the syntax of these implicit expression variants is unspecified.

LWG in Kona was concerned that the term is confusing now that C++ has std::variant.

While we’re at it, define the new name as a term-of-art since it is used as such elsewhere in [concepts.lib].

Updated 15/03/2017 19:08

Don't try to forbid overloaded & in Destructible

ericniebler/stl2

Per LWG Kona consensus.

Proposed Resolution

(Relative to P0547R0) Change [concepts.lib.object.destructible] as follows:

template <class T>
concept bool Destructible() {
+ return is_nothrow_destructible<T>::value; // see below
- return is_nothrow_destructible<T>::value && // see below
-   requires(T& t, const remove_reference_t<T>& ct) {
-     { &t } -> Same<remove_reference_t<T>*>&&; // not required to be equality preserving
-     { &ct } -> Same<const remove_reference_t<T>*>&&; // not required to be equality preserving
-   };
}

Strike [concepts.lib.object.destructible]/p2 (“The expression requirement &ct …”) and [concepts.lib.object.destructible]/p3 (“n a (possibly const) lvalue t of type…”).

Updated 28/03/2017 18:25 1 Comments

Unreasonably slow

mikebmcl/N3888_RefImpl

I’m developing another graphics library: Anti-Grain Evolution (https://github.com/tyoma/agge). It is based on Maxim Shemanarev’s AGG, but is 3 times faster (and leaner in terms of functionality). So today I performed a simple test and it turns out path drawing in io2d is 6 times slower than I have in AGGE. Should I switch to antialias(io2d::fast) it becomes 3 times slower. But agge always draws in maximum possible quality (it does analytic antialiasing).

This is how I draw path (I eliminated all the obvious memory allocations I could find in the measured interval, surface and spiral are created on resize, but never in drawing cycle):

     timings.clearing += stopwatch(counter);

     _surface->line_width(3);
     _surface->line_cap(io2d::line_cap::butt);
     _surface->line_join(io2d::line_join::miter);
     _surface->stroke(io2d::rgba_color(0.0, 154.0 / 255, 1.0));
     _surface->path(*_spiral);

     timings.rasterization += stopwatch(counter);

Can you tell if I’m doing something wrong or is it just Cairo that is so slow? Being stateful (which is so not C++ish) io2d could make some use of caching, I think…

Below you can see the results are quite similar (all the pixels drawn are within the tolerance of 4 levels), but the timings are hugely different.

cairo-spiral agge-spiral

Updated 10/04/2017 04:35 5 Comments

Add span_iterator overloads for make_span() and subspan()

Microsoft/GSL

Hello,

I often need to search for a value in a span and split where it was found. And I can’t use the standard algorithms such as std::find() because they return a span_iterator… that I can do nothing with!

Therefore I propose to introduce overloads for make_span() and subspan() that allow to write code like that:

void split(span<T> s, T value)
    const auto it = std::find(s.begin(), s.end(), value);

    const span<T> before = make_span(s.begin(), it); // or s.subspan(s.begin(), it);
    const span<T> result = s.subspan(it); // empty if it == s.end()
}

What’s your opinion?

Aurelien

Updated 20/03/2017 17:32 11 Comments

Problems for laravel 4

rmariuzzo/Laravel-JS-Localization

Hello. i have some problems when i updated package. I use laravel 4, and when i tried to generate javascript.js file, using: php artisan lang:js i had an error:

[Exception] /Users/apple/Documents/project/laravel/resources/lang doesn’t exists!

I am not sure, but maybe this depends on line 69 of LaravelJsLocalizationServiceProvider.php file…

Updated 17/03/2017 11:17 4 Comments

After P0547, `const`-qualified iterator types are not Readable or Writable

ericniebler/stl2

Readable requires Movable. const-qualified types are not Movable after P0547. Ouch.

Propose Resolution

Update section “Concept Readable” ([iterators.readable]) as follows (also includes part of the PR for #330):

template <class I>
concept bool Readable() {
- return Movable<I>() && DefaultConstructible<I>() &&
-   requires(const I& i) {
+ return requires {
    typename value_type_t<I>;
    typename reference_t<I>;
    typename rvalue_reference_t<I>;
-   { *i } -> Same<reference_t<I>>;
-   { ranges::iter_move(i) } -> Same<rvalue_reference_t<I>>;
  } &&
  CommonReference<reference_t<I>, value_type_t<I>&>() &&
  CommonReference<reference_t<I>, rvalue_reference_t<I>>() &&
  CommonReference<rvalue_reference_t<I>, const value_type_t<I>&>();
}

Update section “Concept Writable” ([iterators.writable]) as follows:

template <class Out, class T>
concept bool Writable() {
- return Movable<Out>() && DefaultConstructible<Out>() &&
-   requires(Out o, T&& t) {
+ return requires(Out& o, T&& t) {
    *o = std::forward<T>(t); // not required to be equality preserving
  };
}
Updated 04/03/2017 20:38 3 Comments

Disable validation on form.submit

victorjonsson/jQuery-Form-Validator

I intend to use validation library just for validation logic - not for any UI related stuff. I have my own way of displaying errors. So I use form.isValid() to tell if there is errors and that is all I need from the library. But I get UI changes (validation error msg) on the page and form is not submitted when I do form.submit()

How can I disable validation msg from appearing the screen? I do set this in the config, but still get error msg.

        validateOnBlur: false
        showHelpOnFocus: false
        addSuggestions: false
Updated 25/02/2017 10:09 1 Comments

SF.x should there be a rule to avoid transitive standard library includes?

isocpp/CppCoreGuidelines

Would this make a useful rule?

Include the correct header for every standard library component used in the program. Do not rely on transitive inclusion.

I think it stands the chance of being enforceable if a tool knows what header which standard library symbol “officially” belongs to - it’s not that big of a database.

Reasons why this is a problem:

  1. #include <iostream> exposes the definition of std::string (“why?” makes for a fun trivia question), but it is not required to do so by transitively including the entire <string> header, resulting in the popular beginner question “why doesn’t getline(cin, str); work?” or even an occasional “strings cannot be compared with ==, use str.compare” - “yes they can” - “no, it doesn’t compile!”
  2. Lots of real-life code uses size_t without bothering to include one of the six headers where it is guaranteed to be defined. At one point recently gcc’s libstdc++ dropped a transitive inclusion of stddef.h somewhere and dozens of opensource packages failed to compile. As a Gentoo enthusiast, I remember having to patch quite a few of them locally just to update the system compiler.

(not suggesting to apply this to non-standard libraries because of how common it is to have a user-facing header that just further includes fine-grained or implementation-detail headers)

Updated 13/03/2017 18:36 3 Comments

Initialization Explanation

rmariuzzo/Laravel-JS-Localization

Hi!

I have successfully created the messages.js file.

Now I want to use it. However, “Lang” is not recognized. E.g., if I take from the documentation the following (not even using messages.js):

var lang = new Lang({
    messages: {
        'en.greetings': {
            'hi': 'Hi'
        },
    }
});

lang.get('greetings.hi');
// > "Hi"

.. I cannot get any output. Actually the script stops there. I guess, I have make an import or something similar.

Thanks for any help!

Updated 26/02/2017 11:12 3 Comments

dynamic error messages

victorjonsson/jQuery-Form-Validator

Hi there,

I am making a custom validation in my form. based on the conditions i check, i need to provide errorMessage. I tried to make a global variable which i initialized as empty string and assigned message into it as i check conditions but it doesn’t take dynamically. how can i do this…

Updated 10/02/2017 07:28 4 Comments

how can i give separate messages for different validation criterias

victorjonsson/jQuery-Form-Validator

data-validation="length strength" data-validation-length="min6" data-validation-strength="2"

take the above criteria for example… i want to give error message for length only when validation for length is not fullfilled. same case when strength is weak then i want only give message for that. is it possible? if yes can you please give me a hint?

thanks.

Updated 10/02/2017 01:27 1 Comments

recaptcha example

victorjonsson/jQuery-Form-Validator

Hi, please could you provide a full recaptcha example? For me it’s not quite clear how the connection between recaptcha and the validator is. The example on the official website of the form validator is somewhat rudimentary. The official recaptcha docu suggests to put <div class="g-recaptcha" data-sitekey="your_site_key"></div> into the html. The form validator suggests to take <input data-validation="recaptcha" data-validation-recaptcha-sitekey="[RECAPTCHA_SITEKEY]">. But why an input-tag? I can’t get it working as the validator does not notice if the recaptcha is executed or not. As recaptcha is today ‘the way to go’ for good spam control, I would appreciate if you could provide a full featured example. I believe many people could benefit from an example on the official website. Almost all features are really well explained and demonstrated… except the recaptcha feature. all the best… malorus

Updated 22/03/2017 12:21 1 Comments

Restrict alg.general changes from P0370 to apply only to the range-and-a-half algorithms

ericniebler/stl2

..as directed during LWG review of P0370. LWG is uncomfortable with the uncertainty this wording introduces, and would prefer to “limit the scope of the potential damage” to only the deprecated range-and-a-half algorithms.

Proposed resolution

Strike para [alg.general]/12 which begins, “Despite that the algorithm declarations nominally accept parameters by value […]”

This change also requires transform to constrain its function parameter with CopyConstructible as in the proposed resolution of #286.

Updated 05/03/2017 23:30 10 Comments

DerivedFrom should be publicly and unambiguously

ericniebler/stl2

Proposed Resolution

Change [concepts.lib.corelang.derived] as follows:

 template <class T, class U>
 concept bool DerivedFrom() {
-  return see below ;
+  return is_base_of<U, T>::value &&
+    is_convertible<remove_cv_t<T>*, remove_cv_t<U>*>::value; // see below
 }

-1 DerivedFrom<T, U>() is satisfied if and only if is_base_of<U, T>::value is
-  true.
+1 There is no subsumption relationship between DerivedFrom<T, U>() and
+  is_base_of<U, T>::value or is_convertible<remove_cv_t<T>*, remove_cv_t<U>*>::value.
Updated 04/03/2017 03:16 5 Comments

Fork me on GitHub