text:
The AST generated by lua-parser seems to have some issue with operators associativity and priority

I was testing lua-parser.lua example and found the following issue with the generated AST: while evaluating the expression 2^3+1 I got 16 as the result when in fact it should be 9.
I used the following dummy code to reproduce this behavior:
local m = require 'lua-parser'

local t = m.parse("return 2^3+1")

local function eval (exp)
  if exp.rule == "exp" then
    if exp[1] then
      local exp1 = eval(exp[1])
      if exp[2] then
         local exp2 = eval(exp[2][2])
         if exp[2][1][1] == '+' then
           return exp1 + exp2
         elseif exp[2][1][1] == '*' then
           return exp1 * exp2
         elseif exp[2][1][1] == '^' then
           return exp1 ^ exp2
         end
      else
        return exp1
      end
    end
  elseif exp.rule == "expTokens" then
    return eval(exp[1])
  elseif exp.rule == "number" then
    return eval(exp[1])
  elseif exp.rule == "INT" then
    return tonumber(exp[1])
  end
end

-- throws away the return statement and only evaluates its expression
print(eval(t[1][1][2][1]))

Am I missing something in the AST or is it a bug?

You can print the generated AST with
local peg = require "peg-parser"
peg.print_t(t)
-- the AST for your example is:
rule='chunk',
{
         rule='block',
         {
                  rule='retstat',
                  'return',
                  {
                           rule='explist',
                           {
                                    rule='exp',
                                    {
                                             rule='expTokens',
                                             {
                                                      rule='number',
                                                      {
                                                               rule='INT',
                                                               '2',
                                                      },
                                             },
                                    },
                                    {
                                             rule='expOps',
                                             {
                                                      rule='operatorPower',
                                                      '^',
                                             },
                                             {
                                                      rule='exp',
                                                      {
                                                               rule='expTokens',
                                                               {
                                                                        rule='number',
                                                                        {
                                                                                rule='INT',
                                                                                '3',
                                                                        },
                                                               },
                                                      },
                                                      {
                                                               rule='expOps',
                                                               {
                                                                        rule='operatorAddSub',
                                                                        '+',
                                                               },
                                                               {
                                                                        rule='exp',
                                                                        {
                                                                                rule='expTokens',
                                                                                {
                                                                                rule='number',
                                                                                {
                                                                                rule='INT',
                                                                                '1',
                                                                                },
                                                                                },
                                                                        },
                                                               },
                                                      },
                                             },
                                    },
                           },
                  },
         },
},

Yes, you are right, the operator association is not good. I will try to fix this when I have some time, if you manage to do it please do a pull request.

Okay, I have fixed the issue. I had to add new rules so you might need to tweak your eval code. Now the AST is more bulky, but the prioritization should be fixed, also associations can now be done by the user. The new AST for your code:
rule='chunk',
{
  rule='block',
  {
    rule='retstat',
    'return',
    {
      rule='explist',
      {
        rule='exp',
        {
          rule='expOR',
          {
            rule='expAND',
            {
              rule='expREL',
              {
                rule='expBIT',
                {
                  rule='expCAT',
                  {
                    rule='expADD',
                    {
                      rule='expMUL',
                      {
                        rule='expUNA',
                        {
                          rule='expPOW',
                          {
                            rule='expTokens',
                            {
                              rule='number',
                              {
                                rule='INT',
                                '2',
                              },
                            },
                          },
                          {
                            rule='operatorPower',
                            '^',
                          },
                          {
                            rule='expUNA',
                            {
                              rule='expPOW',
                              {
                                rule='expTokens',
                                {
                                  rule='number',
                                  {
                                    rule='INT',
                                    '3',
                                  },
                                },
                              },
                            },
                          },
                        },
                      },
                    },
                    {
                      rule='operatorAddSub',
                      '+',
                    },
                    {
                      rule='expMUL',
                      {
                        rule='expUNA',
                        {
                          rule='expPOW',
                          {
                            rule='expTokens',
                            {
                              rule='number',
                              {
                                rule='INT',
                                '1',
                              },
                            },
                          },
                        },
                      },
                    },
                  },
                },
              },
            },
          },
        },
      },
    },
  },
},

Thanks for the report.

Okay, I have fixed the issue. I had to add new rules so you might need to tweak your eval code.

Cool! It looks like it is working. Here is my dummy eval after your fix:
local m = require 'lua-parser'

local t = m.parse("return 2^3+1")

local function eval (exp)
  if string.find(exp.rule, "^exp") then
    local r = eval(exp[1])
    for i=2,#exp,2 do
      if exp[i][1] == '+' then
        r = r + eval(exp[i+1])
      elseif exp[i][1] == '*' then
        r = r * eval(exp[i+1])
      elseif exp[i][1] == '^' then
        r = r ^ eval(exp[i+1])
      end
    end
    return r
  elseif exp.rule == "expTokens" then
    return eval(exp[1])
  elseif exp.rule == "number" then
    return eval(exp[1])
  elseif exp.rule == "INT" then
    return tonumber(exp[1])
  end
end

-- throws away the return statement and only evaluates its expression
print(eval(t[1][1][2][1]))

Actually I'm working on reducing the AST size, should be finished today.

I believe that you can fold the expression nodes while you generate the AST, and while folding maybe you can reduce the size of the expression nodes inside the generated AST.

authors: andremm vsbenas

repo: vsbenas/parser-gen


text:
Prevent StringIndexOutOfBounds in ext-resizable-image

Before this fix, input string This is a test! would throw:
java.lang.StringIndexOutOfBoundsException: String index: 16 out of range: [0, 16)
	at com.vladsch.flexmark.util.sequence.SequenceUtils.validateIndex(SequenceUtils.java:1143) ~[flexmark-util-sequence-0.64.0.jar:na]
	at com.vladsch.flexmark.util.sequence.SubSequence.charAt(SubSequence.java:113) ~[flexmark-util-sequence-0.64.0.jar:na]
	at com.vladsch.flexmark.ext.resizable.image.internal.ResizableImageInlineParserExtension.parse(ResizableImageInlineParserExtension.java:38) ~[classes/:na]
	at com.vladsch.flexmark.parser.internal.InlineParserImpl.parseInline(InlineParserImpl.java:368) ~[flexmark-0.64.0.jar:na]
	at com.vladsch.flexmark.parser.internal.InlineParserImpl.parse(InlineParserImpl.java:169) ~[flexmark-0.64.0.jar:na]
	at com.vladsch.flexmark.parser.core.ParagraphParser.parseInlines(ParagraphParser.java:64) ~[flexmark-0.64.0.jar:na]
	at com.vladsch.flexmark.parser.internal.DocumentParser.processInlines(DocumentParser.java:750) ~[flexmark-0.64.0.jar:na]
	at com.vladsch.flexmark.parser.internal.DocumentParser.finalizeAndProcess(DocumentParser.java:1005) ~[flexmark-0.64.0.jar:na]
	at com.vladsch.flexmark.parser.internal.DocumentParser.parse(DocumentParser.java:312) ~[flexmark-0.64.0.jar:na]
	at com.vladsch.flexmark.parser.Parser.parse(Parser.java:388) ~[flexmark-0.64.0.jar:na]

This PR introduces a range check before attempting to read the next char.

sounds good!

source: gharchive/pull-request

repo: vsch/flexmark-java

license_type: permissive

license_source: bigquery


text:
Call to undefined method inPlaceEditing

Hello,
I think the last update broke my LTM.
I did export the new migrations and migrate
Now, as soon as I try to reach my translation manager, I get a fatal error :
FatalThrowableError in helpers.php line 114:
Call to undefined method Illuminate\Translation\Translator::inPlaceEditing()

Did I miss something in the install/upgrade process ?

Are you sure you have the correct configuration in your app.php
        Vsch\TranslationManager\ManagerServiceProvider::class,
        Vsch\TranslationManager\TranslationServiceProvider::class,

See: https://github.com/vsch/laravel-translation-manager/wiki/Installation

@loranger, it looks like translator service is not replaced by one provided by LTM and is still the original one.
Check out step 2. of Installation
Please verify that the config/app.php still has the changes needed to use the LTM provided translation service.

Thanks for your replies,
I used to use the v 2.0 which worked perfectly. Thus, the official translator service was already replaced by the service providers of your (awesome, by the way) package :

    'providers' => [
        ...
        //Illuminate\Translation\TranslationServiceProvider::class,
        Vsch\TranslationManager\ManagerServiceProvider::class,
        Vsch\TranslationManager\TranslationServiceProvider::class,
        ...
    ],

And those are the only two occurences of Vsch inside my app.phpsince I did remove the now useless UserPrivilegeMapperServiceProvider.

If you DID NOT comment out this line:
        Illuminate\Translation\TranslationServiceProvider::class,
and if it is after
        Vsch\TranslationManager\TranslationServiceProvider::class,
it will still override the vsch/ltm translation service provider class. and you will get this error. If this is not your problem, then I think we need more information because I can't really think about anything else...

The providers array sample above is a copy-paste from my app.php, but you are right, this was the problem :
I now uses https://github.com/overtrue/laravel-lang and his service provider was overriding your. I did switch the order and the translation manager now works. I suppose Overture does not anymore...
    'providers' => [
        ...
        //Illuminate\Translation\TranslationServiceProvider::class,
        Overtrue\LaravelLang\TranslationServiceProvider::class,
        Vsch\TranslationManager\ManagerServiceProvider::class,
        Vsch\TranslationManager\TranslationServiceProvider::class,
        ...
    ],

Thanks for your package and for your support !

source: gharchive/issue

authors: loranger vsch yurtesen

repo: vsch/laravel-translation-manager

license: mit


text:
How can I set startup arguments before debug?

I tried add 'args' section in launch.json, but didn't work. How can I set startup arguments?

Hey @Honsal , it's been nearly two years but I haven't given up on you! Could you provide a few more details? For example, what arguments are you trying to provide? How do you provide these in other editors?

authors: Honsal mark-wiemer

repo: vscode-autohotkey/autohotkey-plus

license: MIT

license_source: github-api


text:
Assertion fail during editing translation(wx/string.h(1536): assert "!empty()" failed in Last(): wxString: index out of bounds)

Crash during regular translation editing, using a Chinese input method called HIME.
It seems that at that time I was committing text from input method's pre-edit buffer to the application translation field, however I've done the same thing several times without producing the crash.
UPDATE: I've reproduced this issue again but still don't have an accurate reproducible way, I'm pretty sure this is input-method related.
Application Crash Information
ASSERT INFO:
/usr/include/wx-3.0/wx/string.h(1536): assert "!empty()" failed in Last(): wxString: index out of bounds

BACKTRACE:
[1] wxString wxString::Format<wxString, wxString>(wxFormatString const&, wxString, wxString)
[2] std::__weak_count<(__gnu_cxx::_Lock_policy)2>::operator=(std::__shared_count<(__gnu_cxx::_Lock_policy)2> const&)
[3] wxAppConsoleBase::CallEventHandler(wxEvtHandler*, wxEventFunctor&, wxEvent&) const
[4] wxEvtHandler::ProcessEventIfMatchesId(wxEventTableEntryBase const&, wxEvtHandler*, wxEvent&)
[5] wxEvtHandler::SearchDynamicEventTable(wxEvent&)
[6] wxEvtHandler::TryHereOnly(wxEvent&)
[7] wxEvtHandler::DoTryChain(wxEvent&)
[8] wxEvtHandler::ProcessEvent(wxEvent&)
[9] wxEvtHandler::SafelyProcessEvent(wxEvent&)
[10] wxTextEntryBase::SendTextUpdatedEvent(wxWindow*)
[11] g_closure_invoke
[12] g_signal_emit_valist
[13] g_signal_emit
[14] g_closure_invoke
[15] g_signal_emit_valist
[16] g_signal_emit
[17] gtk_text_buffer_delete_interactive
[18] gtk_text_buffer_delete_selection
[19] g_cclosure_marshal_VOID__STRINGv
[20] g_signal_emit_valist
[21] g_signal_emit_by_name
[22] g_cclosure_marshal_VOID__STRINGv
[23] g_signal_emit_valist
[24] g_signal_emit_by_name
[25] g_closure_invoke
[26] g_signal_emit_valist
[27] g_signal_emit
[28] gtk_window_propagate_key_event
[29] g_closure_invoke
[30] g_signal_emit_valist
[31] g_signal_emit
[32] gtk_propagate_event
[33] gtk_main_do_event
[34] g_main_context_dispatch
[35] g_main_loop_run
[36] gtk_main
[37] wxGUIEventLoop::DoRun()
[38] wxEventLoopBase::Run()
[39] wxAppConsoleBase::MainLoop()
[40] wxEntry(int&, wchar_t**)
[41] std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_destroy()
[42] __libc_start_main

