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

Select Game page - Effect chạy sai khi User chọn 1 game. [New Design]

nguyenphuquang/cardgame

Hiệu ứng Line đèn nháy sáng đã tắt. Khi click chọn 1 game bất kỳ, hiệu ứng chạy sai, logo và chữ không sáng và bật to như trước. Chọn Logo để vào Game Poker, chỉ có tên Game chạy vào giữa còn Logo thì không. Chọn Game Domino QQ, do đã bị sai Logo với Ceme, khi click chọn thì 3 logo game thay đổi thành Logo Game Ceme. Chọn Game Ceme, không thấy chạy effect nào. <Hình ảnh Comment bên dưới mô tả lại Bug>

Updated 27/03/2017 07:00 1 Comments

Game Domino QQ - Xem xét lại con số show trong nút Call.

nguyenphuquang/cardgame

Với 3 Gamer T1 (907), T2 (685), T3 (578) start 1 ván như sau: Round 1 cả 3 bet 10. (T1 còn 897; T2 còn 675; T3 còn 568) Round 2 luân phiên 3 User bet các lượt raise liên tiếp nhau: - T1 bet 10 ; T2 raise 20 ; T3 raise 40 (T1 còn 887; T2 còn 655; T3 còn 528). - T1 raise 80 ; T2 raise 160; T3 raise 320 (T1 còn 807; T2 còn 495; T3 còn ). - T1 raise 640; T2, call_button dù việc T2 còn 495>480 Nhưng nếu nút “Call 480” của T2 trong lượt này được show lên là sai!

Vì T1 đã bỏ ra 10+80+640 = 730 để bet trong round 2; Còn T2= 20+160+480 = 660 < T1 => nút “Call 480” ẩn là đúng! Nhưng phải xem xét lại nếu nút Call trong trường họp này phải show lên con số đúng là 730-180= 550.

Updated 24/03/2017 10:13

Game Poker - Khi end game với trường hợp không show card.

nguyenphuquang/cardgame

Khi end game, với trên bàn các User đã fold => user còn lại duy nhất sẽ là winner. Dù là đường hợp đặc biệt Winner có jackpot hay win side bet thì Card trên bàn và Card trên tay user cũng không cần phải sáng lên như kiểu show combo card win. Tắt bớt hiệu ứng sáng và đẩy card lên trong trường hợp này. end_game

Updated 24/03/2017 10:36 2 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

Find a "library" person to do a read through and provide feedback

mikebmcl/io2dts