Reporter's Environment
Operating System
Ubuntu 15.10 AMD64
Poedit
1.8.4-1 from Ubuntu 15.10 software source
WxWidget
3.0.2+dfsg-1.2 from Ubuntu 15.10 software source
Locale
LANG=zh_TW.UTF-8
LANGUAGE=zh_TW:zh_HK:zh_CN:en_US:en
LC_CTYPE="zh_TW.UTF-8"
LC_NUMERIC=zh_TW.UTF-8
LC_TIME=zh_TW.UTF-8
LC_COLLATE="zh_TW.UTF-8"
LC_MONETARY=zh_TW.UTF-8
LC_MESSAGES="zh_TW.UTF-8"
LC_PAPER=zh_TW.UTF-8
LC_NAME=zh_TW.UTF-8
LC_ADDRESS=zh_TW.UTF-8
LC_TELEPHONE=zh_TW.UTF-8
LC_MEASUREMENT=zh_TW.UTF-8
LC_IDENTIFICATION=zh_TW.UTF-8
LC_ALL=

HIME Input Method
Self built version with commit 900d88868

When any form of backtrace is involved in any way, always make sure debug symbols are present. That's why Ubuntu has *-dbg packages and why its guide mentions them. Backtrace without debug symbols is mostly useless; this one, for example, is 100% certain to be lying (the 1-2-3 sequence of calls is impossible).
This looks like something that could be fixable even without reproduction ("I've seen it" isn't what "reproduce" means; step by step instructions on how to reliably repeat it are), if only the backtrace was worth anything.
Also please always try using the latest version (1.8.4 isn't).

The following is the backtrace attempted using GDB(The crash dialog provided by WxWidget didn't provide any deeper details even I have installed most debugging symbols, so I manually send a SIGARBT to poedit process in order to force gdb prompt showing up)
#0  0x00007ffff25a08dd in poll () at ../sysdeps/unix/syscall-template.S:81
#1  0x00007ffff45c71ec in g_main_context_iterate (priority=2147483647, n_fds=4, fds=0xb8bfe0, timeout=<optimized out>, context=0xafbb90)
    at /build/glib2.0-ajuDY6/glib2.0-2.46.1/./glib/gmain.c:4135
#2  0x00007ffff45c71ec in g_main_context_iterate (context=0xafbb90, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>)
    at /build/glib2.0-ajuDY6/glib2.0-2.46.1/./glib/gmain.c:3835
#3  0x00007ffff45c7572 in g_main_loop_run (loop=0x16450d0)
    at /build/glib2.0-ajuDY6/glib2.0-2.46.1/./glib/gmain.c:4034
#4  0x00007ffff33e7ee3 in IA__gtk_dialog_run (dialog=0xf08030 [GtkAssertDialog])
    at /build/gtk+2.0-xmBAGF/gtk+2.0-2.24.28/gtk/gtkdialog.c:1094
#5  0x00007ffff6c51a6b in wxGUIAppTraits::ShowAssertDialog(wxString const&) (this=<optimized out>, msg=...) at ../src/gtk/utilsgtk.cpp:316
#6  0x00007ffff634ab72 in ShowAssertDialog(wxString const&, int, wxString const&, wxString const&, wxString const&, wxAppTraits*) (file=..., line=line@entry=1536, func=..., cond=..., msgUser=..., traits=traits@entry=0xb81940)
    at ../src/common/appbase.cpp:1319
#7  0x00007ffff634eb97 in wxAppConsoleBase::OnAssertFailure(wchar_t const*, int, wchar_t const*, wchar_t const*, wchar_t const*) (this=this@entry=0xad10f0, file=<optimized out>, line=1536, func=<optimized out>, cond=<optimized out>, msg=<optimized out>) at ../src/common/appbase.cpp:798
#8  0x00007ffff6c0ffa0 in wxApp::OnAssertFailure(wchar_t const*, int, wchar_t const*, wchar_t const*, wchar_t const*) (this=0xad10f0, file=<optimized out>, line=<optimized out>, func=<optimized out>, cond=<optimized out>, msg=<optimized out>)
    at ../src/gtk/app.cpp:507
#9  0x00007ffff634f262 in wxDefaultAssertHandler(wxString const&, int, wxString c---Type <return> to continue, or q <return> to quit---
onst&, wxString const&, wxString const&) (file=..., line=1536, func=..., cond=..., msg=...) at ../src/common/appbase.cpp:1110
#10 0x00007ffff634e0fa in wxOnAssert(char const*, int, char const*, char const*, wchar_t const*) (file=0x6ae8e0 "/usr/include/wx-3.0/wx/string.h", line=1536, func=<optimized out>, cond=<optimized out>, msg=<optimized out>)
    at ../src/common/appbase.cpp:1195
#11 0x000000000048c554 in wxString::Last() (this=0x7fffffffb210)
    at /usr/include/wx-3.0/wx/string.h:1536
#12 0x00000000005d553e in TranslationTextCtrl::OnText(wxCommandEvent&) (this=
    0x1507400, e=...) at text_control.cpp:735
#13 0x00007ffff63472de in wxAppConsoleBase::CallEventHandler(wxEvtHandler*, wxEventFunctor&, wxEvent&) const (this=0xad10f0, handler=0x1507400, functor=..., event=...) at ../src/common/appbase.cpp:623
#14 0x00007ffff64cd537 in wxEvtHandler::ProcessEventIfMatchesId(wxEventTableEntryBase const&, wxEvtHandler*, wxEvent&) (entry=..., handler=<optimized out>, event=...) at ../src/common/event.cpp:1392
#15 0x00007ffff64cd91e in wxEvtHandler::SearchDynamicEventTable(wxEvent&) (this=0x1507400, event=...) at ../src/common/event.cpp:1751
#16 0x00007ffff64cd9ae in wxEvtHandler::TryHereOnly(wxEvent&) (this=0x1507400, event=...) at ../src/common/event.cpp:1585
#17 0x00007ffff64cd7e3 in wxEvtHandler::DoTryChain(wxEvent&) (this=<optimized out>, event=...) at ../src/common/event.cpp:1554
#18 0x00007ffff64cdad5 in wxEvtHandler::ProcessEvent(wxEvent&) (this=0x1378f80, event=...) at ../src/common/event.cpp:1495
#19 0x00007ffff64cd837 in wxEvtHandler::SafelyProcessEvent(wxEvent&) (this=<optimized out>, event=...) at ../src/common/event.cpp:1613
---Type <return> to continue, or q <return> to quit---
#20 0x00007ffff6e4254c in wxWindowBase::HandleWindowEvent(wxEvent&) const (this=this@entry=0x1507400, event=...) at ../src/common/wincmn.cpp:1525
#21 0x00007ffff6e2ce8f in wxTextEntryBase::SendTextUpdatedEvent(wxWindow*) (win=0x1507400) at ../src/common/textentrycmn.cpp:378
#25 0x00007ffff48b712f in <emit signal ??? on instance 0x12b1e30 [GtkTextBuffer]> (instance=instance@entry=0x12b1e30, signal_id=<optimized out>, detail=detail@entry=0) at /build/glib2.0-ajuDY6/glib2.0-2.46.1/./gobject/gsignal.c:3439
    #22 0x00007ffff489c015 in g_closure_invoke (closure=0x13763c0, return_value=return_value@entry=0x0, n_param_values=1, param_values=param_values@entry=0x7fffffffb5f0, invocation_hint=invocation_hint@entry=0x7fffffffb570)
    at /build/glib2.0-ajuDY6/glib2.0-2.46.1/./gobject/gclosure.c:801
    #23 0x00007ffff48ae061 in signal_emit_unlocked_R (node=node@entry=0x1138c50, detail=detail@entry=0, instance=instance@entry=0x12b1e30, emission_return=emission_return@entry=0x0, instance_and_params=instance_and_params@entry=0x7fffffffb5f0) at /build/glib2.0-ajuDY6/glib2.0-2.46.1/./gobject/gsignal.c:3627
    #24 0x00007ffff48b6dfc in g_signal_emit_valist (instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>, var_args=var_args@entry=0x7fffffffb7a0) at /build/glib2.0-ajuDY6/glib2.0-2.46.1/./gobject/gsignal.c:3383
#26 0x00007ffff34fa589 in gtk_text_buffer_real_delete_range (buffer=0x12b1e30 [GtkTextBuffer], start=0x7fffffffbdf0, end=0x7fffffffbd50)
    at /build/gtk+2.0-xmBAGF/gtk+2.0-2.24.28/gtk/gtktextbuffer.c:1595
#30 0x00007ffff48b712f in <emit signal ??? on instance 0x12b1e30 [GtkTextBuffer]> (instance=instance@entry=0x12b1e30, signal_id=<optimized out>, detail=detail@entry=0) at /build/glib2.0-ajuDY6/glib2.0-2.46.1/./gobject/gsignal.c:3439
    #27 0x00007ffff489c015 in g_closure_invoke (closure=closure@entry=0x12f7f00, return_value=return_value@entry=0x0, n_param_values=3, param_values=param_values@---Type <return> to continue, or q <return> to quit---
entry=0x7fffffffba60, invocation_hint=invocation_hint@entry=0x7fffffffb9e0)
    at /build/glib2.0-ajuDY6/glib2.0-2.46.1/./gobject/gclosure.c:801
    #28 0x00007ffff48ae60e in signal_emit_unlocked_R (node=node@entry=0x12f7f50, detail=detail@entry=0, instance=instance@entry=0x12b1e30, emission_return=emission_return@entry=0x0, instance_and_params=instance_and_params@entry=0x7fffffffba60) at /build/glib2.0-ajuDY6/glib2.0-2.46.1/./gobject/gsignal.c:3665
    #29 0x00007ffff48b6dfc in g_signal_emit_valist (instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>, var_args=var_args@entry=0x7fffffffbc40) at /build/glib2.0-ajuDY6/glib2.0-2.46.1/./gobject/gsignal.c:3383
#31 0x00007ffff34f4c97 in gtk_text_buffer_emit_delete (buffer=buffer@entry=0x12b1e30 [GtkTextBuffer], start=start@entry=0x7fffffffbdf0, end=end@entry=0x7fffffffbd50) at /build/gtk+2.0-xmBAGF/gtk+2.0-2.24.28/gtk/gtktextbuffer.c:1613
#32 0x00007ffff34f98ab in IA__gtk_text_buffer_delete_interactive (buffer=buffer@entry=0x12b1e30 [GtkTextBuffer], start_iter=start_iter@entry=0x7fffffffbe90, end_iter=end_iter@entry=0x7fffffffbee0, default_editable=default_editable@entry=1)
    at /build/gtk+2.0-xmBAGF/gtk+2.0-2.24.28/gtk/gtktextbuffer.c:1725
#33 0x00007ffff34f9c81 in IA__gtk_text_buffer_delete_selection (buffer=0x12b1e30 [GtkTextBuffer], interactive=interactive@entry=1, default_editable=default_editable@entry=1) at /build/gtk+2.0-xmBAGF/gtk+2.0-2.24.28/gtk/gtktextbuffer.c:3819
#34 0x00007ffff351d805 in gtk_text_view_commit_text (text_view=0x12afc60 [GtkTextView], str=0x1622620 "壓")
    at /build/gtk+2.0-xmBAGF/gtk+2.0-2.24.28/gtk/gtktextview.c:7455
#35 0x00007ffff489eaca in g_cclosure_marshal_VOID__STRINGv (closure=0x1507ba0, return_value=<optimized out>, instance=<optimized out>, args=<optimized out>, marshal_data=<optimized out>, n_params=<optimized out>, param_types=0xf25ae0)
    at /build/glib2.0-ajuDY6/glib2.0-2.46.1/./gobject/gmarshal.c:1794
---Type <return> to continue, or q <return> to quit---
#36 0x00007ffff489c244 in _g_closure_invoke_va (closure=closure@entry=0x1507ba0, return_value=return_value@entry=0x0, instance=instance@entry=0x113d030, args=args@entry=0x7fffffffc2b8, n_params=<optimized out>, param_types=0xf25ae0)
    at /build/glib2.0-ajuDY6/glib2.0-2.46.1/./gobject/gclosure.c:864
#37 0x00007ffff48b6a46 in g_signal_emit_valist (instance=instance@entry=0x113d030, signal_id=signal_id@entry=248, detail=detail@entry=0, var_args=var_args@entry=0x7fffffffc2b8) at /build/glib2.0-ajuDY6/glib2.0-2.46.1/./gobject/gsignal.c:3292
#38 0x00007ffff48b75f5 in g_signal_emit_by_name (instance=0x113d030, detailed_signal=0x7ffff36019da "commit")
    at /build/glib2.0-ajuDY6/glib2.0-2.46.1/./gobject/gsignal.c:3479
#39 0x00007ffff489eaca in g_cclosure_marshal_VOID__STRINGv (closure=0x1509c90, return_value=<optimized out>, instance=<optimized out>, args=<optimized out>, marshal_data=<optimized out>, n_params=<optimized out>, param_types=0xf25ae0)
    at /build/glib2.0-ajuDY6/glib2.0-2.46.1/./gobject/gmarshal.c:1794
#40 0x00007ffff489c244 in _g_closure_invoke_va (closure=closure@entry=0x1509c90, return_value=return_value@entry=0x0, instance=instance@entry=0x13d6720, args=args@entry=0x7fffffffc6a8, n_params=<optimized out>, param_types=0xf25ae0)
    at /build/glib2.0-ajuDY6/glib2.0-2.46.1/./gobject/gclosure.c:864
#41 0x00007ffff48b6a46 in g_signal_emit_valist (instance=instance@entry=0x13d6720, signal_id=signal_id@entry=248, detail=detail@entry=0, var_args=var_args@entry=0x7fffffffc6a8) at /build/glib2.0-ajuDY6/glib2.0-2.46.1/./gobject/gsignal.c:3292
#42 0x00007ffff48b75f5 in g_signal_emit_by_name (instance=0x13d6720, detailed_signal=0x7fffdedd3b9c "commit")
    at /build/glib2.0-ajuDY6/glib2.0-2.46.1/./gobject/gsignal.c:3479
#43 0x00007fffdedd3516 in gtk_im_context_hime_filter_keypress (context=0x13d6720 [GtkIMContextHIME], event=0x15a7470) at gtkimcontexthime.c:471
---Type <return> to continue, or q <return> to quit---
#44 0x00007ffff3449e03 in gtk_im_multicontext_filter_keypress (context=0x113d030 [GtkIMMulticontext], event=0x15a7470)
    at /build/gtk+2.0-xmBAGF/gtk+2.0-2.24.28/gtk/gtkimmulticontext.c:333
#45 0x00007ffff6c5f682 in gtk_window_key_press_callback(GtkWidget*, GdkEventKey*, wxWindow*) (gdk_event=0x15a7470, win=0x1507400) at ../src/gtk/window.cpp:1012
#50 0x00007ffff48b712f in <emit signal ??? on instance 0x12afc60 [GtkTextView]> (instance=instance@entry=0x12afc60, signal_id=<optimized out>, detail=detail@entry=0) at /build/glib2.0-ajuDY6/glib2.0-2.46.1/./gobject/gsignal.c:3439
    #46 0x00007ffff3460e5c in _gtk_marshal_BOOLEAN__BOXED (closure=0x150b920, return_value=0x7fffffffd190, n_param_values=<optimized out>, param_values=0x7fffffffd1f0, invocation_hint=<optimized out>, marshal_data=<optimized out>)
    at gtkmarshalers.c:86
    #47 0x00007ffff489c015 in g_closure_invoke (closure=0x150b920, return_value=return_value@entry=0x7fffffffd190, n_param_values=2, param_values=param_values@entry=0x7fffffffd1f0, invocation_hint=invocation_hint@entry=0x7fffffffd170)
    at /build/glib2.0-ajuDY6/glib2.0-2.46.1/./gobject/gclosure.c:801
    #48 0x00007ffff48ae061 in signal_emit_unlocked_R (node=node@entry=0xb2edd0, detail=detail@entry=0, instance=instance@entry=0x12afc60, emission_return=emission_return@entry=0x7fffffffd300, instance_and_params=instance_and_params@entry=0x7fffffffd1f0) at /build/glib2.0-ajuDY6/glib2.0-2.46.1/./gobject/gsignal.c:3627
    #49 0x00007ffff48b6899 in g_signal_emit_valist (instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>, var_args=var_args@entry=0x7fffffffd3b0) at /build/glib2.0-ajuDY6/glib2.0-2.46.1/./gobject/gsignal.c:3393
#51 0x00007ffff3578cdc in gtk_widget_event_internal (widget=widget@entry=0x12afc60 [GtkTextView], event=event@entry=0x15a7470)
    at /build/gtk+2.0-xmBAGF/gtk+2.0-2.24.28/gtk/gtkwidget.c:5017
---Type <return> to continue, or q <return> to quit---
#52 0x00007ffff3578fb7 in IA__gtk_widget_event (widget=widget@entry=0x12afc60 [GtkTextView], event=event@entry=0x15a7470)
    at /build/gtk+2.0-xmBAGF/gtk+2.0-2.24.28/gtk/gtkwidget.c:4814
#53 0x00007ffff358c79d in IA__gtk_window_propagate_key_event (window=window@entry=0xc74200 [GtkWindow], event=event@entry=0x15a7470)
    at /build/gtk+2.0-xmBAGF/gtk+2.0-2.24.28/gtk/gtkwindow.c:5199
#54 0x00007ffff6c4bce8 in wxgtk_tlw_key_press_event(GtkWidget*, GdkEventKey*) (widget=widget@entry=0xc74200 [GtkWindow], event=0x15a7470)
    at ../src/gtk/toplevel.cpp:243
#59 0x00007ffff48b712f in <emit signal ??? on instance 0xc74200 [GtkWindow]> (instance=instance@entry=0xc74200, signal_id=<optimized out>, detail=detail@entry=0)
    at /build/glib2.0-ajuDY6/glib2.0-2.46.1/./gobject/gsignal.c:3439
    #55 0x00007ffff3460e5c in _gtk_marshal_BOOLEAN__BOXED (closure=0xc88df0, return_value=0x7fffffffd6b0, n_param_values=<optimized out>, param_values=0x7fffffffd710, invocation_hint=<optimized out>, marshal_data=<optimized out>)
    at gtkmarshalers.c:86
    #56 0x00007ffff489c015 in g_closure_invoke (closure=0xc88df0, return_value=return_value@entry=0x7fffffffd6b0, n_param_values=2, param_values=param_values@entry=0x7fffffffd710, invocation_hint=invocation_hint@entry=0x7fffffffd690)
    at /build/glib2.0-ajuDY6/glib2.0-2.46.1/./gobject/gclosure.c:801
    #57 0x00007ffff48ae061 in signal_emit_unlocked_R (node=node@entry=0xb2edd0, detail=detail@entry=0, instance=instance@entry=0xc74200, emission_return=emission_return@entry=0x7fffffffd820, instance_and_params=instance_and_params@entry=0x7fffffffd710) at /build/glib2.0-ajuDY6/glib2.0-2.46.1/./gobject/gsignal.c:3627
    #58 0x00007ffff48b6899 in g_signal_emit_valist (instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>, var_args=var_args@entry=0x7ffffff---Type <return> to continue, or q <return> to quit---
fd8d0) at /build/glib2.0-ajuDY6/glib2.0-2.46.1/./gobject/gsignal.c:3393
#60 0x00007ffff3578cdc in gtk_widget_event_internal (widget=widget@entry=0xc74200 [GtkWindow], event=event@entry=0x15a7470)
    at /build/gtk+2.0-xmBAGF/gtk+2.0-2.24.28/gtk/gtkwidget.c:5017
#61 0x00007ffff3578fb7 in IA__gtk_widget_event (widget=widget@entry=0xc74200 [GtkWindow], event=event@entry=0x15a7470)
    at /build/gtk+2.0-xmBAGF/gtk+2.0-2.24.28/gtk/gtkwidget.c:4814
#62 0x00007ffff345f6d7 in IA__gtk_propagate_event (widget=0xc74200 [GtkWindow], event=0x15a7470) at /build/gtk+2.0-xmBAGF/gtk+2.0-2.24.28/gtk/gtkmain.c:2494
#63 0x00007ffff345f9ab in IA__gtk_main_do_event (event=0x15a7470)
    at /build/gtk+2.0-xmBAGF/gtk+2.0-2.24.28/gtk/gtkmain.c:1710
#64 0x00007ffff1d5dc0c in gdk_event_dispatch (source=<optimized out>, callback=<optimized out>, user_data=<optimized out>)
    at /build/gtk+2.0-xmBAGF/gtk+2.0-2.24.28/gdk/x11/gdkevents-x11.c:2425
#65 0x00007ffff45c6ff7 in g_main_context_dispatch (context=0xafbb90)
    at /build/glib2.0-ajuDY6/glib2.0-2.46.1/./glib/gmain.c:3154
#66 0x00007ffff45c6ff7 in g_main_context_dispatch (context=context@entry=0xafbb90) at /build/glib2.0-ajuDY6/glib2.0-2.46.1/./glib/gmain.c:3769
#67 0x00007ffff45c7250 in g_main_context_iterate (context=0xafbb90, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>)
    at /build/glib2.0-ajuDY6/glib2.0-2.46.1/./glib/gmain.c:3840
#68 0x00007ffff45c7572 in g_main_loop_run (loop=0xb1c2e0)
    at /build/glib2.0-ajuDY6/glib2.0-2.46.1/./glib/gmain.c:4034
#69 0x00007ffff345ea07 in IA__gtk_main ()
    at /build/gtk+2.0-xmBAGF/gtk+2.0-2.24.28/gtk/gtkmain.c:1282
#70 0x00007ffff6c2c055 in wxGUIEventLoop::DoRun() (this=0xade6f0)
---Type <return> to continue, or q <return> to quit---
    at ../src/gtk/evtloop.cpp:65
#71 0x00007ffff63892b3 in wxEventLoopBase::Run() (this=0xade6f0)
    at ../src/common/evtloopcmn.cpp:78
#72 0x00007ffff634e746 in wxAppConsoleBase::MainLoop() (this=0xad10f0)
    at ../src/common/appbase.cpp:334
#73 0x00007ffff63dae80 in wxEntry(int&, wchar_t**) (argc=<optimized out>, argv=<optimized out>) at ../src/common/init.cpp:495
#74 0x000000000049b101 in main(int, char**) (argc=1, argv=0x7fffffffddb8)
    at edapp.cpp:253

I'm trying to reproduce it on 1.8.7 but I'm still failed to build it by the time.

I'm trying to reproduce it on 1.8.7 but I'm still failed to build it by the time.

Let me try fixing it based on backtrack only (thanks!), so that you don't waste any more time on it needlessly – it looks clear enough at first glance.

The issue on building the latest version is filed at #238

Fixed in 1.8.5 (f3eb45de37175fe4b4cc4f2c6ff11b107192b26f) — the same bug as #203.
(This is exactly why "always try the latest version first" is a meaningful advice…)

authors: Vdragon vslavik

repo: vslavik/poedit


text:
#304: Fixes the height of lines container when additional panels are …

This fixes the height of lines container when additional panels are added to Content Manager (e.g. backlinks in document added by Backlinks core plugin).
Example before fix:

Example after fix:

@vslinko  please take a look :)

@vslinko look pls!

authors: Fyzu bukhtiyarov-a-v

repo: vslinko/obsidian-outliner


text:
Performance degeneration when batch size is increased(BYOL)

Hi, thanks for your impressive work!
During the BYOL experiment on your codes(Imagenet-100, resnet18, 200epochs, same hyper-params as bash_files), it seems that the performance degenerated a lot if the batch size was increased([val acc1] bsz128: 75.5%, bsz256:70.54%).
Is there anything I need to modify when the batch size is increased?
I don't think it's because of the learning rate