This may be going to LWG in the near future. Jeffrey wisely suggested trying to find someone from LWG to read through it and provide feedback so I can make changes that would be obvious (e.g. I learned in Kona that the “shall, should, may” only applies to users and that for implementers/implementations things are phrased it terms of direct verbs, e.g. “Adds the widget to the end of the collection” rather than “The widget shall be added to the end of the collection”. (I started making some of those wording changes in R4 but had to prioritize other issues.)

This doesn’t need to be a full, detailed read-through; whatever time someone can spare, even if it’s just glancing through a few sections of the paper, would be very much appreciated. The hope is to identify obvious wording issues, formatting/structuring problems (e.g. do I have text I intend to be normative in an area that’s considered informative), and other such things (especially those that are repeated a lot), along with suggested fixes (which could be as simple as “look at [something.meow] in the standard to see how to do it right”).

I’ve taken care to be consistent throughout the paper. Here’s a suggested list, but don’t feel obligated to follow it (I’m just posting it as a potential guide based on my knowledge of the paper):

  • A survey of the overall structure of the document;
  • A brief read through Clause 11 - [brushes] (it’s 11 pages but contains examples of pretty much every sort of thing that exists elsewhere in the paper, e.g. enum classes, classes (including ctors that take iterators), and standalone sections that I intend to be normative by referencing them in normative areas later in the clause);
  • Maybe a glance at 10.1 - [paths.processing] - which is intended to be normative (and hopefully is; it’s 10 pages, much of which is an “as-if” code sample, which may or may not raise eyebrows) to let me know if it’s structurally problematic (I wouldn’t actually read the code sample since it wouldn’t make sense without reading a the rest of the paths clause); and,
  • A brief glance through the terms and definitions (I followed the ISO guidance and organized things in a hierarchical fashion rather than alphabetically) for any obvious issues (excluding whether the definitions of the various terms are correct).

The document as a whole is 183 pages. It’s generated from LaTeX and was started from the “framework” that the C++ working draft uses so in that regard it should look familiar.

I’m going to post this (probably edited a bit) to the LWG list. Thanks in advance to any volunteers!

Updated 20/03/2017 21:13

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 22/03/2017 08:17 5 Comments

Registro delle modifiche

Visions-Team/eBread-docs

“La localizzazione delle modifiche effettuate aumenterà specificandola in modo numerico e non narrativo; occorrerà anche migliorarne la tracciabilità rispetto alle decisioni o esigenze di modifica.”

Potremmo associarci un codice per tracciare le modifiche e indicare il numero di pagina delle pagine modificate. Dovrebbe bastare a risolvere.

Updated 17/03/2017 22:57

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 25/03/2017 08:05 9 Comments

List index out of range after restarting PMAN

FNNDSC/ChRIS_ultron_backEnd

Steps to reproduce:

  1. Start PMAN ```

    pman –raw 1 –http –port 5010 –listeners 12 ```

  2. In another terminal start Django server ```

    python manage.py runserver ```

  3. POST to CHRIS to create a FS plugin ```

    http -a user:password POST http://127.0.0.1:8000/api/v1/plugins/1/instances/ Content-Type:application/vnd.collection+json Accept:application/vnd.collection+json template:=‘{“data”:[{“name”:“dir”,“value”:“./”}]}’ ```

  4. Stop PMAN ```

    CTRL+Z ```

  5. Restart PMAN ```

    pman –raw 1 –http –port 5010 –listeners 12 ```

  6. GET to CHRIS to get the FS plugin instance that was just created ```

    http -a user:password http://127.0.0.1:8000/api/v1/plugins/instances/9/ ```

Client message after 6. ``` HTTP/1.0 500 Internal Server Error Content-Type: application/vnd.collection+json Date: Wed, 15 Mar 2017 16:52:34 GMT Server: WSGIServer/0.2 CPython/3.5.2 X-Frame-Options: SAMEORIGIN

{ “collection”: { “error”: { “message”: “Internal server error” }, “href”: “http://127.0.0.1:8000/api/v1/plugins/instances/9/”, “version”: “1.0” } } ```

Server side message after 6. list index out of range [15/Mar/2017 12:52:34] "GET /api/v1/plugins/instances/9/ HTTP/1.1" 500 135

Updated 16/03/2017 15:12 3 Comments

Gift - Một vài trường hợp trong Game Poker và Domino QQ cần điều chỉnh.

nguyenphuquang/cardgame

Domino QQ và Poker đa phần các Gift có kích thước lớn và nào trên che avatar của User trên bàn. Điều chỉnh tạo 1 tọa độ chung cho các gift. chocolate Poker, vài trường hợp nằm ngang với avatar đồng thời che bài trên tay User. giftinpoker giftinpoker01 Đơn cử vị trí đặt hợp lý ở 1 số Gift: Ly Rượu Rock Bar, Chocolate Cupcake, Hot Dog, Rose. Vì chúng ít ảnh hưởng đến avatar của User nhất.

Updated 16/03/2017 11:00

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

Formulario de "Agregar actividad" en el Flujo de publicación no se limpia

SemanticWebBuilder/SWBPortal

Cuando ya se cuenta con una actividad agregada en el flujo de publicación y se abre está actividad y solamente se cierra la ventana desde el icono de “X” y se agrega una nueva desde el botón “Agregar actividad”, la ventana con el formulario se muestra con los datos de la última que se abrió, cuando a la actividad se le da clic en cualquiera de los botones “Aceptar” o “Cancelar” y se quiere agregar una nueva actividad, si se limpia el formulario.

Pasos para replicar la incidencia

Precondiciones: 1.- Se cuenta con un flujo de publicación configurado 2.- El flujo de publicación ya cuenta con una actividad agregada.

Flujo:

1.- En la pestaña de “Diseño” dar clic en el icono de actividad que se muestra en el área de diseño

2017-03-07_174727

2.- Cerrar la actividad desde el icono de “x”

2017-03-07_175430

3.- Dar clic en el botón “Agregar una Actividad”

2017-03-07_174755

Resultado:

La actividad se muestra con los datos definidos anteriormente.

2017-03-07_175509

Updated 08/03/2017 00:14

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

Mouse events should take offsetLeft/Right into account

FNNDSC/ami

The widgets are not always working because the mouse position is not correct: let mouse = { x: ( ( event.clientX - renderer2._container.offsetLeft ) / renderer2._container.clientWidth ) * 2 - 1, y: - ( ( event.clientY - renderer2._container.offsetTop ) / renderer2._container.clientHeight ) * 2 + 1, }; https://github.com/FNNDSC/ami/blob/dev/src/widgets/widgets.handle.js#L145-L146

Updated 31/01/2017 12:24

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

IDSite Timeout Issue

stormpath/idsite-src

If I configure timeout for the IDSite on the Admin Console, that value is not reflected in the live application. Timeout defaults to the default value of 30 minutes regardless of what value I set in the Admin Console.

Updated 19/01/2017 21:17

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

Can't Clone Microsoft/GSL Cleanly

Microsoft/GSL

The version of unittest-cpp has wiki files that have invalid names for the windows platform.

When cloning the repo the files can’t be created on windows which means git reports that the submodule contains changes. This can cause some CI systems to fail as it believes the checkout was unsuccessful. I changed unittest-cpp to have valid wiki page names, but I noticed that the gsl points to the Microsoft/unittest-cpp which is far behind the source repo. I’m not sure what the best way to fix this in the gsl would be, should we just make it point to unittest-cpp/unittest-cpp then advance to the tip? Are there changes in Microsoft/unittest-cpp that are necessary for the gsl? Was it a conscious decision to stay on this specific unittest-cpp hash?

Thanks,

Julien.

Updated 11/01/2017 20:37 2 Comments

What is the correct way to use GSL with VS 2017 RC Core Guideline checker?

Microsoft/GSL

This might not be quite the right place to ask this. Please redirect me if needed. But what it the correct way to use the GSL with VS2017 RC? This a pre-cursor to doing something more useful, we have managed to get permission to move from VS2013 to VS2017 within the year. I am hoping we can introduce GSL and Core Guidelines at the same time. Especially given the build in Core Guidelines Checker.

I have made a super simple win32 console project in visual studio 2017 RC and put it on my github: https://github.com/KrisTC/CoreGuidlinesTestAppVs17Rc

The source file is very simple (and bad): ```

include “stdafx.h”

include <algorithm>

include <gsl/gsl>

int main() { // Super simple bad code :) int p = new int[4]; std::fill(p, p + 4, 0); return p; } I had hoped I would get error about the lack of delete, but I don't. Instead I get the following errors in the GSL: gsl\gsl\string_span(161): warning C26496: Variable len is assigned only once, use const. (con.4: https://go.microsoft.com/fwlink/p/?LinkID=784969) gsl\gsl\string_span(159): warning C26461: The input pointer / reference argument $ReturnUdt in function gsl::ensure_z can be marked as const. (con.3: https://go.microsoft.com/fwlink/p/?LinkID=786684) gsl\gsl\string_span(168): warning C26496: Variable len is assigned only once, use const. (con.4: https://go.microsoft.com/fwlink/p/?LinkID=784969) gsl\gsl\string_span(166): warning C26461: The input pointer / reference argument $ReturnUdt in function gsl::ensure_z can be marked as const. (con.3: https://go.microsoft.com/fwlink/p/?LinkID=786684) gsl\gsl\string_span(175): warning C26496: Variable len is assigned only once, use const. (con.4: https://go.microsoft.com/fwlink/p/?LinkID=784969) gsl\gsl\string_span(173): warning C26461: The input pointer / reference argument $ReturnUdt in function gsl::ensure_z can be marked as const. (con.3: https://go.microsoft.com/fwlink/p/?LinkID=786684) gsl\gsl\string_span(182): warning C26496: Variable len is assigned only once, use const. (con.4: https://go.microsoft.com/fwlink/p/?LinkID=784969) gsl\gsl\string_span(180): warning C26461: The input pointer / reference argument $ReturnUdt in function gsl::ensure_z can be marked as const. (con.3: https://go.microsoft.com/fwlink/p/?LinkID=786684) And this error in my program: coreguidlinestestappvs17rc.cpp(11): warning C26496: Variable p is assigned only once, use const. (con.4: https://go.microsoft.com/fwlink/p/?LinkID=784969) coreguidlinestestappvs17rc.cpp(12): warning C26481: Don’t use pointer arithmetic. Use span instead. (bounds.1: http://go.microsoft.com/fwlink/p/?LinkID=620413) `` This error looks wrong to me, I am assigning to it and I will delete it too so it can't be const. Even if I make the pointer constint* const p = new int[4];` I still get the warning.

If I turn on experimental core guidline checks I also get the error I hoped for: coreguidlinestestappvs17rc.cpp(11): warning C26423: The allocation was not directly assigned to an owner.

Is this a problem in the GSL or the CoreChecker? The “warning C26423: The allocation was not directly assigned to an owner.” check was experimental in VS2015 too will it be non-experimental by VS2017 is released?

Updated 13/01/2017 23:42 5 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

not_null pointer type, and unique/shared constructors

Microsoft/GSL

Two questions: - Why does not_null take a pointer type instead of a non-pointer type like span, unique_ptr and shared_ptr. That is:

auto safe_ptr = gsl::not_null<int *>(ptr) // Currently
auto safe_ptr = gsl::not_null<int>(ptr) // Why not this?
  • Is there a reason there is no constructor for unique_ptr / shared_ptr instead of having to use get()?
Updated 09/02/2017 13:28 11 Comments

Support: Node modules (import/require) for generated file with bundled JS lib

rmariuzzo/Laravel-JS-Localization

ReferenceError: Lang is not defined Lang = new Lang(); This points to the line in package code after the lang.min.js code

Still having this issue after update using laravel, laravel elixir webpack. Am i doing something wrong?

gulpfile looks like this

const elixir = require('laravel-elixir');
const shell = require('gulp-shell');

require('laravel-elixir-webpack-react');

/*
 |--------------------------------------------------------------------------
 | Elixir Asset Management
 |--------------------------------------------------------------------------
 |
 | Elixir provides a clean, fluent API for defining some basic Gulp tasks
 | for your Laravel application. By default, we are compiling the Sass
 | file for our application, as well as publishing vendor resources.
 |
 */

var Task = elixir.Task;
elixir.extend('langjs', function(path) {
    new Task('langjs', function() {
        gulp.src('').pipe(shell('php artisan lang:js ' + (path || 'resources/assets/js/translations.js')));
    });
});

elixir(mix => {
    mix.sass('app.scss')
        .langjs()
        .webpack([
            'translations.js',
            'app.jsx'
        ], 'public/js/app.js')
        .version([
            'css/app.css',
            'js/app.js'
        ]);
});

Then i tryed even import Lang from translations.js in my component without having translations included in gulp file. Both cases same issue.

import Lang from '../../translations.js'
Updated 26/03/2017 10:59 18 Comments

rule suggestion T.12x Avoid recursion in variadic templates

isocpp/CppCoreGuidelines

Practical C++ Metaprogramming by @edouarda and @jfalcou highlighted a point that I think makes a good core guideline: avoid recursion in variadic templates.

This both dramatically improves compilation times and avoids recursive instantiation depth limits. The book talks about using pack expansions and std::index_sequence where possible, but perhaps there could be a note that even when those can’t be used, it is sometimes possible to rewrite recursion to log(n) depth.

Updated 05/02/2017 21:05 7 Comments

GSL as sub-project

Microsoft/GSL

Currently gsl’s CmakeLists.txt doesn’t support it’s addition as a sub-project from another cmake project, is that by design?

If not, adding something like this:

add_library(${PROJECT_NAME} INTERFACE)

target_include_directories(${PROJECT_NAME} INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/gsl)

would make it possible to simply using gsl as follow:

add_subdirectory(GSL);

target_link_libraries(${PROJECT_NAME} GSL)
Updated 01/02/2017 23:50 7 Comments

Feature: Construct span, string_span from iterator range pair (first, last)

Microsoft/GSL

The span classes don’t quite integrate with STL without a range constructor from a pair of iterators. I’m trying to do something like the following…

auto pos = std::search(span.cbegin(), span.cend(), delim.cbegin(), delim.cend());
gsl::cstring_span<> sub(span.cbegin(), pos);

I see that the span classes offer constructors for first and last pointers, but it doesn’t seem like iterators automatically convert to pointers. The subspan() method also falls short here.

Updated 22/02/2017 08:09 3 Comments

Usage documentation for GSL

Microsoft/GSL

In trying to consume the GSL library in some production code (maybe not really recommended yet?), and I’ve found that its a lot more difficult than expected due to the lack of documentation.

I think for the most part the intent of classes like span and byte and things are obvious to those of us interested in gsl. The actual implementation and usage in real code is another story though. The C++ Core Guidelines don’t provide a succinct summary of the classes that they recommend. For example span has 88 mentions, most of which are in “enforcement” blocks, prior to ever defining what a span is. Or more importantly, what it is not. byte isn’t mentioned at all, and I had to read through the issue list pretty closely here to realize there is no practical way to initialize it after beating my head on that problem for a while.

Most of the information on gsl classes can be found, but it’s spread across numerous draft papers, and revisions (or proposed or planned revisions) are not transparent to people outside of the c++ working groups.

I think either the Core Guidelines need a preface for new/proposed classes and their usage, or the gsl implementation library does. Maybe a mix of both. It would be especially helpful if it came with known issues or limitations. Even if the gsl is not supposed to be ‘production ready’ right now, it would be helpful in terms of evaluation and contribution. The answer to #348 may also bring some clarity to this.

Updated 26/02/2017 23:50 5 Comments

Fork me on GitHub