Hi, thanks for using solo-learn.
The batch sizes (128, 256) that you mention are for each GPU or total?

It means I just used configuration in script file as --batch_size 128/256

Ok, so you used 2 GPUs which means that your effective batch sizes are 256 and 512. We have never tried batch size 512 so I am not able to say for sure, but this might be related to the number of steps. What I mean is that if you train with larger batch sizes you are taking a lower number of gradient steps per epoch. Therefore, a short training (like 200 epochs on IN100) might be negatively affected by this. OFC with larger batches you will probably converge to a better accuracy but it will take more time to do so.
One experiment that you could run to validate this hypothesis is the following:
--batch_size 128
--accumulate_grad_batches 2

In this way, the number of gradient steps will be the same as for bs=256 but the batches will be of size 128.
Also, FYI:

we tried BYOL on IN100 with --accumulate_grad_batches 16 (as per the original paper) and it did not perform well
the learning rate is automatically scaled in the base model
for larger batches, you might also want to tune LARS setting (--grad_clip_lars and --eta_lars)

Ok, appreciate your considerate comments.
So, --batch_size x num_gpus will be the effective batch_sizes. right?

Yes!

repo: vturrisi/solo-learn


text:
我使用npm构建时选择了node_modules文件夹，但是引入vant-webapp时依然找不到目录

//project.config.json
"packNpmManually": true,
"packNpmRelationList": [
{
"packageJsonPath": "./package.json",
"miniprogramNpmDistDir": "./node_modules/"
}
],
//app.json
"usingComponents": {
"van-button": "@vant/weapp/button/index"
},
[ dist/app.json 文件内容错误] dist/app.json: ["usingComponents"]["van-button"]: "@vant/weapp/button/index" 未找到

此模版不需要使用微信开发者工具的 构建 npm 功能。
要使用 vant-weapp 可能需要对此模版做一些自定义改动。

authors: yanbowe yangmingshan

repo: vue-mini/template


text:
fix(core): should external terminal-link when build

Closes #19

Codecov Report
Base: 64.76% // Head: 64.59% // Decreases project coverage by -0.16% :warning:

Coverage data is based on head (e76ee42) compared to base (7fa3801).
Patch has no changes to coverable lines.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #20      +/-   ##
==========================================
- Coverage   64.76%   64.59%   -0.17%
==========================================
  Files          44       44
  Lines        4129     4129
  Branches      195      195
==========================================
- Hits         2674     2667       -7
- Misses       1455     1462       +7

Impacted Files
Coverage Δ

packages/core/src/renderer/render.ts
69.09% <0.00%> (-3.64%)
:arrow_down:

packages/core/src/renderer/text.ts
51.82% <0.00%> (-1.46%)
:arrow_down:

packages/core/src/utils/index.ts
82.89% <0.00%> (-1.32%)
:arrow_down:

packages/core/src/focus/FocusManager.ts
78.03% <0.00%> (-0.94%)
:arrow_down:

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

authors: codecov-commenter webfansplz

repo: vue-terminal/vue-termui


text:
Sobrescrever estilo de componente externo

Olá pessoal, estou criando minha primeira aplicação Vue (já havia brincando com tutoriais antes mas nunca executado um projeto), onde migrei um conteúdo criado em html e css para uma SPA que está consumindo uma API. Usando vue-cli criei o projeto já importando o vue-router, criei dois componentes um Footer e um Header além de 8 views. Toda parte de programação está ok, meu único problema foi com aplicação de css.
Todas minhas páginas com exceção da home possuem o mesmo estilo de css, portanto migrei e adaptei o estilo para a tag style do componente Header (removi o atributo scoped). Acreditava que se usasse scoped style no Home para sobrescrever as classes css de Header funcionaria, mas não. Então resolvi tirar e funcionou, mas todas outras views ficaram com o mesmo estilo.
Já dei uma procurada e não encontrei algo que me ajudasse, até achei no stackoverflow alguém que passou pela mesma situação mas não teve uma resposta funcional.
Se alguém tiver alguma dica por favor me responda. Muito obrigado.

Fala! Então, se eu entendi bem, você possui 8 views com o mesmo estilo de Header e Footer, e apenas na Home este estilo muda. Correto? O que de fato muda neste estilo?
O atributo scoped na tag <style> faz com que na hora de gerar o HTML e o CSS, ambos terão um hash único, fazendo com que os estilos daquele componente em especial não sejam compartilhados com outros locais e o afetem.
Agora o porquê da minha pergunta anterior: quando usamos o atributo scoped, podemos acessar os seletores de componentes filhos através do >>> na definição de seletor CSS do nosso componente (Deep Selector). Dá uma olhada, possa ser que te ajude

Não tem como passar uma classe de modificação via parametro?

@emanuelgsouza Exato. Bastante coisa muda: altura do header; divs tem display none numa, noutra não; posicionamento do menu; disposição dos itens internos e cores.
Imaginei que poderia fazer como num HTML e CSS comum, onde tendo um arquivo css com estilo pré existente se eu crio num novo, meu seletores vão sobrescrever a estilização primária. Me enganei bastante pelo visto.
Vou dar uma olhada no link que mandou e ver se me ajuda. Muito obrigado.

@simaodeveloper Na minha situação eu teria de "duplicar" e alterar pelo menos umas 15 classes. Acho que é contraproducente. Obrigado.

Então. Pelo que você está comentando, eu creio que seria melhor criar um componente apenas para o Header do Home. Se é praticamente outro header, ele seria o HomeHeader, por exemplo.
Pelo que você comenta abaixo, eu não duplicaria tudo, eu teria um CSS comum geral para os headers e nos componentes, Header (usado pelas inúmeras views) e o HomeHeader (usado apenas pela Home), eu teria os estilos bem específicos.
Espero ter ajudado no debate

@marcelcunha sugeri passar uma classe por parametro, justamente para adicionar apenas uma classe modificadora no elemento ancestral ou elemento raiz do componente, assim, você estiliza os demais elementos a partir dele.
Com a omissão da complexidade da sua arquitetura eu concordo com o caminho que o @emanuelgsouza propôs já que é um componente diferente dos demais.

@emanuelgsouza Dado a minha pouca experiência e pouco prazo pra procurar, acredito que sua ideia seja a melhor solução no momento.
Muito obrigado a você ao @simaodeveloper pela ajuda.

repo: vuejs-br/forum


text:
2.1 dist file adjustments

Some changes were made to the dist files in Vue 2.1.0 which seem to require a slight change to the webpack config.
https://gist.github.com/yyx990803/faebe22e8763f5b17572b35ed96f52fe#dist-files-adjustments
As you can see the alias for vue$ should now be set to vue.common. If this isn't done then the production build is left in development mode, which produces a warning in the console, a slightly larger file size, and apparently a performance hit.
I'd create a PR for this, as it's a very simple change, but I don't think it would be backwards compatible with earlier versions of Vue, so I'm not sure how to handle it.

As you can see the alias for vue$ should now be set to vue.common.

It is:
https://github.com/vuejs-templates/webpack/blob/master/template/build/webpack.base.conf.js#L27
Not sure what else can be done?

Ah, maybe I was just looking in the wrong place then! I had to change this manually in my project in order to get it to work.
I'll close this now, as it looks like I must have made a mistake somewhere.

I would assume that you worked on an older project that was created before we updated the template?

Yes, that does seem to be the case. I had thought the project was started a couple of weeks ago, but checking the first commit it was actually started just before the above change. My mistake, sorry, and thanks for your time and patience! :)

authors: LinusBorg graemetait

repo: vuejs-templates/webpack


text:
Update README.md

Added a second Quill editor for Vue2 project in the Rich Text section

ok. Thought it would make more sense to have all quill grouped togehter. But FIFO style is good for me.

close due to in-activity.
if you hope push this PR again, you can push it as new PR. :)

authors: kazupon spaquet

repo: vuejs/awesome-vue


text:
"too much recursion" when objects recursively reference each other

Version
3.2.29
Reproduction link
sfc.vuejs.org/
Steps to reproduce
When launching the repro in the SFC Playground, you will immediately notice the error "too much recursion". There are no additional steps required.
What is expected?
I expected to see no errors.
What is actually happening?
In the SFC Playground, you will notice the error "too much recursion". When running it locally, you might see something like this:
Uncaught (in promise) RangeError: Maximum call stack size exceeded
    at Function.[Symbol.hasInstance] (<anonymous>)
    at isDate (shared.esm-bundler.js?99c4:485:1)
    at looseEqual (shared.esm-bundler.js?99c4:386:1)
    at looseEqual (shared.esm-bundler.js?99c4:413:1)
    at looseEqual (shared.esm-bundler.js?99c4:413:1)
    at looseEqual (shared.esm-bundler.js?99c4:413:1)
    at looseEqual (shared.esm-bundler.js?99c4:413:1)
    at looseEqual (shared.esm-bundler.js?99c4:413:1)
    at looseEqual (shared.esm-bundler.js?99c4:413:1)
    at looseEqual (shared.esm-bundler.js?99c4:413:1)

To me, it looks like Vue is trying to deep-compare these objects and does not track already visited ones.

This is a data structure you might see e.g. when dealing with tree-like structures that are aware of their parents. One solution would be to filter out the "parent" information. But that could be non-trivial when using more complex data structures e.g. generated by a library.

Avoid the recursivity by marking the object as raw:

const parent = markRaw({
  children: [a, b]
})

If the data structure is something I can control, then this certainly works. But if the data structure is generated by some kind of (external) library, then you have to make the entire data structure non-reactive. Which of course does not really work if you are using this data structure in other parts of your application where you depend on reactivity.
I must say that I was a bit surprised in general that no simply identity check (===) is performed here. If you look at my example: If a and b have the same shape, then it is not possible to pre-select b. This probably happens because Vue does not perform identity checks, but rather compares object shapes. Is it possible to change this behavior?

Hello, any news on this please? Any schedule fix or work on it?
I'm experiencing the issue with an ORM like library where instances reference each other.

Hello, I have basically the same problem as @paul-thebaud, I've been trying several workarounds by now but haven't gotten a real solution yet.
Does any of you have at least a suggestion?
My particular problem is that I'm referencing back the "parent" entity I'm dealing with in order to compute things based on its state changes.
I actually make it work in basic cases, but when the parent-child relation goes beyond 3 steps deep, a "too much recursion" error appears and blocks everything.
Example:
Lead -> Deal -> SaleOrder -> Item

parent -> child
       -> parent -> child
                 -> parent -> child

The first 2 recursive links work well, but the third one breaks everything.
During my experiments, I've noticed a few things.
if I inject the parent like this
Object.defineProperty(child, path, { value: parent })

It actually does not break since it's not enumerable, but now the child doesn't notice the parent changes so nothing is recomputed. I'm looking for a simple way to maybe inject only a property that triggers this re-render process when the parent changes.
Any ideas here?
Maybe inject a forceUpdate (render) function in child obj to be triggered from parent?

If it helps for anyone out there, I figure a solution out of this using the following approach.

Stop using watchers. This makes me manually ensure the propagation of the changes, to do so I centralized the values mutation in the root, and all the required changes were pushed back to its parent using a {path: string, value: any} strategy to finally update back the root object in a single place and notify all children back with the regular Vue Observable proxy.
I ensured deleting the parent from the children's properties and injected it back using a none enumerable getter:

assignParent (child, path, parent) {
  if (!path || !child || child.constructor.name === 'Object') return

  if (!(path in child) || !child[path]) {
    delete child[path]
    Object.defineProperty(child, path, { get () { return parent }, enumerable: false })
  }
}

In my case, all the data structures are instances of an entity Class so I double-check this to mitigate other problems.

Once the new value is applied in the corresponding path, I notify the children's tree of it to "forceUpdate" only if required..

Does any of you have at least a suggestion?

instead of Object.defineProperty, I solved this problem with markRaw as hinted above - not sure why it doesn't work for you. In my case, I changed my pinia getter from
{
  ...,
  children: [...],
  parent: parent
}

to
{
  ...,
  static: markRaw({
    children: [...],
  },
  parent: parent
}

and then access children as x.static.children whenever necessary. It's not reactive anymore then, true, but that's probably not a dealbreaker?

the overall point is: this only happens when these two conditions are met:

a raw object is being compared to its reactive counterpart with the internal looseEqual() helper.
the object contains circular references, i.e. a self-reference

Thus, as a workaround, you can either make all your data raw or reactive.
playground (note lines 4+5)
As to why this hasn't been solved yet: it's a bit tricky. The most straightforward solution would to make looseEqual also check the raw values if any of the comparators are reactive proxies. But since we use the looseEqual()function in quite a few places, we have to verify that "rawObj === itsReactiveProxy // => true`" is not creating a problem in those other places.
And we simply haven't gotten around to do that, since this is also kind of an edge case and can be worked around as shown above

authors: LinusBorg MBuchalik paul-thebaud phil294 posva yonathan9669

repo: vuejs/core


text:
Understanding the loading state

There seem to be two different loading states that are not connected, unless I am misunderstanding something. When a query result is received, the result function is called with the data and a loading argument. I have not seen that ever set to true, because by the time the result function is called, its no longer loading. However, there is also the function watchLoading which is called immediately, and passed the loading state, which is initially true, and called again when the result is received, with false. The $apollo.loading property seems to be using that as well. The ApolloQuery component passes back a loading prop back, which comes from the result function, not the watchLoading function, which is called after the result is received. If anyone can help me understand this, it would be appreciated.

With the ApolloQuery component, whenever the networkStatus changes, the @result event is re-emitted, so the 1st time loading should be === true.
That’s my understanding and I’ve tried it in my code and that’s the behavior I get.
The thing I don’t understand is the :notify-on-network-status-change="" property, I could not find any difference whether it is set to true or false. Unless it is dispatching via another event, or something…

The network status change notification may have been fixed recently:
https://github.com/Akryum/vue-apollo/commit/ddce641cad1fddbcfd6bcf4f1f6e3c19826fe246

I'm using nuxt and this.$apollo.loading is always false. Never changes during anything. ANd ive tried every cache setting there is i think.

authors: Ben52 bbugh rnenjoy zzal

repo: vuejs/vue-apollo


text:
Option to set which type of compiler the user wants

What problem does this feature solve?
It would be a good features is there is an option for the user to set which compiler type to use from the cli-options it is set to false and which uses runtime build at default.
https://github.com/vuejs/vue-cli/blob/8fbbd353f93ae476e2511af9e4cc1bfdd8786ba7/packages/%40vue/cli-service/lib/options.js#L51
If this feature exist before please add it into the documentation to set the feature manually. If not maybe adding it to the vue.config.js file would be better. I think I can look into this and send a PR if it would be needed but first I would lie to see what responsse it would get.
What does the proposed API look like?
Features to support build compiler

Oops, dug deep and found this here https://github.com/vuejs/vue-cli/blob/dev/docs/config.md

repo: vuejs/vue-cli


text:
Building a vue library is including the @vue/cli-service build command in the output bundle

Version
2.6.11
Reproduction link
https://github.com/Robin-Hoodie/vue-test-project
Steps to reproduce

vue create test-project (choose default preset with babel/eslint)
Add src/index.js file which exports generated HelloWorld component export * from ./components/HelloWorld.vue
Create vue.config.js file and add webpack-bundle-analyzer plugin to webpack config (this is just to inspect the bundle size)
Change build command to vue-cli-service build --target lib --name test-project src/index.js
Run yarn build
Inspect generated dist/report.html file
Notice @vue/cli-service/lib/commands/build is included in bundle

What is expected?
Since @vue/cli-service is a devDependency I do not expect anything of this dependency to be included in the output bundle
What is actually happening?
@vue/cli-service/lib/commands/build is included in the output bundle

I am developing a component library for internal use. I noticed the bundle was quite big and upon inspecting the output I noticed the @vue/cli-service/lib/commands/build was being included.
I had already added quite a lot of components, which may be the cause for that dependency taking in a lot more space than in the test project I created (34.63 KB gzipped vs 1.25 KB gzipped)
I used @vue/cli-service@4.3.1 to generate the above project.

It's used as an entry so you'll see it in the stats.
Meanwhile, all the contents of those files are bundled into the final dist files. So it still makes sense to declare them as devDependencies because in production you only use the files under dist/ and none of them would actually require @vue/cli-service/*.
FYI, here's what's included in the bundle:
https://github.com/vuejs/vue-cli/blob/dev/packages/%40vue/cli-service/lib/commands/build/entry-lib-no-default.js
https://github.com/vuejs/vue-cli/blob/v4.3.1/packages/%40vue/cli-service/lib/commands/build/entry-lib-no-default.js (~entry is the alias for the command line argument src/index.js)
So it's actually very tiny. The size stats in the report are mostly due to the entry file but the analyzer failed to show them in detail.

@sodatea I am not completely following, let me give you some more background:
webpack-bundle-analyzer reports @vue/cli-service/lib/commands/build to be included in the main library bundle.
In my original problem I saw the following (gzipped) size:
Main bundle size: 68.49 KB of which @vue/cli-service/lib/commands/build took in 34.63 KB
When requiring this library bundle in another application, and then inspecting that bundle with webpack-bundle-analyzer, the total size of the library bundle is almost the same size (68.35KB, 0.14 KB less)
If webpack-bundle-analyzer fails to report this correctly for the library bundle itself, would it then also report this wrongly when actually requiring this as a dependency?
When included in another bundle, I would expect its size to be reported as 33.86 KB (68.49 KB - 34.63 KB)

With your test project, I don't see such big chunks:
Webpack Bundle Analyzer saved report to /Users/soda/Test/vue-test-project/dist/report.html
  File                            Size                  Gzipped

  dist/test-project.umd.min.js    5.64 KiB              2.04 KiB
  dist/test-project.umd.js        17.55 KiB             4.70 KiB
  dist/test-project.common.js     17.16 KiB             4.61 KiB
  dist/test-project.css           0.17 KiB              0.13 KiB

If webpack-bundle-analyzer fails to report this correctly for the library bundle itself, would it then also report this wrongly when actually requiring this as a dependency?

It might. Because they're both inferred from the same source map.

So, as I just found out, there's a "Show content of concatenated modules" option in the webpack bundle analyzer UI, check it and you'll see a more detailed chunk graph.

Aha perfect, that indeed shows me that the actual code in there is my own sourcecode that I wrote myself. Hence why it's so much bigger than in the test project.
Thanks for digging into this @sodatea , much appreciated!

authors: Robin-Hoodie sodatea


text:
npm run build运行错误Error: "extract-text-webpack-plugin" loader is used without eht corresponding plugin

使用Vue-cli 运行npm run dev没问题，打包的时候出现问题，附上我的package.json
麻烦尤大帮我看看，是在找不到解决办法了。
node -v
v6.1.0
npm -v
v3.8.6

{
"name": "joylife",
"version": "1.0.0",
"description": "A Vue.js project",
"author": "camoth <669762172@qq.com>",
"private": true,
"scripts": {
"dev": "node build/dev-server.js",
"build": "node build/build.js",
"test": "",
"lint": "eslint --ext .js,.vue src test/unit/specs test/e2e/specs"
},
"dependencies": {
"vue": "^1.0.21",
"babel-runtime": "^6.0.0"
},
"devDependencies": {
"babel-core": "^6.0.0",
"babel-loader": "^6.0.0",
"babel-plugin-transform-runtime": "^6.0.0",
"babel-preset-es2015": "^6.0.0",
"babel-preset-stage-2": "^6.0.0",
"connect-history-api-fallback": "^1.1.0",
"css-loader": "^0.23.0",
"eslint": "^2.0.0",
"eslint-config-standard": "^5.1.0",
"eslint-friendly-formatter": "^1.2.2",
"eslint-loader": "^1.3.0",
"eslint-plugin-html": "^1.3.0",
"eslint-plugin-promise": "^1.0.8",
"eslint-plugin-standard": "^1.3.2",
"eventsource-polyfill": "^0.9.6",
"express": "^4.13.3",
"extract-text-webpack-plugin": "^1.0.1",
"file-loader": "^0.8.4",
"function-bind": "^1.0.2",
"html-webpack-plugin": "^2.8.1",
"http-proxy-middleware": "^0.12.0",
"json-loader": "^0.5.4",
"lib-flexible": "^0.3.2",
"normalize.css": "^4.1.1",
"ora": "^0.2.0",
"shelljs": "^0.6.0",
"url-loader": "^0.5.7",
"vue-hot-reload-api": "^1.2.0",
"vue-html-loader": "^1.0.0",
"vue-loader": "^8.3.0",
"vue-resource": "^0.7.0",
"vue-router": "^0.7.13",
"vue-style-loader": "^1.0.0",
"vuex": "^0.6.3",
"webpack": "^1.12.2",
"webpack-dev-middleware": "^1.4.0",
"webpack-hot-middleware": "^2.6.0",
"webpack-merge": "^0.8.3"
}
}

how to sovle this problem?


text:
[Feature Request] Consider to print stringified Map/Set objects

What problem does this feature solve?
When I first started using Vue (a long time ago :) I've liked how simple it was and the ability to debug any object value by printing it in the template using {{ object }}. I've kept this reflex when prototyping because it is so handy and often times quicker than waiting for devtools to load.
Now that we can use reactive Map/Set objects, I recently played with vue-next and reactive Maps and realized this was not working like regular objects. I wish we could do the same kind of thing.
What does the proposed API look like?
when evaluating an object in the template, vue is stringifying the object behind the scenes.
Likewise we could have an 'universal' JSON stringify replacer that handles Map and Set objects.
for instance (snippet taken somewhere on stackoverflow):
JSON.stringify(map, function replacer (key, value) {
      const originalObject = this[key]
      if (originalObject instanceof Map) {
        return {
          dataType: 'Map',
          value: Array.from(originalObject.entries()) // or with spread: value: [...originalObject]
        }
      } else {
        return value
      }
    }, 2))

This way it could as well recursively walk through nested reactive Map/Set objects and update accordingly.
It would be a nice QoL improvement in my opinion, I dunno if it could add some overhead.
In any case I'm open to submit a PR if the idea is approved

This should a good first PR opportunity: https://github.com/vuejs/vue-next/blob/master/packages/shared/src/index.ts#L116

repo: vuejs/vue-next


text:
(Fix needed) unexpected 'prototype' error

Version
4.0.0-rc.2
Reproduction link
https://github.com/mcdmaster/covid19/tree/feat/vue3%2Bwebpack5
Steps to reproduce
Made up with vue-router-next@latest, vue@3.0.2 and webpack@5.3.0.
The auto-generated router produces an unexpected error: Cannot read property 'prototype' of undefined
What is expected?
Error is fixed so that app proceeds to rendering
What is actually happening?
An error which prevents application statrting
Screenshot

Nuxt 2 is not compatible with Vue 3 or Vue Router 4

@LinusBorg ,
If it is intended to drop the current (not older) version of nuxt as "incompatible", I disagree to it. it is obvious that It would not seem confident for the developers at work in my team either.
From my own end, I am unsure why an old-skool-like protype property remains here still. Anyway, I intend to raise a PR. Thank you.

Vue 3 is a major release, by definition it contains breaking changes.
Nuxt inbuilt on Vue 2 and needs it's own major release to become compatible with the changes in Vue 3.
That's not something we "declare", it's just technically necessary

Thank you for prompt getting back.
I have recognized that aligning nuxt to vue@3 is in progress; we can see it via the work goin on e.g. nuxt-property-decorator. If you are fine, please let me know if you think that it is better for me to work with nuxt guys than vue people. Thanks anyway

authors: LinusBorg mcdmaster

repo: vuejs/vue-router-next


text:
add this

声明式
编程式

<router-link :to="..." go>
router.go(-1)

The point of the router-link being resolving links and displaying the actual url, this won't make sense, at least at the current state of the router. Instead, this should be use on some kind of button with @click=$router.back()

@posva to is a required prop for router-link, and I tried <router-link to="" @click.prevent="$router.back()">, it does not work.

my point was: don't use a router-link if it's not going to render an a tag with the correct href attribute

@posva I added an afterEach hook:
import { Plugin } from '@nuxt/types'
import Vue from 'vue'
import Router from 'vue-router'

Object.defineProperty(Vue.prototype, '$prevRoutePath', {
  configurable: __DEV__,
  get(this: { $router: Router }) {
    const { previousRoute } = this.$router
    return previousRoute ? previousRoute.fullPath : '/'
  },
})

const routerPlugin: Plugin = ({ app: { router } }) => {
  router.afterEach((_to, from) => {
    router.previousRoute = from
  })
}

export default routerPlugin

But @click.prevent still does not work:
<router-link :to="$prevRoutePath" @click.prevent="$router.back()">
  <v-icon>{{ leftSvg }}</v-icon>
</router-link>

So I still have to do like following:
<router-link :to="$prevRoutePath">
  <v-icon @click="$router.back()">{{ leftSvg }}</v-icon>
</router-link>

Is that a bug that router-link could not be prevented?

authors: JounQin mlboy posva

repo: vuejs/vue-router


text:
error to pass required prop

Version
1.0.0-beta.15
Steps to reproduce
I have a component with item prop:
<template>
  <h2>{{ item.name }}</h2>
</template>

<script>
export default {
  name: 'CaseCard',
  props: {
    item: {
      type: Object,
      required: true
    }
  }
}
</script>

My prop item should be required, my test:
import { mount } from '@vue/test-utils'
import CaseCard from './CaseCard'

const cardsData = [
  { name: 'A', image: 'A', route: 'A', tags: ['A', 'AA']}
]

describe('CaseCard component', () => {
  test('render case name in h2 tag', () => {
    const component = mount(CaseCard, {
      propsData: {
        item: cardsData[0]
      }
    })
    const h2Tag = component.find('h2')

    expect(h2Tag.text()).toBe(cardsData[0].name)
  })

})

What is expected?
I think that it works and my test pass, but no works.
What is actually happening?
The error returned is: [Vue warn]: Missing required prop: "item"

If I remove required from my prop, the test pass, but I need use required.

I get the same error. Any idea what fixed it?

your code has some error, in the same component or in parent or child components of it.

authors: OpsSingular leonardovilarinho

repo: vuejs/vue-test-utils


text:
[DOCS] Dark mode for docs website

What problem does this feature solve?
It's very difficult to read the docs for long time due to light theme. Please made a dark theme toggle
What does the proposed API look like?
.

Duplicate of https://github.com/vuejs/vuejs.org/issues/552

authors: nainardev posva

repo: vuejs/vue


text:
®在  上使用 v-if 没有效果不工作

Version
2.6.10
Reproduction link
https://jsfiddle.net/anker/27nwbr84/2/
Steps to reproduce
在html中使用slot v-if没有任何效果，但是在js中使用template的slot v-if是正常。
无法使用v-if的例子
<template>

    <slot v-if="render"></slot>

</template>

可以使用 v-if 的例子

What is expected?
v-if 正常的使用
What is actually happening?
v-if 无法工作

v-if does work. Make sure to use the latest version when reporting a bug and provide a proper reproduction: https://jsfiddle.net/8fqyx6aj/
The template tag you were using should be outside of #app

@posva
https://jsfiddle.net/anker/27nwbr84/3/

authors: CongAn posva


text:
get props value through code

Hi Guys,
May I know how to get props value through code?
Not just only in template by v-bind.
I want to get this props value to control css class in data function.
Just like the below.
data() {
    return {
      classes: {
        switch: true,
        'float-left': true,
        () => {
            return this.props.size;
        }
      }
    };
  },

Hi, thanks for filling this issue, however the issue tracker is reserved for bug reports and feature requests only, so please use our dedicated gitter or forum to ask questions. Thanks!

data() {
    return {
      classes: {
        switch: true,
        'float-left': true,
        size: this.size
      }
    };
  },

or use this.size directly.

Thanks for your feedback quickly.
Just a little fixed.
data() {
    return {
      classes: {
        switch: true,
        'float-left': true,
        [this.size]: true
      }
    };
  },

That should be fine.

authors: fnlctrl rockkratos


text:
Consider having an additional naming convention on single file component

What problem does this feature solve?
Will you consider having an additional naming convention for single file component? Within the same directory, autoload the .js and .css that have the same file name as the .vue file?
This will help those who use single file component with separation of concern to reduce code.
What does the proposed API look like?
<!— file.vue —>
<template>

</template>

<!— Not required to write these due to naming convention —>

I think it's better to be explicit than to be magical. This can IMO easily be made painless with an editor snippet.


text:
fix Composing with Components

It's more understandable than before for me.

Thanks but I don't think it's necessary. Not to mention, if we go for this route, we'll need to change in a lot of other examples as well for consistency.


text:
UIkit 3?

What will happen with/to vuikit and what will developers notice or have to do when UIkit is moving to their version 3?

Vuikit in next branch is already UIkit3 compatible, although is not yet recommended for production. Developers would have to adapt their code to the new API, in general small changes. There is no ETA for the release, but we are working actively on it.

Cheers, thanks for the update. I know UIkit 3 is not ready for production and that developers need to change their code but as long as vuikit is coming along with v3 I will keep exploring vuikit.

Yep, you can count on Vuikit being actively developed and compatible with latest UIkit code.

Great job vuikit team !
I'm eagerly waiting for the uikit3 compaitable release.

Thanks @israrwz, we are getting there :)

have you already updated docs for the new changes, or will you be waiting for an official release?

Yes, the docs would be rewritten after the refactoring. I am finishing the App that is being built with it and while doing so many real use case issues are solved. Very happy with the results so the stable release is getting closer.

authors: israrwz jerry1970 michaelrtm miljan-aleksic

repo: vuikit/vuikit


text:
🛑 motards-en-voyage is down

In 2f7c17f, motards-en-voyage (https://motards-en-voyage.com//robots.txt) was down:

HTTP code: 503
Response time: 1057 ms

Resolved: motards-en-voyage is back up in 83cc6b7.


text:
mandelbrot does not compile

In the mendelbrot example it uses vulkano::device::Features but Device::new() appears to expect vulkano::instance::Features.

I think you might be using the example with the wrong vulkano version? It runs fine for me as is, and vulkano::instance::Features was removed in vulkano 0.11.

Yep, my mistake. Updated vulkano and it is working properly. Thanks rukai.

authors: adobrich rukai

repo: vulkano-rs/vulkano-www


text:
Convert PropTypes.object to use ThemeSchema

This PR add ThemeSchema as the shape to be applied on the theme prop.
atm, this addresses containers/*, but we can continue with applying this rule on components/* too if necessary

Thanks for another great PR.
Can you apply the ThemeSchema on the components/* as well?

@vutran done a196588

authors: adnasa vutran

repo: vutran/dext


text:
Top 100 user page

New potential users should have a chance to see what already existing users do. IMO the best way to do so is to have some sort of top 100 user page where the 100 user with the most followers are listed. This page would have to be linked in the index page.
There should be a top 100 user page per language.

Only embed the first 10 avatars.

repo: vutuv/vutuv


text:
Carriage returns in output on Linux

I loaded up the resulting file inside vim, and I see ^M after every line, original file does not have this.
Somehow \r\n is being added after every new line.
Cant see this character in Windows text editors.

@eimmot I am not actively maintaining this module, you can submit a PR though and I will update it.

authors: eimmot vvo

repo: vvo/concat-files


text:
Auto-Logout within a duration

I store some sensitive data in req.session which can change anytime. So, is there a way that user would get logged out every 6hrs? Is it the ttl? I am not sure :(

yes it is the ttl you can set it to clear the session after 6 hours

Yes it's the ttl indeed.
One thing to keep in mind: the TTL is reset everytime you save the session. So if a user is constantly using your website and you have so session.save calls then it will never expire.
The expire is triggered when someone doesn't use your website for 6 hours.

authors: Mencraft apidev234 vvo

repo: vvo/iron-session


text:
Add something to indicate column where the error is

I've played with your code and this is absolutely possible to do.
You have loclist variable that is updated at each linter result with locations of errors. I've copied its contents into global variable and used it like this.
fun! AddMatches()
    let g:my_positions = []
    for location in g:my_loclist
        if location.col
            call add(g:my_positions, [location.lnum, location.col])
        endif
    endfor
    call matchaddpos('ColorColumn', g:my_positions)
endf

So the idea is that you can subscribe to WinEnter event and get errors for the current buffer and then add highlight columns via matchaddpos. I've used colorcolumn here, but that's probably a bad idea. You can use some sane default and give user ability to overwrite it.

This is the same issue as #187. matchaddpos seems like the way to go. I should also probably expand the column match to whatever word the cursor lands on, with a start and end column, and make the default highlight a squiggly line.

@w0rp Sorry, I've search for word column and haven't found anything. Although I should say that I don't want entire lines to be highlighted. And not all errors, warnings should be highlighted also, so this should be customizable.


text:
How do you manage multiple environments?

For example, say production has a different database name than development. How would you manage this? Two thoughts come to mind:
Either make .env.development and .env.production and copy the the correct .env file over. Or set environment variables in the production environment that sets DB_NAME. However, isn't great since you can't have that in version control.
A third option is to completely drop the custom environment handling and use something like convict.

Hi @et
Yes just setup a .env file for your local environment.
You should not have multiple config files on one environment. In addition you should not commit any sensitive data to a repository (e.g. DB user and password).
In my opinion a other party needs to provide configuration. For example if you use cloud services like Cloud Foundry or Heroku (https://devcenter.heroku.com/articles/heroku-postgresql#connecting-in-node-js) you will load this configuration from the environment variables and this configuration is provided by the cloud provider.
What we do on Cloud Foundry is to setup a manifest.yaml to hold the more static env vars.
And if you have a CI like Travis or Jenkins you would also provide the config over the environment variables.
If you like to add an other environment or change the configuration of an environment you don't have to change the version control. You just have to change the config in the cloud and restart the app.
Thanks for the link to convict. Seams like an awesome library perfect for frontend (E.g. Webpack webapp) configuration (as there the configuration has to be loaded on at build/compile time).

Thanks for response. Env vars are the way to go. Totally forgot that dotenv doesn't overwrite existing env vars so that should be a safe path.
Thanks!


text:
🛑 Wayback Archiver is down

In e30d8b2, Wayback Archiver (https://wabarc.eu.org) was down:

HTTP code: 503
Response time: 542 ms

Resolved: Wayback Archiver is back up in a9031c2.

repo: wabarc/status


text:
Update bout detection metric

Copy latest bout detection metric from GGIR

left comment in wrong repo

repo: wadpac/mechanicalshakerexperiments


text:
Description of status codes

As @wafflespeanut described in https://github.com/wafflespeanut/paperclip/pull/243#issuecomment-704763049, we can support the following format to be able to add a description for each status code:
#[api_v2_operation(
      status(
          code = 200, description = "OK",
          code = 202, description = "I accept",
      )
)]
fn my_handler () -> Foo { /* */ }

I have an additional suggestion to be able to overwrite the description of the error messages too. Like:
#[api_v2_operation(
      status(
          code = 200, description = "OK",
          code = 202, description = "I accept",
          code = 418, description = "I'm a teapot 🫖",
      )
)]
fn my_handler () -> Foo { /* */ }

@wafflespeanut @platy any idea/suggestion?

You can define error codes with better reusability and convenience via api_v2_errors macros on Error type.
There is good example in docs https://paperclip.waffles.space/actix-plugin.html

Thanks @dunnock.
I'm using that, but it needs to be customized.
For example, generally, 404 means Not Found... but for users, it can mean, "The user is inactive or does not exist", for roles it can mean "The role does not exist" and ...
Is there any way of customizing this error per state?

I think we can still have per-handler overrides for error codes, just like how we have it for 2xx or other codes. It will then override the default implementation implemented through #[api_v2_errors] macro.

authors: dunnock omid wafflespeanut

repo: wafflespeanut/paperclip


text:
Add middleware

변경사항

미들웨어 달았습니다. 추가적으로 공통 핸들러 메소드 약간 변경했습니다. (req를 넣어줘야함 - 이거 없애고 싶은데 어쩔 수 없네요)

ServerRequest.attributes.context에 미들웨어에서 처리된 context들이 다 들어가고요, handler에서 꺼내쓰면 됩니다.

ServerRequest.getContext, ServerRequest.setContext 사용하세요

참고사항

참고로 Middleware는 미들웨어들을 여러개 두고 request에 적용시키는 방식이 아니라 middleware들을 체이닝한 하나의 복합 미들웨어를 request에 적용시키는 방식입니다.

그래서 보시면 snuttRestApiDefaultMiddleware 이런것도 미리 만들어두었습니다.

이 PR은 전적으로 저의 AOP에 대한 기피로 인해 작성되었습니다.

AOP를 피하기 위해 약간의 발악을 해봤는데 복잡도가 조금 늘어난 것 같긴 하네요...
몇가지 케이스 아니면 (ex 로그인 해야하는 부분 안해도 되는 부분, 따로 있는 곳 구현) 별로 좋다고 못느낄 수도 있을 것 같아요 자유롭게 의견주세요

또 코드리뷰 하면서 뭔가 setContext나 Middleware.func 타입이라던가 뭔지모를 답답한 부분이 있는데 시원하게 해결해주세요

하다보니 완전 express쪽 router 스타일이 됐네요
저는 마음에 드는데 다른 분들 어떨지 모르겠네요

@PFCJeong
이 PR 종합적인 감상은 어떨까요?
이렇게 명시적으로 미들웨어를 작성하는게 괜찮을까요?
별로면 그냥 엎어도 됩니다ㅋㅋ

Spring에서 제공해주는 Filter를 안쓰는 것에 대한 생소함 반 우려 반이 있었는데, 좀 구조 잡히니깐 생각보다 괜찮네요.
저는 이런 구조로 가도 될 것 같아요.  (근데 미들웨어라는 네이밍 너무 express스러운데 대안 없나요?ㅋㅋㅋㅋㅋ)

사사로운 궁금증일 수 있는데, middleware 들을 chain 하여 순차적으로 동작하게 되는데요. 이거 chain 하는 순서에 대한 선호/규칙이 있다고 생각하시나요? 어떤 middleware 가 먼저 동작하게 할지.

또 코드리뷰 하면서 뭔가 setContext나 Middleware.func 타입이라던가 뭔지모를 답답한 부분이 있는데 시원하게 해결해주세요
구체적으로 이건 어떤 종류의 아쉬움일까요? @Hank-Choi

엄청나네요... 이미 어딘가에서 짜본 패턴을 들고 온 건가요? 멋집니다... 저는 일단 사용해봐도 좋을 거 같단 느낌도 있는데, @PFCJeong 의 #4 와 둘 중 양자 택일해서 merge 해야하는 상황일까요?

저는 요걸로 가는 걸로 이해하고 있었어요. #4은 filter랑 어케 달라지는지 약간 그냥 데모느낌으로 뚝딱뚝딱 만든거기도 하고요.

Spring에서 제공해주는 Filter를 안쓰는 것에 대한 생소함 반 우려 반이 있었는데, 좀 구조 잡히니깐 생각보다 괜찮네요.
저는 이런 구조로 가도 될 것 같아요. (근데 미들웨어라는 네이밍 너무 express스러운데 대안 없나요?ㅋㅋㅋㅋㅋ)

제시 부탁..ㅋㅋㅋㅋ
contextManager

@Hank-Choi 사소하지만 이게 묻혔는데 궁금합니다. https://github.com/wafflestudio/snutt-timetable/pull/3#issuecomment-1365792854

호출 오류 났을 때 가장 먼저 던지는 에러 생각하면서 순서 정하면 될 듯 한데
대충 api key, clientInfo, user token, 등등 하면 될듯요?
또 나머지는 의존성 있는거만 주의하면 순서 상관없을듯요? 개발할 때 의존성 있는 거만 주의해주세요
의존성 있는게 들어갈 일이 있을 것 같긴해서 중간에 생성된 context도 미들웨어 인자로 받도록 하긴 했어요

authors: Hank-Choi PFCJeong davin111

repo: wafflestudio/snutt-timetable


text:
🛑 Wagestream UK API is down

In 297fe62, Wagestream UK API (https://api.wagestream.xyz/api/v1/lb/ok) was down:

HTTP code: 503
Response time: 602 ms

Resolved: Wagestream UK API is back up in d4dfb68.

repo: wagestream/statuspage


text:
bug: useWalletClient returns incorrect chainId

Is there an existing issue for this?

[X] I have searched the existing issues

Package Version
1.4.1
Current Behavior
The useWalletClient hook returns an incorrect chain id in client.chain object. It always returns 1, no matter which chain the wallet is connected to
Expected Behavior
The wallet client object contains the wallet's currently connected chain
Steps To Reproduce
  const { data: walletClient } = useWalletClient();

  console.log(walletClient?.chain?.id)

Minimal reproducible example is available below
Link to Minimal Reproducible Example (StackBlitz, CodeSandbox, GitHub repo etc.)
https://stackblitz.com/edit/new-wagmi-lp8bpf?file=src%2FApp.tsx
Anything else?

it seems it is returning public client chain id & it does not even update on chain change,
& chain for useNetwork hook gets updated properly.

@mmv08 I forked your example, updated the wagmi config so there's 2 chains https://stackblitz.com/edit/new-wagmi-m1ryz3?file=src%2Fwagmi.ts. What's the issue? I see the chain id being updated correctly

@mmv08 I forked your example, updated the wagmi config so there's 2 chains https://stackblitz.com/edit/new-wagmi-m1ryz3?file=src%2Fwagmi.ts. What's the issue? I see the chain id being updated correctly

Hey, I believe that doesn't solve my issue, as it still doesn't return the wallet's chain ID. In my application, I can't make assumptions about which chains the user will be connected to and, therefore have them in the config.

@mmv08 I forked your example, updated the wagmi config so there's 2 chains https://stackblitz.com/edit/new-wagmi-m1ryz3?file=src%2Fwagmi.ts. What's the issue? I see the chain id being updated correctly

Hey, I believe that doesn't solve my issue, as it still doesn't return the wallet's chain ID. In my application, I can't make assumptions about which chains the user will be connected to and, therefore, have them in the config.

Got it, I misunderstood the original issue. The walletClient, at least with wagmi, seems tied to the publicClient and/or configured chains, so what you describe is the expected behavior, from the source code anyway. I can see how having walletClient always reflect current network being more transparent. But the current behavior ties wallet actions to the chains configured, which seems beneficial. I'm not educated enough to know which is the better behavior
Does useNetwork not meet your needs for this case?

I'm also facing the same issue, walletClient provided by useWalletClient alwasy have chainid 1

I think this issue https://github.com/MetaMask/metamask-mobile/issues/7206 is also related to this issue. There is a video attached to this issue, but it is even reproduced exactly on the wagmi example page.

We have moved on to Wagmi v2. Feel free to re-open this with a minimal reproduction if this still exists there.

authors: imaksp mmv08 salzbrenner siosio34 tmm zeeshanhanif

repo: wagmi-dev/wagmi


text:
Direct reply-to

Hello!
Is there a way to implement Direct Reply-to feature using this library?
To do so, we have to reuse the same channel for consuming and publishing messages on RPC client side. As chanManager is private, I guess it is not possible to reuse previously created channels with the library, am I wrong?

INteresting use case but no, it does not seem possible, both new publisher and new consumer create their own NewChannelManager.
On tho other hand RPC over rabbit seems a bit strange and it goes against their own recommendation of having separate channels for publishing/consuming. What if your RPC have very high throughput, would TCP blocking be an issue? How long does the server take to process the request? How's the RPC completion reliability implemented when either the client, rabbit or the server goes down?
I reckon these are all valid questions for reconsidering the scope of RPC over rabbit or if RPC is required in the first place. Overall RPC would be probably better served by other means.
Alternatively, one can always create a proper (and auto-managed by e.g. this library) reply queue and expand their RPC protocol with the metadata (which reply queue to use, client ID, request sequence number) so clients wont step on each other's toes. This also has the advantage of the possibility of using topic queues for grouping "RPC".

Closing as not possible

authors: LucaWolf thibleroy wagslane

repo: wagslane/go-rabbitmq


text:
Fix draft view when preview modes are disabled

Ref: #5670
View draft uses page.make_preview_request(request, page.default_preview_mode), as does viewing a revision
This PR fixes default_preview_mode to fall gracefully to returning None when no preview modes are defined

Do the tests still pass? (https://docs.wagtail.io/en/latest/contributing/developing.html#testing) ✅
Does the code comply with the style guide? (Run make lint from the Wagtail root) ✅
For Python changes: Have you added tests to cover the new/fixed behaviour? ✅
For front-end changes: Did you test on all of Wagtail’s supported browsers? Please list the exact versions you tested. N/A
For new features: Has the documentation been updated accordingly? N/A

I think the more correct thing to do here is to hide the 'view draft' / 'view revision' link when preview_modes is empty. While these are notionally not previews from an end-user/programmer perspective, in practice they are the same mechanism, and the situations where you'd want to disable previewing (i.e. headless setups where front-end page rendering is outside the control of Wagtail/Django) are ones where you'd also want to disable viewing of drafts / revisions.

Alternative fix submitted: #5971

authors: gasman zerolab

repo: wagtail/wagtail


text:
Implement telepath adapter for HalloRichTextArea

Fixes #7110

I rebased this fix onto 906a81ee7 (Add WAGTAILADMIN_COMMENTS_ENABLED setting) and I can now use the Hallo.js rich text editor when the field is a RichTextFIeld and when the RichTextBlock is part of a StreamBlock.
LGTM

authors: cnk gasman


text:
[feature request] proxy_queries = domain

[DomainPattern]
priority = 0
name_pattern = *.example.com
proxy_queries = target.com
log_request = yes

test.example.com=>4.5.6.7
target.com=>1.2.3.4
proxy:
test.example.com=>1.2.3.4
abc.example.com=>1.2.3.4

I @Worldwidebrine,
can you please explain your use case a little bit more?
would also work for your usecase to have an IP rather than a domain as a value for proxy_queries.
Like something like proxy_queries = 8.8.8.8 and then the DNS requests are routed to this IP resolver.
Or do you want to "redirect" requests matching a given pattern to another pattern specified in the config?

authors: Worldwidebrine wahlflo

repo: wahlflo/fakedns


text:
matlab files (.m) recognized as objective-c

waketime classifies matlab (.m) as objective-c. It would be great if it was classified as matlab or at least "other".

Fixed with cb67d6bb2f5600c8f59903d949ea032952c6e7a6.

Thanks !

authors: alanhamlett dugagjinll

repo: wakatime/wakatime


text:
Traceback error

I'm getting an error when debugging notepad++ plugin. Firstly it's throwing a traceback message and then follow the debug messages. Starting from second line everything seems to be apparently  fine.
{
	"now": "2015/05/26 09:44:05 E. South America Standard Time",
	"version": "4.0.8",
	"plugin": "notepadpp/393293 notepadpp-wakatime/1.1.0.0",
	"time": 1432644245.200358,
	"isWrite": true,
	"file": "<full-path>\\form-elements.html",
	"level": "DEBUG",
	"message": "Traceback (most recent call last):\n  File \"C:\\Users\\cgandarez\\AppData\\Roaming\\Notepad++\\plugins\\Config\\wakatime-master\\wakatime\\languages\\__init__.py\", line 93, in __init__\n    module = import_module('.%s' % module_name, package=__package__)\n  File \"C:\\Python34\\lib\\importlib\\__init__.py\", line 109, in import_module\n    return _bootstrap._gcd_import(name[level:], package, level)\n  File \"<frozen importlib._bootstrap>\", line 2254, in _gcd_import\n  File \"<frozen importlib._bootstrap>\", line 2237, in _find_and_load\n  File \"<frozen importlib._bootstrap>\", line 2224, in _find_and_load_unlocked\nImportError: No module named 'wakatime.languages.html'\n"
}
{
	"now": "2015/05/26 09:44:05 E. South America Standard Time",
	"version": "4.0.8",
	"plugin": "notepadpp/393293 notepadpp-wakatime/1.1.0.0",
	"time": 1432644243.68541,
	"file": "<full-path>\\form-elements.html",
	"level": "DEBUG",
	"message": {
		"response_code": 201
	}
}
{
	"now": "2015/05/26 09:44:05 E. South America Standard Time",
	"version": "4.0.8",
	"plugin": "notepadpp/393293 notepadpp-wakatime/1.1.0.0",
	"time": 1432644245.200358,
	"isWrite": true,
	"file": "<full-path>\\form-elements.html",
	"level": "DEBUG",
	"message": "Sending heartbeat to api at https://wakatime.com/api/v1/heartbeats"
}
{
	"now": "2015/05/26 09:44:05 E. South America Standard Time",
	"version": "4.0.8",
	"plugin": "notepadpp/393293 notepadpp-wakatime/1.1.0.0",
	"time": 1432644245.200358,
	"isWrite": true,
	"file": "<full-path>\\form-elements.html",
	"level": "DEBUG",
	"message": {
		"file": "<full-path>\\form-elements.html",
		"is_write": true,
		"lines": 2884,
		"language": "HTML",
		"time": 1432644245.200358
	}
}
{
	"now": "2015/05/26 09:44:06 E. South America Standard Time",
	"version": "4.0.8",
	"plugin": "notepadpp/393293 notepadpp-wakatime/1.1.0.0",
	"time": 1432644245.200358,
	"isWrite": true,
	"file": "<full-path>\\form-elements.html",
	"level": "DEBUG",
	"message": {
		"response_code": 201
	}
}

That traceback is nothing to worry about, it just means the "language pack" used to detect frameworks for the current file was not found because I haven't created one for HTML yet. As long as you get a 201 response code from the api and the correct project, language, file, time, and isWrite values are shown then everything is working correctly.

@alanhamlett tks! closing this issue.

authors: alanhamlett gandarez


text:
Want to change App Card background color

Hi, I wanted to change the app card background color in the light mode but I am not able to do it properly. You can see my current preview for the light mode and my changes to the config and custom.css files here
The changes I made to the custom.css file for app card background show up for both dark and light mode. How to I set them separately?

I solved this problem by creating a variable (--card-cover) that changes its value depending on whether the background is light or dark. Here is the code I added to custom.css:
`/* App Cards */
body #app .card {
background-color: var(--card-cover);
box-shadow: 0 2px 15px 0 var(--card-shadow);
}
body #app.is-dark{
--card-cover: rgb(0, 255, 0, 0.8);
}
body #app.is-light{
--card-cover: rgb(255 ,0 ,0 , 0.8);
}`
P.D. (I know the colors are horrible, but they are like that to show that it works)

@Worvein Thanks, this seems to be working great!

repo: walkxcode/homer-theme


text:
wandb.restore not respecting run_path

Weights and Biases version: 0.10.1
Python version: 3.7.7
Operating System: Linux-3.10.0

Description
I am trying to restore a previously trained model from a different run by specifying the run_path. But it still seems to be ignoring it and searching in the current run's folder.
What I Did
> load_path = wandb.restore("best_model.th", run_path="rahular/nlp/o9yf2jxr")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/wjv316/anaconda3/envs/pos-bert/lib/python3.7/site-packages/wandb/sdk/wandb_run.py", line 855, in restore
    raise ValueError("File {} not found.".format(path))
ValueError: File wandb/run-20200918_164521-1n2653n1/files/best_model.th not found.

Hi @rahular, it looks like the run in question used wandb version 0.10.1, so the file isn't saved to rahular/nlp/o9yf2jxr. It could be saved to your next run which seems to be have been run in parallel, but it will exist on your machine in the wandb/run-*-o9yf2jxr/files directory, under your project.
You did find an issue in our messaging for cases where restoring a file failed. Thank you for that, and good luck.

authors: KyleGoyette rahular

repo: wandb/client


text:
Plotly Ignores Colors

Weights and Biases version: '0.8.21'
Python version: 3.5.3
Operating System: GCP AI Notebook with Tensorflow 2.0 Environment Jupyter Lab

Description
If I create a bar plot using matplotlib.pyplot and pass in a set of colors to use for each bar, it displays the plot correctly with the corresponding colors. When I log this plot to wandb, the plot displayed in wandb shows the correct bars but all the same color. Alternatively, if I log the plot to wandb as an image, it uploads the plot correctly with the corresponding colors.
What I Did
import numpy as np
import matplotlib.pylplot as plt
import seaborn as sns

lengths, modes = np.unique(counts, return_counts=True)
pal = list(sns.color_palette("hls", len(lengths)))
plt.bar(lengths[1:], modes[1:], color=pal)
plt.xlabel('Visit Lengths')
plt.ylabel('Frequency')
wandb.log({'Visit Length Distribution' : plt})

This should be fixed now - thanks for the bug report!

Hi! I was facing a similar issue, when I created a seaborn scatter plot. When logging as a wandb.Image, it showed the colors, but when I logged the figure directly, the colors were not shown on the legend, only on the actual points in the scatter plot.
Example:
from matplotlib import pyplot as plt
import seaborn as sns

def _get_color_mapping():
    return {
        'tree': '#124A54', 'sky': '#28A2B8', 'bear': '#58C9DA',
        'bee': '#ADE68E', 'honey': '#CBFCB1'}

classes = np.array(['tree', 'sky', 'bear', 'bee', 'honey'])
fig, _ = plt.subplots(figsize=(10., 10.))
sns.scatterplot(x=np.random.random(1000), y=np.random.random(1000), hue=classes[np.random.randint(0, 5, (1000))], palette=_get_color_mapping())

wandb.log({
        "Figures/scatter": wandb.Image(fig) # works
        # "Figures/scatter": fig # colors do not appear in legend
        })

For info:
plotly==5.3.1
matplotlib==3.3.4
seaborn==0.11.2

For people who are still facing this issue with go.Scatter, it helped in my case to use marker=go.Marker(color="blue") (or marker=go.scatter.Marker(color="blue") in the later version.) when calling go.Scatter. Probably there is something similar for go.Bar.

authors: ghadialhajj intermx-rwalden lorinczszabolcs lukas

repo: wandb/wandb


text:
[Windows] Restore after maximizing, the window goes out of the screen

系统：Windows10
Qt：5.9.3、5.14、5.15都有这个问题
编译器：msvc2017
效果图：

复现步骤：
1、窗口最大化
2、鼠标向下拖拽标题栏，让窗口从最大化变成常规大小，此时不要放开鼠标，再往上拖到屏幕顶部，触发Win10的Aero效果，自动变成最大化。
3、按Restore按钮，还原到常规大小。
此时窗口会跑到屏幕顶部，标题栏会超出去，如果标题栏高度比较小，就点不到了。

OS: Windows 10
Qt Version: 5.9.3 , 5.14 , 5.15.0
Compiler: msvc2017
Demo Image:

Reproduce：
1、make Window Maximize
2、Mouse drag-down title， make window change to normal from maximize， then not release mouse and drag-up caption to the top of screen, window will be maximized by Windows 10 Aero effect
3、Press Restore Button， window restore to normal.
now Window goes out of screen. if the title Bar is too short, you can't use it

感谢反馈，按这个步骤确实能复现。我想一下是哪里的问题。

目前已经确认是这个函数导致的：
https://github.com/wangwenx190/framelesshelper/blob/50036371a3c1d35c2f9312bc3055ac0180408496/winnativeeventfilter.cpp#L2076
但如果不把自定义的窗口边框传给Qt，会导致我们在改变窗口尺寸时，Qt输出一大堆警告信息。
这个问题我也有点摸不着头脑。不过感觉这个问题只是个小问题，虽然确实是个bug，但我觉得应该很少有人会专门去这么操作。

试了一些老牌的商业控件，发现也有这个问题，看来对于Qt程序而言，这个问题普遍存在。

小问题，影响不大。老牌商业控件 要么没发现，要么发现了也觉得不重要。

老牌商业控件 要么没发现，要么发现了也觉得不重要。

是，这个问题触发的条件很苛刻，必须严格按照你那个操作来才能触发，一步不对就触发不了。
我觉得这个问题应该是Qt内部没有考虑自定义边框的情况，最大化时记录的窗口几何位置没有减去自定义标题栏的高度导致的。其实你仔细看一下就会发现，被“吃掉”的高度正好等于你自定义标题栏的高度。如果要解决，还是要从Qt内部入手。

由于是Qt内部问题，因此就不在这个项目的考虑范围内了。我抽空研究下，如果有能力解决的话，就贡献给Qt上游。

最终发现不是Qt的bug，而是win32窗口普遍存在的问题。没有这个问题的窗口，都是开发者已经自行处理过了。如果使用了Windows默认的逻辑（即调用DefWindowProc），都会存在这个问题。现在已修复。Qt上游也马上会合入相关解决方案，预计6.5.1及之后的版本都会修复。

Any hope for a Qt 5.15 patch?

Any hope for a Qt 5.15 patch?

@JulienMaille Qt 5.15 branch is in a really strict mode so won't accept any modifications unless it's really critical, such as security issue fixes. So this small fix won't be cherry-picked to Qt 5.15 and I've confirmed that with Qt engineers. However, if you can patch Qt yourself, I can give the link of the upstream patch. But I really recommend you upgrade to Qt6, because Qt6 has included so many Windows specific improvements and fixes which 5.15 don't have.

I'm currently stuck with Qt5 due to the removal of QtScript. I'll look at the patch, currently working with KDE set of patches

I'm currently stuck with Qt5 due to the removal of QtScript. I'll look at the patch, currently working with KDE set of patches

@JulienMaille  OK. Here's the link of the upstream fix: https://codereview.qt-project.org/c/qt/qtbase/+/472926. You can cherry-pick it to your own custom build of Qt5.

authors: JulienMaille jaredtao wangwenx190


text:
[Bug]Synchronize collectModels func

WHY
collectModels function causes conflict.
WHAT
Lock the relevant section.

LGTM 👍

repo: wantedly/apig


text:
🛑 Jwago is down

In b562641, Jwago (https://jwago.fr) was down:

HTTP code: 0
Response time: 0 ms

Resolved: Jwago is back up in 9f35a87 after 11 minutes.

repo: warielon/upptime


text:
Reverse count not working

Hi
This lib is awesome. grate work.
I have small issue please check.
Reverse count not working (not show count proper) like
i set this value:
app:isb_max="0"
app:isb_min="10"

@BacancyVishal Hi, it seem peculiar. I am so to tell you that the min value must be less than max's.

i agree with you but i am showing seekbar like this.

@BacancyVishal maybe you can custom the text array by setTickTextArray(arr), the arr ={10,9,8,7,6,5,4,3,2,1,0},  hope this helpful to you.thanks

authors: BacancyVishal warkiz

repo: warkiz/IndicatorSeekBar


text:
Remote branch 1.2 could not be found

Hey,
I'm experiencing the following error:
warning: Could not find remote branch 1.2 to clone. fatal: Remote branch 1.2 not found in upstream origin

It seems to have randomly popped up last night and I can't find the origin - just wondering that it isn't related to a server-side problem?
Thanks :)

tsss im in deep shit as well. Who has the idea to import such dependency in a production...

Version 1.3.2 has now been released, and the podspec has been pushed to Cocoapods trunk.

authors: bryanhoganjordan nicmanzini warrenm

repo: warrenm/AHEasing

license: Unlicense


text:
Add a client library

Right now we basically consume the raw NATS API everywhere we interact with wadm. It would be nice if we added a client library to the wadm crate so that we could have an experience like client.put_manifest(Manifest{}).await. This could become more helpful down the line too as we add more features

This would probs be really similar to the way that https://github.com/wasmCloud/wash/blob/main/crates/wash-lib/src/app.rs is structure

repo: wasmCloud/wadm


text:
feat(host): Add support for supplying a NATS credentials file

Feature or Problem
It's a bit clumsy to have to provide the seed and jwt separately when they could be just read from the credentials file, so let's add support for that.
Related Issues

Release Information

Consumer Impact

Testing

Unit Test(s)

Acceptance or Integration

Manual Verification

@brooksmtownsend I went ahead and implemented --ctl-creds and --rpc-creds as well, but I didn't create separate parsing functions for them, which does mean that the reported error messages would effectively be the same for each.
Would you prefer separate parsing functions to customize the error messages?

@joonas i think attaching a context to the parsing result to indicate which one failed would be plenty!

@joonas i think attaching a context to the parsing result to indicate which one failed would be plenty!

Sounds good, here we go

authors: brooksmtownsend joonas

repo: wasmCloud/wasmCloud


text:
fix: missing file extension on import/export

NodeJS requires file extensions on relative imports.

Thank you!

authors: TheNumberOne wataru-chocola