text1
stringlengths 0
536k
| text2
stringlengths 0
536k
| label
int64 0
1
|
---|---|---|
<p dir="auto">Is there a way to access the logs of both electron processes, main and renderer?</p>
<p dir="auto">I used Spectron before, which had this functionality as functions. But I haven't seen it in the API docs of playwright, so is there a way to get them by using the current API?</p> | <h3 dir="auto">System info</h3>
<ul dir="auto">
<li>Playwright Version: v1.32.0</li>
<li>Operating System: Windows 11 Version 22H2 (OS Build: 22621.1413</li>
<li>Browser: Chromium</li>
<li>Other info: Channel = msedge</li>
</ul>
<h3 dir="auto">Source code</h3>
<div class="highlight highlight-source-cs notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="using Microsoft.Playwright;
using var playwright = await Playwright.CreateAsync();
await using var browser = await playwright.Chromium.LaunchAsync(new() { Channel = "msedge", Headless = false });
var page = await browser.NewPageAsync();
await page.GotoAsync("https://playwright.dev/dotnet");
await page.ScreenshotAsync(new()
{
Path = "screenshot.png"
});"><pre class="notranslate"><span class="pl-k">using</span> Microsoft<span class="pl-kos">.</span>Playwright<span class="pl-kos">;</span>
<span class="pl-k">using</span> <span class="pl-smi">var</span> <span class="pl-s1">playwright</span> <span class="pl-c1">=</span> <span class="pl-k">await</span> Playwright<span class="pl-kos">.</span><span class="pl-en">CreateAsync</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-k">await</span> <span class="pl-k">using</span> <span class="pl-smi">var</span> <span class="pl-s1">browser</span> <span class="pl-c1">=</span> <span class="pl-k">await</span> playwright<span class="pl-kos">.</span>Chromium<span class="pl-kos">.</span><span class="pl-en">LaunchAsync</span><span class="pl-kos">(</span><span class="pl-k">new</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-s1">Channel</span> <span class="pl-c1">=</span> <span class="pl-s"><span class="pl-s">"</span>msedge<span class="pl-s">"</span></span><span class="pl-kos">,</span> <span class="pl-s1">Headless</span> <span class="pl-c1">=</span> <span class="pl-c1">false</span> <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-smi">var</span> <span class="pl-s1">page</span> <span class="pl-c1">=</span> <span class="pl-k">await</span> browser<span class="pl-kos">.</span><span class="pl-en">NewPageAsync</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-k">await</span> page<span class="pl-kos">.</span><span class="pl-en">GotoAsync</span><span class="pl-kos">(</span><span class="pl-s"><span class="pl-s">"</span>https://playwright.dev/dotnet<span class="pl-s">"</span></span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-k">await</span> page<span class="pl-kos">.</span><span class="pl-en">ScreenshotAsync</span><span class="pl-kos">(</span><span class="pl-k">new</span><span class="pl-kos">(</span><span class="pl-kos">)</span>
<span class="pl-kos">{</span>
<span class="pl-s1">Path</span> <span class="pl-c1">=</span> <span class="pl-s"><span class="pl-s">"</span>screenshot.png<span class="pl-s">"</span></span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<p dir="auto"><strong>Expected</strong></p>
<p dir="auto">MS Edge should be launched.</p>
<p dir="auto"><strong>Actual</strong></p>
<p dir="auto">Browser fails to launch with the following exception:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Unhandled exception. Microsoft.Playwright.PlaywrightException: Browser closed.
==================== Browser output: ====================
<launching> C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe --disable-field-trial-config --disable-background-networking --enable-features=NetworkService,NetworkServiceInProcess --disable-background-timer-throttling --disable-backgrounding-occluded-windows --disable-back-forward-cache --disable-breakpad --disable-client-side-phishing-detection --disable-component-extensions-with-background-pages --disable-component-update --no-default-browser-check --disable-default-apps --disable-dev-shm-usage --disable-extensions --disable-features=ImprovedCookieControls,LazyFrameLoading,GlobalMediaControls,DestroyProfileOnBrowserClose,MediaRouter,DialMediaRouteProvider,AcceptCHFrame,AutoExpandDetailsElement,CertificateTransparencyComponentUpdater,AvoidUnnecessaryBeforeUnloadCheckSync,Translate --allow-pre-commit-input --disable-hang-monitor --disable-ipc-flooding-protection --disable-popup-blocking --disable-prompt-on-repost --disable-renderer-backgrounding --disable-sync --force-color-profile=srgb --metrics-recording-only --no-first-run --enable-automation --password-store=basic --use-mock-keychain --no-service-autorun --export-tagged-pdf --no-sandbox --user-data-dir=C:\Users\<User Id>\AppData\Local\Temp\playwright_chromiumdev_profile-RA89d8 --remote-debugging-pipe --no-startup-window
<launched> pid=5708
[pid=5708][err] [5708:10068:0328/130624.697:ERROR:sitelist_downloader.cc(131)] No primary account. Unable to fetch access token.
at Microsoft.Playwright.Transport.Connection.InnerSendMessageToServerAsync[T](String guid, String method, Dictionary`2 dictionary) in /_/src/Playwright/Transport/Connection.cs:line 143
at Microsoft.Playwright.Transport.Connection.WrapApiCallAsync[T](Func`1 action, Boolean isInternal) in /_/src/Playwright/Transport/Connection.cs:line 465
at Microsoft.Playwright.Core.BrowserContext.NewPageAsync() in /_/src/Playwright/Core/BrowserContext.cs:line 285
at Microsoft.Playwright.Core.Browser.NewPageAsync(BrowserNewPageOptions options) in /_/src/Playwright/Core/Browser.cs:line 186
at Program.<Main>$(String[] args) in C:\src\PlaywrightMSEdge\PlaywrightMSEdge\Program.cs:line 5
at Program.<Main>$(String[] args) in C:\src\PlaywrightMSEdge\PlaywrightMSEdge\Program.cs:line 7
at Program.<Main>(String[] args)"><pre class="notranslate"><code class="notranslate">Unhandled exception. Microsoft.Playwright.PlaywrightException: Browser closed.
==================== Browser output: ====================
<launching> C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe --disable-field-trial-config --disable-background-networking --enable-features=NetworkService,NetworkServiceInProcess --disable-background-timer-throttling --disable-backgrounding-occluded-windows --disable-back-forward-cache --disable-breakpad --disable-client-side-phishing-detection --disable-component-extensions-with-background-pages --disable-component-update --no-default-browser-check --disable-default-apps --disable-dev-shm-usage --disable-extensions --disable-features=ImprovedCookieControls,LazyFrameLoading,GlobalMediaControls,DestroyProfileOnBrowserClose,MediaRouter,DialMediaRouteProvider,AcceptCHFrame,AutoExpandDetailsElement,CertificateTransparencyComponentUpdater,AvoidUnnecessaryBeforeUnloadCheckSync,Translate --allow-pre-commit-input --disable-hang-monitor --disable-ipc-flooding-protection --disable-popup-blocking --disable-prompt-on-repost --disable-renderer-backgrounding --disable-sync --force-color-profile=srgb --metrics-recording-only --no-first-run --enable-automation --password-store=basic --use-mock-keychain --no-service-autorun --export-tagged-pdf --no-sandbox --user-data-dir=C:\Users\<User Id>\AppData\Local\Temp\playwright_chromiumdev_profile-RA89d8 --remote-debugging-pipe --no-startup-window
<launched> pid=5708
[pid=5708][err] [5708:10068:0328/130624.697:ERROR:sitelist_downloader.cc(131)] No primary account. Unable to fetch access token.
at Microsoft.Playwright.Transport.Connection.InnerSendMessageToServerAsync[T](String guid, String method, Dictionary`2 dictionary) in /_/src/Playwright/Transport/Connection.cs:line 143
at Microsoft.Playwright.Transport.Connection.WrapApiCallAsync[T](Func`1 action, Boolean isInternal) in /_/src/Playwright/Transport/Connection.cs:line 465
at Microsoft.Playwright.Core.BrowserContext.NewPageAsync() in /_/src/Playwright/Core/BrowserContext.cs:line 285
at Microsoft.Playwright.Core.Browser.NewPageAsync(BrowserNewPageOptions options) in /_/src/Playwright/Core/Browser.cs:line 186
at Program.<Main>$(String[] args) in C:\src\PlaywrightMSEdge\PlaywrightMSEdge\Program.cs:line 5
at Program.<Main>$(String[] args) in C:\src\PlaywrightMSEdge\PlaywrightMSEdge\Program.cs:line 7
at Program.<Main>(String[] args)
</code></pre></div>
<p dir="auto"><strong>Logs with <code class="notranslate">DEBUG: pw:browser,pw:protocol,pw:api</code></strong></p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="2023-03-28T07:57:51.753Z pw:browser <launching> C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe --disable-field-trial-config --disable-background-networking --enable-features=NetworkService,NetworkServiceInProcess --disable-background-timer-throttling --disable-backgrounding-occluded-windows --disable-back-forward-cache --disable-breakpad --disable-client-side-phishing-detection --disable-component-extensions-with-background-pages --disable-component-update --no-default-browser-check --disable-default-apps --disable-dev-shm-usage --disable-extensions --disable-features=ImprovedCookieControls,LazyFrameLoading,GlobalMediaControls,DestroyProfileOnBrowserClose,MediaRouter,DialMediaRouteProvider,AcceptCHFrame,AutoExpandDetailsElement,CertificateTransparencyComponentUpdater,AvoidUnnecessaryBeforeUnloadCheckSync,Translate --allow-pre-commit-input --disable-hang-monitor --disable-ipc-flooding-protection --disable-popup-blocking --disable-prompt-on-repost --disable-renderer-backgrounding --disable-sync --force-color-profile=srgb --metrics-recording-only --no-first-run --enable-automation --password-store=basic --use-mock-keychain --no-service-autorun --export-tagged-pdf --no-sandbox --user-data-dir=C:\Users\<User Id>\AppData\Local\Temp\playwright_chromiumdev_profile-yeCyZw --remote-debugging-pipe --no-startup-window
2023-03-28T07:57:51.763Z pw:browser <launched> pid=5536
2023-03-28T07:57:51.764Z pw:protocol SEND Γû║ {"id":1,"method":"Browser.getVersion"}
2023-03-28T07:57:51.960Z pw:protocol ΓùÇ RECV {"id":1,"result":{"protocolVersion":"1.3","product":"Edg/111.0.1661.54","revision":"@9e410ec23a36266fd1bd72da1ffa52ca0cbfab78","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36 Edg/111.0.1661.54","jsVersion":"11.1.24.7"}}
2023-03-28T07:57:51.961Z pw:protocol SEND Γû║ {"id":2,"method":"Target.setAutoAttach","params":{"autoAttach":true,"waitForDebuggerOnStart":true,"flatten":true}}
2023-03-28T07:57:51.968Z pw:browser [pid=5536][err] [5536:25064:0328/132751.967:ERROR:sitelist_downloader.cc(131)] No primary account. Unable to fetch access token.
2023-03-28T07:57:51.969Z pw:protocol ΓùÇ RECV {"id":2,"result":{}}
2023-03-28T07:57:51.985Z pw:protocol SEND Γû║ {"id":3,"method":"Target.createBrowserContext","params":{"disposeOnDetach":true}}
2023-03-28T07:57:51.996Z pw:protocol ΓùÇ RECV {"id":3,"result":{"browserContextId":"EBFA0FAEFFC517F01F3C9513061EDAF2"}}
2023-03-28T07:57:51.998Z pw:protocol SEND Γû║ {"id":4,"method":"Browser.setDownloadBehavior","params":{"behavior":"allowAndName","browserContextId":"EBFA0FAEFFC517F01F3C9513061EDAF2","downloadPath":"C:\\Users\\<User Id>\\AppData\\Local\\Temp\\playwright-artifacts-1fvKAo","eventsEnabled":true}}
2023-03-28T07:57:52.004Z pw:protocol ΓùÇ RECV {"id":4,"result":{}}
2023-03-28T07:57:52.026Z pw:protocol SEND Γû║ {"id":5,"method":"Target.createTarget","params":{"url":"about:blank","browserContextId":"EBFA0FAEFFC517F01F3C9513061EDAF2"}}
2023-03-28T07:57:54.127Z pw:browser [pid=5536] <gracefully close start>
2023-03-28T07:57:54.127Z pw:browser [pid=5536] <kill>
2023-03-28T07:57:54.127Z pw:browser [pid=5536] <will force kill>
2023-03-28T07:57:54.234Z pw:browser [pid=5536] taskkill stderr: ERROR: The process "5536" not found.
2023-03-28T07:57:54.235Z pw:browser [pid=5536] <process did exit: exitCode=3221225477, signal=null>
2023-03-28T07:57:54.235Z pw:browser [pid=5536] starting temporary directories cleanup
2023-03-28T07:58:07.306Z pw:browser [pid=5536] finished temporary directories cleanup
2023-03-28T07:58:07.306Z pw:browser [pid=5536] <gracefully close end>
Unhandled exception. Microsoft.Playwright.PlaywrightException: Browser closed.
==================== Browser output: ====================
<launching> C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe --disable-field-trial-config --disable-background-networking --enable-features=NetworkService,NetworkServiceInProcess --disable-background-timer-throttling --disable-backgrounding-occluded-windows --disable-back-forward-cache --disable-breakpad --disable-client-side-phishing-detection --disable-component-extensions-with-background-pages --disable-component-update --no-default-browser-check --disable-default-apps --disable-dev-shm-usage --disable-extensions --disable-features=ImprovedCookieControls,LazyFrameLoading,GlobalMediaControls,DestroyProfileOnBrowserClose,MediaRouter,DialMediaRouteProvider,AcceptCHFrame,AutoExpandDetailsElement,CertificateTransparencyComponentUpdater,AvoidUnnecessaryBeforeUnloadCheckSync,Translate --allow-pre-commit-input --disable-hang-monitor --disable-ipc-flooding-protection --disable-popup-blocking --disable-prompt-on-repost --disable-renderer-backgrounding --disable-sync --force-color-profile=srgb --metrics-recording-only --no-first-run --enable-automation --password-store=basic --use-mock-keychain --no-service-autorun --export-tagged-pdf --no-sandbox --user-data-dir=C:\Users\<User Id>\AppData\Local\Temp\playwright_chromiumdev_profile-yeCyZw --remote-debugging-pipe --no-startup-window
<launched> pid=5536
[pid=5536][err] [5536:25064:0328/132751.967:ERROR:sitelist_downloader.cc(131)] No primary account. Unable to fetch access token.
at Microsoft.Playwright.Transport.Connection.InnerSendMessageToServerAsync[T](String guid, String method, Dictionary`2 dictionary) in /_/src/Playwright/Transport/Connection.cs:line 180
at Microsoft.Playwright.Transport.Connection.WrapApiCallAsync[T](Func`1 action, Boolean isInternal) in /_/src/Playwright/Transport/Connection.cs:line 502
at Microsoft.Playwright.Core.BrowserContext.NewPageAsync() in /_/src/Playwright/Core/BrowserContext.cs:line 293
at Microsoft.Playwright.Core.Browser.NewPageAsync(BrowserNewPageOptions options) in /_/src/Playwright/Core/Browser.cs:line 174
at Program.<Main>$(String[] args) in C:\src\PlaywrightMSEdge\PlaywrightMSEdge\Program.cs:line 5
at Program.<Main>$(String[] args) in C:\src\PlaywrightMSEdge\PlaywrightMSEdge\Program.cs:line 7
at Program.<Main>(String[] args)
C:\src\PlaywrightMSEdge\PlaywrightMSEdge\bin\Debug\net7.0\PlaywrightMSEdge.exe (process 24300) exited with code -532462766."><pre class="notranslate"><code class="notranslate">2023-03-28T07:57:51.753Z pw:browser <launching> C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe --disable-field-trial-config --disable-background-networking --enable-features=NetworkService,NetworkServiceInProcess --disable-background-timer-throttling --disable-backgrounding-occluded-windows --disable-back-forward-cache --disable-breakpad --disable-client-side-phishing-detection --disable-component-extensions-with-background-pages --disable-component-update --no-default-browser-check --disable-default-apps --disable-dev-shm-usage --disable-extensions --disable-features=ImprovedCookieControls,LazyFrameLoading,GlobalMediaControls,DestroyProfileOnBrowserClose,MediaRouter,DialMediaRouteProvider,AcceptCHFrame,AutoExpandDetailsElement,CertificateTransparencyComponentUpdater,AvoidUnnecessaryBeforeUnloadCheckSync,Translate --allow-pre-commit-input --disable-hang-monitor --disable-ipc-flooding-protection --disable-popup-blocking --disable-prompt-on-repost --disable-renderer-backgrounding --disable-sync --force-color-profile=srgb --metrics-recording-only --no-first-run --enable-automation --password-store=basic --use-mock-keychain --no-service-autorun --export-tagged-pdf --no-sandbox --user-data-dir=C:\Users\<User Id>\AppData\Local\Temp\playwright_chromiumdev_profile-yeCyZw --remote-debugging-pipe --no-startup-window
2023-03-28T07:57:51.763Z pw:browser <launched> pid=5536
2023-03-28T07:57:51.764Z pw:protocol SEND Γû║ {"id":1,"method":"Browser.getVersion"}
2023-03-28T07:57:51.960Z pw:protocol ΓùÇ RECV {"id":1,"result":{"protocolVersion":"1.3","product":"Edg/111.0.1661.54","revision":"@9e410ec23a36266fd1bd72da1ffa52ca0cbfab78","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36 Edg/111.0.1661.54","jsVersion":"11.1.24.7"}}
2023-03-28T07:57:51.961Z pw:protocol SEND Γû║ {"id":2,"method":"Target.setAutoAttach","params":{"autoAttach":true,"waitForDebuggerOnStart":true,"flatten":true}}
2023-03-28T07:57:51.968Z pw:browser [pid=5536][err] [5536:25064:0328/132751.967:ERROR:sitelist_downloader.cc(131)] No primary account. Unable to fetch access token.
2023-03-28T07:57:51.969Z pw:protocol ΓùÇ RECV {"id":2,"result":{}}
2023-03-28T07:57:51.985Z pw:protocol SEND Γû║ {"id":3,"method":"Target.createBrowserContext","params":{"disposeOnDetach":true}}
2023-03-28T07:57:51.996Z pw:protocol ΓùÇ RECV {"id":3,"result":{"browserContextId":"EBFA0FAEFFC517F01F3C9513061EDAF2"}}
2023-03-28T07:57:51.998Z pw:protocol SEND Γû║ {"id":4,"method":"Browser.setDownloadBehavior","params":{"behavior":"allowAndName","browserContextId":"EBFA0FAEFFC517F01F3C9513061EDAF2","downloadPath":"C:\\Users\\<User Id>\\AppData\\Local\\Temp\\playwright-artifacts-1fvKAo","eventsEnabled":true}}
2023-03-28T07:57:52.004Z pw:protocol ΓùÇ RECV {"id":4,"result":{}}
2023-03-28T07:57:52.026Z pw:protocol SEND Γû║ {"id":5,"method":"Target.createTarget","params":{"url":"about:blank","browserContextId":"EBFA0FAEFFC517F01F3C9513061EDAF2"}}
2023-03-28T07:57:54.127Z pw:browser [pid=5536] <gracefully close start>
2023-03-28T07:57:54.127Z pw:browser [pid=5536] <kill>
2023-03-28T07:57:54.127Z pw:browser [pid=5536] <will force kill>
2023-03-28T07:57:54.234Z pw:browser [pid=5536] taskkill stderr: ERROR: The process "5536" not found.
2023-03-28T07:57:54.235Z pw:browser [pid=5536] <process did exit: exitCode=3221225477, signal=null>
2023-03-28T07:57:54.235Z pw:browser [pid=5536] starting temporary directories cleanup
2023-03-28T07:58:07.306Z pw:browser [pid=5536] finished temporary directories cleanup
2023-03-28T07:58:07.306Z pw:browser [pid=5536] <gracefully close end>
Unhandled exception. Microsoft.Playwright.PlaywrightException: Browser closed.
==================== Browser output: ====================
<launching> C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe --disable-field-trial-config --disable-background-networking --enable-features=NetworkService,NetworkServiceInProcess --disable-background-timer-throttling --disable-backgrounding-occluded-windows --disable-back-forward-cache --disable-breakpad --disable-client-side-phishing-detection --disable-component-extensions-with-background-pages --disable-component-update --no-default-browser-check --disable-default-apps --disable-dev-shm-usage --disable-extensions --disable-features=ImprovedCookieControls,LazyFrameLoading,GlobalMediaControls,DestroyProfileOnBrowserClose,MediaRouter,DialMediaRouteProvider,AcceptCHFrame,AutoExpandDetailsElement,CertificateTransparencyComponentUpdater,AvoidUnnecessaryBeforeUnloadCheckSync,Translate --allow-pre-commit-input --disable-hang-monitor --disable-ipc-flooding-protection --disable-popup-blocking --disable-prompt-on-repost --disable-renderer-backgrounding --disable-sync --force-color-profile=srgb --metrics-recording-only --no-first-run --enable-automation --password-store=basic --use-mock-keychain --no-service-autorun --export-tagged-pdf --no-sandbox --user-data-dir=C:\Users\<User Id>\AppData\Local\Temp\playwright_chromiumdev_profile-yeCyZw --remote-debugging-pipe --no-startup-window
<launched> pid=5536
[pid=5536][err] [5536:25064:0328/132751.967:ERROR:sitelist_downloader.cc(131)] No primary account. Unable to fetch access token.
at Microsoft.Playwright.Transport.Connection.InnerSendMessageToServerAsync[T](String guid, String method, Dictionary`2 dictionary) in /_/src/Playwright/Transport/Connection.cs:line 180
at Microsoft.Playwright.Transport.Connection.WrapApiCallAsync[T](Func`1 action, Boolean isInternal) in /_/src/Playwright/Transport/Connection.cs:line 502
at Microsoft.Playwright.Core.BrowserContext.NewPageAsync() in /_/src/Playwright/Core/BrowserContext.cs:line 293
at Microsoft.Playwright.Core.Browser.NewPageAsync(BrowserNewPageOptions options) in /_/src/Playwright/Core/Browser.cs:line 174
at Program.<Main>$(String[] args) in C:\src\PlaywrightMSEdge\PlaywrightMSEdge\Program.cs:line 5
at Program.<Main>$(String[] args) in C:\src\PlaywrightMSEdge\PlaywrightMSEdge\Program.cs:line 7
at Program.<Main>(String[] args)
C:\src\PlaywrightMSEdge\PlaywrightMSEdge\bin\Debug\net7.0\PlaywrightMSEdge.exe (process 24300) exited with code -532462766.
</code></pre></div>
<p dir="auto"><strong>Edge Policies</strong></p>
<div class="highlight highlight-source-json notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="{
"chromeMetadata": {
"OS": "Windows 11 Version 22H2 (Build 22621.1413)",
"application": "Microsoft Edge",
"revision": "9e410ec23a36266fd1bd72da1ffa52ca0cbfab78",
"version": "111.0.1661.54 (Official build) (64-bit)"
},
"edgePolicies": {
"BrowserSignin": {
"level": "mandatory",
"scope": "user",
"source": "platform",
"value": 2
},
"ClickOnceEnabled": {
"level": "mandatory",
"scope": "machine",
"source": "platform",
"value": true
},
"DoNotSilentlyBlockProtocolsFromOrigins": {
"level": "mandatory",
"scope": "machine",
"source": "platform",
"value": [ {
"allowed_origins": [ "teams.microsoft.com", "http://teams.microsoft.com:8080" ],
"protocol": "spotify"
}, {
"allowed_origins": [ "teams.microsoft.com", "https://.mail.microsoft.com" ],
"protocol": "msteams"
}, {
"allowed_origins": [ "*" ],
"protocol": "msoutlook"
} ]
},
"ExperimentationAndConfigurationServiceControl": {
"level": "mandatory",
"scope": "machine",
"source": "platform",
"value": 2
},
"ExtensionInstallBlocklist": {
"level": "mandatory",
"scope": "machine",
"source": "platform",
"value": [ ]
},
"ForceSync": {
"level": "mandatory",
"scope": "user",
"source": "platform",
"value": true
},
"InternetExplorerIntegrationCloudSiteList": {
"level": "mandatory",
"scope": "machine",
"source": "platform",
"value": "80f5ad94-bb13-4c0c-9fb3-d1920d9cbfaf"
},
"InternetExplorerIntegrationLevel": {
"level": "mandatory",
"scope": "machine",
"source": "platform",
"value": 1
},
"InternetExplorerIntegrationSiteList": {
"level": "mandatory",
"scope": "machine",
"source": "platform",
"value": ""
},
"SleepingTabsBlockedForUrls": {
"level": "recommended",
"scope": "user",
"source": "platform",
"value": [ "[*.]microsoft.com", "[*.]office.com", "[*.]microsoftonline.com", "[*.]outlook.com" ]
},
"SleepingTabsEnabled": {
"level": "recommended",
"scope": "user",
"source": "platform",
"value": true
},
"SleepingTabsTimeout": {
"level": "recommended",
"scope": "user",
"source": "platform",
"value": 1800
},
"SmartScreenEnabled": {
"level": "mandatory",
"scope": "machine",
"source": "platform",
"value": true
},
"SmartScreenForTrustedDownloadsEnabled": {
"level": "mandatory",
"scope": "machine",
"source": "platform",
"value": false
},
"SmartScreenPuaEnabled": {
"level": "mandatory",
"scope": "machine",
"source": "platform",
"value": true
},
"StartupBoostEnabled": {
"level": "recommended",
"scope": "user",
"source": "platform",
"value": true
}
},
"extensionPolicies": {
},
"status": {
"updater": {
"policyDescriptionKey": "statusUpdater",
"timeSinceLastRefresh": "8 hours ago",
"version": "1.3.173.53"
},
"user": {
}
}
}"><pre class="notranslate">{
<span class="pl-ent">"chromeMetadata"</span>: {
<span class="pl-ent">"OS"</span>: <span class="pl-s"><span class="pl-pds">"</span>Windows 11 Version 22H2 (Build 22621.1413)<span class="pl-pds">"</span></span>,
<span class="pl-ent">"application"</span>: <span class="pl-s"><span class="pl-pds">"</span>Microsoft Edge<span class="pl-pds">"</span></span>,
<span class="pl-ent">"revision"</span>: <span class="pl-s"><span class="pl-pds">"</span>9e410ec23a36266fd1bd72da1ffa52ca0cbfab78<span class="pl-pds">"</span></span>,
<span class="pl-ent">"version"</span>: <span class="pl-s"><span class="pl-pds">"</span>111.0.1661.54 (Official build) (64-bit)<span class="pl-pds">"</span></span>
},
<span class="pl-ent">"edgePolicies"</span>: {
<span class="pl-ent">"BrowserSignin"</span>: {
<span class="pl-ent">"level"</span>: <span class="pl-s"><span class="pl-pds">"</span>mandatory<span class="pl-pds">"</span></span>,
<span class="pl-ent">"scope"</span>: <span class="pl-s"><span class="pl-pds">"</span>user<span class="pl-pds">"</span></span>,
<span class="pl-ent">"source"</span>: <span class="pl-s"><span class="pl-pds">"</span>platform<span class="pl-pds">"</span></span>,
<span class="pl-ent">"value"</span>: <span class="pl-c1">2</span>
},
<span class="pl-ent">"ClickOnceEnabled"</span>: {
<span class="pl-ent">"level"</span>: <span class="pl-s"><span class="pl-pds">"</span>mandatory<span class="pl-pds">"</span></span>,
<span class="pl-ent">"scope"</span>: <span class="pl-s"><span class="pl-pds">"</span>machine<span class="pl-pds">"</span></span>,
<span class="pl-ent">"source"</span>: <span class="pl-s"><span class="pl-pds">"</span>platform<span class="pl-pds">"</span></span>,
<span class="pl-ent">"value"</span>: <span class="pl-c1">true</span>
},
<span class="pl-ent">"DoNotSilentlyBlockProtocolsFromOrigins"</span>: {
<span class="pl-ent">"level"</span>: <span class="pl-s"><span class="pl-pds">"</span>mandatory<span class="pl-pds">"</span></span>,
<span class="pl-ent">"scope"</span>: <span class="pl-s"><span class="pl-pds">"</span>machine<span class="pl-pds">"</span></span>,
<span class="pl-ent">"source"</span>: <span class="pl-s"><span class="pl-pds">"</span>platform<span class="pl-pds">"</span></span>,
<span class="pl-ent">"value"</span>: [ {
<span class="pl-ent">"allowed_origins"</span>: [ <span class="pl-s"><span class="pl-pds">"</span>teams.microsoft.com<span class="pl-pds">"</span></span>, <span class="pl-s"><span class="pl-pds">"</span>http://teams.microsoft.com:8080<span class="pl-pds">"</span></span> ],
<span class="pl-ent">"protocol"</span>: <span class="pl-s"><span class="pl-pds">"</span>spotify<span class="pl-pds">"</span></span>
}, {
<span class="pl-ent">"allowed_origins"</span>: [ <span class="pl-s"><span class="pl-pds">"</span>teams.microsoft.com<span class="pl-pds">"</span></span>, <span class="pl-s"><span class="pl-pds">"</span>https://.mail.microsoft.com<span class="pl-pds">"</span></span> ],
<span class="pl-ent">"protocol"</span>: <span class="pl-s"><span class="pl-pds">"</span>msteams<span class="pl-pds">"</span></span>
}, {
<span class="pl-ent">"allowed_origins"</span>: [ <span class="pl-s"><span class="pl-pds">"</span>*<span class="pl-pds">"</span></span> ],
<span class="pl-ent">"protocol"</span>: <span class="pl-s"><span class="pl-pds">"</span>msoutlook<span class="pl-pds">"</span></span>
} ]
},
<span class="pl-ent">"ExperimentationAndConfigurationServiceControl"</span>: {
<span class="pl-ent">"level"</span>: <span class="pl-s"><span class="pl-pds">"</span>mandatory<span class="pl-pds">"</span></span>,
<span class="pl-ent">"scope"</span>: <span class="pl-s"><span class="pl-pds">"</span>machine<span class="pl-pds">"</span></span>,
<span class="pl-ent">"source"</span>: <span class="pl-s"><span class="pl-pds">"</span>platform<span class="pl-pds">"</span></span>,
<span class="pl-ent">"value"</span>: <span class="pl-c1">2</span>
},
<span class="pl-ent">"ExtensionInstallBlocklist"</span>: {
<span class="pl-ent">"level"</span>: <span class="pl-s"><span class="pl-pds">"</span>mandatory<span class="pl-pds">"</span></span>,
<span class="pl-ent">"scope"</span>: <span class="pl-s"><span class="pl-pds">"</span>machine<span class="pl-pds">"</span></span>,
<span class="pl-ent">"source"</span>: <span class="pl-s"><span class="pl-pds">"</span>platform<span class="pl-pds">"</span></span>,
<span class="pl-ent">"value"</span>: [ ]
},
<span class="pl-ent">"ForceSync"</span>: {
<span class="pl-ent">"level"</span>: <span class="pl-s"><span class="pl-pds">"</span>mandatory<span class="pl-pds">"</span></span>,
<span class="pl-ent">"scope"</span>: <span class="pl-s"><span class="pl-pds">"</span>user<span class="pl-pds">"</span></span>,
<span class="pl-ent">"source"</span>: <span class="pl-s"><span class="pl-pds">"</span>platform<span class="pl-pds">"</span></span>,
<span class="pl-ent">"value"</span>: <span class="pl-c1">true</span>
},
<span class="pl-ent">"InternetExplorerIntegrationCloudSiteList"</span>: {
<span class="pl-ent">"level"</span>: <span class="pl-s"><span class="pl-pds">"</span>mandatory<span class="pl-pds">"</span></span>,
<span class="pl-ent">"scope"</span>: <span class="pl-s"><span class="pl-pds">"</span>machine<span class="pl-pds">"</span></span>,
<span class="pl-ent">"source"</span>: <span class="pl-s"><span class="pl-pds">"</span>platform<span class="pl-pds">"</span></span>,
<span class="pl-ent">"value"</span>: <span class="pl-s"><span class="pl-pds">"</span>80f5ad94-bb13-4c0c-9fb3-d1920d9cbfaf<span class="pl-pds">"</span></span>
},
<span class="pl-ent">"InternetExplorerIntegrationLevel"</span>: {
<span class="pl-ent">"level"</span>: <span class="pl-s"><span class="pl-pds">"</span>mandatory<span class="pl-pds">"</span></span>,
<span class="pl-ent">"scope"</span>: <span class="pl-s"><span class="pl-pds">"</span>machine<span class="pl-pds">"</span></span>,
<span class="pl-ent">"source"</span>: <span class="pl-s"><span class="pl-pds">"</span>platform<span class="pl-pds">"</span></span>,
<span class="pl-ent">"value"</span>: <span class="pl-c1">1</span>
},
<span class="pl-ent">"InternetExplorerIntegrationSiteList"</span>: {
<span class="pl-ent">"level"</span>: <span class="pl-s"><span class="pl-pds">"</span>mandatory<span class="pl-pds">"</span></span>,
<span class="pl-ent">"scope"</span>: <span class="pl-s"><span class="pl-pds">"</span>machine<span class="pl-pds">"</span></span>,
<span class="pl-ent">"source"</span>: <span class="pl-s"><span class="pl-pds">"</span>platform<span class="pl-pds">"</span></span>,
<span class="pl-ent">"value"</span>: <span class="pl-s"><span class="pl-pds">"</span><span class="pl-pds">"</span></span>
},
<span class="pl-ent">"SleepingTabsBlockedForUrls"</span>: {
<span class="pl-ent">"level"</span>: <span class="pl-s"><span class="pl-pds">"</span>recommended<span class="pl-pds">"</span></span>,
<span class="pl-ent">"scope"</span>: <span class="pl-s"><span class="pl-pds">"</span>user<span class="pl-pds">"</span></span>,
<span class="pl-ent">"source"</span>: <span class="pl-s"><span class="pl-pds">"</span>platform<span class="pl-pds">"</span></span>,
<span class="pl-ent">"value"</span>: [ <span class="pl-s"><span class="pl-pds">"</span>[*.]microsoft.com<span class="pl-pds">"</span></span>, <span class="pl-s"><span class="pl-pds">"</span>[*.]office.com<span class="pl-pds">"</span></span>, <span class="pl-s"><span class="pl-pds">"</span>[*.]microsoftonline.com<span class="pl-pds">"</span></span>, <span class="pl-s"><span class="pl-pds">"</span>[*.]outlook.com<span class="pl-pds">"</span></span> ]
},
<span class="pl-ent">"SleepingTabsEnabled"</span>: {
<span class="pl-ent">"level"</span>: <span class="pl-s"><span class="pl-pds">"</span>recommended<span class="pl-pds">"</span></span>,
<span class="pl-ent">"scope"</span>: <span class="pl-s"><span class="pl-pds">"</span>user<span class="pl-pds">"</span></span>,
<span class="pl-ent">"source"</span>: <span class="pl-s"><span class="pl-pds">"</span>platform<span class="pl-pds">"</span></span>,
<span class="pl-ent">"value"</span>: <span class="pl-c1">true</span>
},
<span class="pl-ent">"SleepingTabsTimeout"</span>: {
<span class="pl-ent">"level"</span>: <span class="pl-s"><span class="pl-pds">"</span>recommended<span class="pl-pds">"</span></span>,
<span class="pl-ent">"scope"</span>: <span class="pl-s"><span class="pl-pds">"</span>user<span class="pl-pds">"</span></span>,
<span class="pl-ent">"source"</span>: <span class="pl-s"><span class="pl-pds">"</span>platform<span class="pl-pds">"</span></span>,
<span class="pl-ent">"value"</span>: <span class="pl-c1">1800</span>
},
<span class="pl-ent">"SmartScreenEnabled"</span>: {
<span class="pl-ent">"level"</span>: <span class="pl-s"><span class="pl-pds">"</span>mandatory<span class="pl-pds">"</span></span>,
<span class="pl-ent">"scope"</span>: <span class="pl-s"><span class="pl-pds">"</span>machine<span class="pl-pds">"</span></span>,
<span class="pl-ent">"source"</span>: <span class="pl-s"><span class="pl-pds">"</span>platform<span class="pl-pds">"</span></span>,
<span class="pl-ent">"value"</span>: <span class="pl-c1">true</span>
},
<span class="pl-ent">"SmartScreenForTrustedDownloadsEnabled"</span>: {
<span class="pl-ent">"level"</span>: <span class="pl-s"><span class="pl-pds">"</span>mandatory<span class="pl-pds">"</span></span>,
<span class="pl-ent">"scope"</span>: <span class="pl-s"><span class="pl-pds">"</span>machine<span class="pl-pds">"</span></span>,
<span class="pl-ent">"source"</span>: <span class="pl-s"><span class="pl-pds">"</span>platform<span class="pl-pds">"</span></span>,
<span class="pl-ent">"value"</span>: <span class="pl-c1">false</span>
},
<span class="pl-ent">"SmartScreenPuaEnabled"</span>: {
<span class="pl-ent">"level"</span>: <span class="pl-s"><span class="pl-pds">"</span>mandatory<span class="pl-pds">"</span></span>,
<span class="pl-ent">"scope"</span>: <span class="pl-s"><span class="pl-pds">"</span>machine<span class="pl-pds">"</span></span>,
<span class="pl-ent">"source"</span>: <span class="pl-s"><span class="pl-pds">"</span>platform<span class="pl-pds">"</span></span>,
<span class="pl-ent">"value"</span>: <span class="pl-c1">true</span>
},
<span class="pl-ent">"StartupBoostEnabled"</span>: {
<span class="pl-ent">"level"</span>: <span class="pl-s"><span class="pl-pds">"</span>recommended<span class="pl-pds">"</span></span>,
<span class="pl-ent">"scope"</span>: <span class="pl-s"><span class="pl-pds">"</span>user<span class="pl-pds">"</span></span>,
<span class="pl-ent">"source"</span>: <span class="pl-s"><span class="pl-pds">"</span>platform<span class="pl-pds">"</span></span>,
<span class="pl-ent">"value"</span>: <span class="pl-c1">true</span>
}
},
<span class="pl-ent">"extensionPolicies"</span>: {
},
<span class="pl-ent">"status"</span>: {
<span class="pl-ent">"updater"</span>: {
<span class="pl-ent">"policyDescriptionKey"</span>: <span class="pl-s"><span class="pl-pds">"</span>statusUpdater<span class="pl-pds">"</span></span>,
<span class="pl-ent">"timeSinceLastRefresh"</span>: <span class="pl-s"><span class="pl-pds">"</span>8 hours ago<span class="pl-pds">"</span></span>,
<span class="pl-ent">"version"</span>: <span class="pl-s"><span class="pl-pds">"</span>1.3.173.53<span class="pl-pds">"</span></span>
},
<span class="pl-ent">"user"</span>: {
}
}
}</pre></div>
<p dir="auto"><strong>Things tried</strong></p>
<ul dir="auto">
<li>Launching with <code class="notranslate">msedge-dev</code> channel</li>
<li>Reinstalling Edge</li>
</ul>
<p dir="auto">Other browsers are working fine.</p> | 0 |
<p dir="auto">Challenge <a href="https://www.freecodecamp.com/challenges/find-the-longest-word-in-a-string#?solution=var%20arr%20%3D%20%5B%5D%3B%0Avar%20i%20%3D%200%3B%0Avar%20lengthArray%20%3D%20%5B%5D%3B%0A%0A%0Afunction%20findLongestWord(str)%20%7B%0A%20%20arr%20%3D%20str.split(%27%20%27)%3B%0A%20%20%0A%20%20for%20(i%20%3D%200%3B%20i%20%3C%2010%3B%20i%2B%2B)%20%7B%0A%20%20%20%20if%20(arr%5Bi%5D)%20%7B%0A%20%20%20%20%20%20lengthArray.push(arr%5Bi%5D.length)%3B%0A%20%20%20%20%7D%0A%20%20%7D%0A%20%20lengthArray.sort(function(a%2Cb)%20%7B%0A%20%20return%20b%20-%20a%3B%0A%7D)%3B%0A%20%20return%20lengthArray%5B0%5D%3B%0A%7D%0A%0AfindLongestWord(%22May%20the%20force%20be%20with%20you%22)%3B%0A" rel="nofollow">Find the Longest Word in a String</a> has an issue.<br>
User Agent is: <code class="notranslate">Mozilla/5.0 (Windows NT 10.0; WOW64; rv:50.0) Gecko/20100101 Firefox/50.0</code>.<br>
Please describe how to reproduce this issue, and include links to screenshots if possible.</p>
<p dir="auto">My code:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="var arr = [];
var i = 0;
var lengthArray = [];
function findLongestWord(str) {
arr = str.split(' ');
for (i = 0; i < 10; i++) {
if (arr[i]) {
lengthArray.push(arr[i].length);
}
}
lengthArray.sort(function(a,b) {
return b - a;
});
return lengthArray[0];
}
findLongestWord("May the force be with you");
"><pre class="notranslate"><span class="pl-k">var</span> <span class="pl-s1">arr</span> <span class="pl-c1">=</span> <span class="pl-kos">[</span><span class="pl-kos">]</span><span class="pl-kos">;</span>
<span class="pl-k">var</span> <span class="pl-s1">i</span> <span class="pl-c1">=</span> <span class="pl-c1">0</span><span class="pl-kos">;</span>
<span class="pl-k">var</span> <span class="pl-s1">lengthArray</span> <span class="pl-c1">=</span> <span class="pl-kos">[</span><span class="pl-kos">]</span><span class="pl-kos">;</span>
<span class="pl-k">function</span> <span class="pl-en">findLongestWord</span><span class="pl-kos">(</span><span class="pl-s1">str</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-s1">arr</span> <span class="pl-c1">=</span> <span class="pl-s1">str</span><span class="pl-kos">.</span><span class="pl-en">split</span><span class="pl-kos">(</span><span class="pl-s">' '</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-k">for</span> <span class="pl-kos">(</span><span class="pl-s1">i</span> <span class="pl-c1">=</span> <span class="pl-c1">0</span><span class="pl-kos">;</span> <span class="pl-s1">i</span> <span class="pl-c1"><</span> <span class="pl-c1">10</span><span class="pl-kos">;</span> <span class="pl-s1">i</span><span class="pl-c1">++</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-s1">arr</span><span class="pl-kos">[</span><span class="pl-s1">i</span><span class="pl-kos">]</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-s1">lengthArray</span><span class="pl-kos">.</span><span class="pl-en">push</span><span class="pl-kos">(</span><span class="pl-s1">arr</span><span class="pl-kos">[</span><span class="pl-s1">i</span><span class="pl-kos">]</span><span class="pl-kos">.</span><span class="pl-c1">length</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span>
<span class="pl-kos">}</span>
<span class="pl-s1">lengthArray</span><span class="pl-kos">.</span><span class="pl-en">sort</span><span class="pl-kos">(</span><span class="pl-k">function</span><span class="pl-kos">(</span><span class="pl-s1">a</span><span class="pl-kos">,</span><span class="pl-s1">b</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-k">return</span> <span class="pl-s1">b</span> <span class="pl-c1">-</span> <span class="pl-s1">a</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-k">return</span> <span class="pl-s1">lengthArray</span><span class="pl-kos">[</span><span class="pl-c1">0</span><span class="pl-kos">]</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span>
<span class="pl-en">findLongestWord</span><span class="pl-kos">(</span><span class="pl-s">"May the force be with you"</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div> | <p dir="auto">Challenge <a href="https://www.freecodecamp.com/challenges/factorialize-a-number#?solution=var%20count%3D1%3B%0Afunction%20factorialize%28num%29%20%7B%0A%20%20for%28var%20i%3D1%3B%20i%3C%3Dnum%3Bi%2B%2B%29%7B%0A%20%20%20%20%0A%20%20%20%20count%3D%20count%20*%20i%3B%0A%20%20%20%20%0A%20%20%7D%0A%20%20return%20count%3B%0A%20%20%0A%7D%0A%0Afactorialize%280%29%3B%0A" rel="nofollow">Factorialize a Number</a> has an issue.<br>
User Agent is: <code class="notranslate">Mozilla/5.0 (Windows NT 5.1; rv:47.0) Gecko/20100101 Firefox/47.0</code>.<br>
Please describe how to reproduce this issue, and include links to screenshots if possible.</p>
<p dir="auto">My code:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="var count=1;
function factorialize(num) {
for(var i=1; i<=num;i++){
count= count * i;
}
return count;
}
factorialize(0);
"><pre class="notranslate"><span class="pl-k">var</span> <span class="pl-s1">count</span><span class="pl-c1">=</span><span class="pl-c1">1</span><span class="pl-kos">;</span>
<span class="pl-k">function</span> <span class="pl-en">factorialize</span><span class="pl-kos">(</span><span class="pl-s1">num</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-k">for</span><span class="pl-kos">(</span><span class="pl-k">var</span> <span class="pl-s1">i</span><span class="pl-c1">=</span><span class="pl-c1">1</span><span class="pl-kos">;</span> <span class="pl-s1">i</span><span class="pl-c1"><=</span><span class="pl-s1">num</span><span class="pl-kos">;</span><span class="pl-s1">i</span><span class="pl-c1">++</span><span class="pl-kos">)</span><span class="pl-kos">{</span>
<span class="pl-s1">count</span><span class="pl-c1">=</span> <span class="pl-s1">count</span> <span class="pl-c1">*</span> <span class="pl-s1">i</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span>
<span class="pl-k">return</span> <span class="pl-s1">count</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span>
<span class="pl-en">factorialize</span><span class="pl-kos">(</span><span class="pl-c1">0</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div> | 1 |
<ul dir="auto">
<li>Electron version: 2.0.0.beta-1</li>
<li>Operating system: 10.13.3 Beta (17D34a)</li>
</ul>
<h3 dir="auto">Expected behavior</h3>
<p dir="auto">Electron should not crash when using <code class="notranslate">browserWindow.setVibrancy</code></p>
<h3 dir="auto">Actual behavior</h3>
<p dir="auto">Electron crashes intermittently. Crash report:<br>
<a href="https://gist.github.com/tommoor/90b7b3db53a32f9dd165bb234b9f2d9d">https://gist.github.com/tommoor/90b7b3db53a32f9dd165bb234b9f2d9d</a></p> | <h3 dir="auto">Problem Description</h3>
<p dir="auto">I would like to customize the location of the Electron/Chromium cache (for Windows and other OS/s). Currently cache used the same folder than getPath('userData')<br>
2 reasons :</p>
<ul dir="auto">
<li>having cache in the roaming user part impacts the size of the profile. When your deploy your application on system like Citrix, it has a huge cost ($) in term of space disk and cost (time) to synchronize profile.</li>
<li>we store our own user data under getPath('userData'). But this folder is shared with the Electron cache, so there is a mix of Electron folders/files and of our product folders/file. It is bit confusing.</li>
</ul>
<h3 dir="auto">Proposed Solution</h3>
<p dir="auto">I see in C++ code an attempt of 'cache'/ 'userCache' path implementation. But not finished. As far as I see, it would be to add a piece of code here (very roughly) :</p>
<p dir="auto">src\electron\atom\browser\atom_browser_context.cc<br>
`<br>
AtomBrowserContext::AtomBrowserContext<br>
...</p>
<blockquote>
<blockquote>
<p dir="auto">if (!base::PathService::Get(DIR_CACHE, &path_)) {<br>
if (!base::PathService::Get(DIR_USER_DATA, &path_)) {<br>
base::PathService::Get(DIR_APP_DATA, &path_);<br>
path_ = path_.Append(base::FilePath::FromUTF8Unsafe(GetApplicationName()));<br>
base::PathService::Override(DIR_USER_DATA, path_);<br>
}<br>
}<br>
`</p>
</blockquote>
</blockquote>
<h3 dir="auto">Alternatives Considered</h3>
<p dir="auto">We customized setPath('userData') at startup of our application to force the cache to another location but later in the code, we can no more use getPath('userData') for storing our data. We expose a new method but it is less friendly and error prone.</p>
<h3 dir="auto">Additional Information</h3>
<p dir="auto">I have not the background /context of the 1st attempt, it may have a good reason to stop. If you can share your concerns and see if it is feasible, will be grateful</p>
<p dir="auto">I can manage a MR, if you agree.</p> | 0 |
<pre class="notranslate">What steps will reproduce the problem?
<a href="http://play.golang.org/p/wG6_Vm1cvW" rel="nofollow">http://play.golang.org/p/wG6_Vm1cvW</a>
It's useful for this to work to be able to disable a partial function implementation
while doing TDD.
What is the expected output?
program should compile
What do you see instead?
prog.go:10: function ends without a return statement
Which compiler are you using (5g, 6g, 8g, gccgo)?
6g
Which operating system are you using?
linux
Which version are you using? (run 'go version')
tip</pre> | <p dir="auto">pkix.Name.FillFromRDNSequence ignores attributes other than the first in the RDN sets passed as argument. As demonstrated by <a href="http://play.golang.org/p/GPZdVHzZVb" rel="nofollow">http://play.golang.org/p/GPZdVHzZVb</a>, this in turn makes x509.ParseCertificate(s) fail to locate the subject serial number for certificates where it is included in set containing the common name.</p>
<p dir="auto">The fix is simple, also demonstrated by the playground program, but I'm unsure if the example certificate is broken and that multiple attributes in one RDN set should be ignored. And even if so, a workaround might still be desirable: The example certificate is issued by the national Danish ID provider, "NemID" mandatory for digital banking and digital public services.</p>
<p dir="auto">I raised the issue on golang-nuts:</p>
<p dir="auto"><a href="https://groups.google.com/forum/#!topic/golang-nuts/1Whb4ko4zfc" rel="nofollow">https://groups.google.com/forum/#!topic/golang-nuts/1Whb4ko4zfc</a></p>
<p dir="auto">but so far I've received no replies and so this issue serves as a reminder.</p> | 0 |
<p dir="auto">I have a file<code class="notranslate">interfaces.d.ts</code> which defines some interfaces, e.g:</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="export interface IFoo {}
export interface IBar {}"><pre class="notranslate"><span class="pl-k">export</span> <span class="pl-k">interface</span> <span class="pl-smi">IFoo</span> <span class="pl-kos">{</span><span class="pl-kos">}</span>
<span class="pl-k">export</span> <span class="pl-k">interface</span> <span class="pl-smi">IBar</span> <span class="pl-kos">{</span><span class="pl-kos">}</span></pre></div>
<p dir="auto">I want to reexport all interfaces in another module:</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="export * from "interfaces";"><pre class="notranslate"><span class="pl-k">export</span> <span class="pl-c1">*</span> <span class="pl-k">from</span> <span class="pl-s">"interfaces"</span><span class="pl-kos">;</span></pre></div>
<p dir="auto">When targeting AMD, compiled code looks like this:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="define(["require", "exports", "interfaces"], function (require, exports, interfaces_1) {
function __export(m) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
__export(interfaces_1);
});"><pre class="notranslate"><span class="pl-en">define</span><span class="pl-kos">(</span><span class="pl-kos">[</span><span class="pl-s">"require"</span><span class="pl-kos">,</span> <span class="pl-s">"exports"</span><span class="pl-kos">,</span> <span class="pl-s">"interfaces"</span><span class="pl-kos">]</span><span class="pl-kos">,</span> <span class="pl-k">function</span> <span class="pl-kos">(</span><span class="pl-s1">require</span><span class="pl-kos">,</span> <span class="pl-s1">exports</span><span class="pl-kos">,</span> <span class="pl-s1">interfaces_1</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-k">function</span> <span class="pl-en">__export</span><span class="pl-kos">(</span><span class="pl-s1">m</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-k">for</span> <span class="pl-kos">(</span><span class="pl-k">var</span> <span class="pl-s1">p</span> <span class="pl-k">in</span> <span class="pl-s1">m</span><span class="pl-kos">)</span> <span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-c1">!</span><span class="pl-s1">exports</span><span class="pl-kos">.</span><span class="pl-en">hasOwnProperty</span><span class="pl-kos">(</span><span class="pl-s1">p</span><span class="pl-kos">)</span><span class="pl-kos">)</span> <span class="pl-s1">exports</span><span class="pl-kos">[</span><span class="pl-s1">p</span><span class="pl-kos">]</span> <span class="pl-c1">=</span> <span class="pl-s1">m</span><span class="pl-kos">[</span><span class="pl-s1">p</span><span class="pl-kos">]</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span>
<span class="pl-en">__export</span><span class="pl-kos">(</span><span class="pl-s1">interfaces_1</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<p dir="auto">Module "interfaces" should not be imported at all, because it doesn't contain any JS code. To fix this I have to list all exported interfaces manually:</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="export { IFoo, IBar } from "interfaces";"><pre class="notranslate"><span class="pl-k">export</span> <span class="pl-kos">{</span> <span class="pl-smi">IFoo</span><span class="pl-kos">,</span> <span class="pl-smi">IBar</span> <span class="pl-kos">}</span> <span class="pl-k">from</span> <span class="pl-s">"interfaces"</span><span class="pl-kos">;</span></pre></div>
<p dir="auto">It's a problem if the number of interfaces is large.</p>
<p dir="auto">I use version 1.5.3.</p> | 1 |
|
<p dir="auto">My iOS project is named <code class="notranslate">Uber.xcodeproj</code> and <code class="notranslate">Uber.xcworkspace</code>, I placed my files into the ios folder, but it seems Flutter project can not find the iOS project .</p> | <p dir="auto"><a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/lukef/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/lukef">@lukef</a> brought up the question this morning if it would be possible to change ios/Runner.xcodeproj to ios/MyName.xcodeproj. My understanding from <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/cbracken/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/cbracken">@cbracken</a> is that there are several places in our code which currently look for the word "Runner" or assume that path which would break if that was done.</p>
<p dir="auto">We could certainly support this, but my understanding is changing the name is not "supported" out of the box. I don't know what the situation is on the Android side (if there are any path naming issues there).</p> | 1 |
<p dir="auto">I was building this repo: <a href="https://github.com/pistondevelopers/gfx_graphics">https://github.com/pistondevelopers/gfx_graphics</a></p>
<p dir="auto">using this command: cargo run --example image test</p>
<p dir="auto">and got this backtrace:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" Compiling piston2d-gfx_graphics v0.1.7 (~/Documents/code/rust/gfx_graphics)
examples/imagetest.rs:42:10: 42:19 warning: use of deprecated item: use std::path instead, #[warn(deprecated)] on by default
examples/imagetest.rs:42 &Path::new("./assets/rust.png")).unwrap();
^~~~~~~~~
error: internal compiler error: unexpected panic
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
note: run with `RUST_BACKTRACE=1` for a backtrace
thread 'rustc' panicked at 'arithmetic operation overflowed', /Users/rustbuild/src/rust-buildbot/slave/nightly-dist-rustc-mac/build/src/libsyntax/codemap.rs:73
stack backtrace:
1: 0x1078afd1b - sys::backtrace::write::h3b83b15177f4f6b5fCC
2: 0x1078d8afd - panicking::on_panic::h77e742d34f7c8b14DsI
3: 0x1077f8b37 - rt::unwind::begin_unwind_inner::h8c5748c6ec61f668EbI
4: 0x1077f930e - rt::unwind::begin_unwind_fmt::h09f57cab0d3c2b0cfaI
5: 0x1078d85bd - rust_begin_unwind
6: 0x107928325 - panicking::panic_fmt::h81bb86f758192917ZSs
7: 0x1079202e7 - panicking::panic::h67ccdd3fa7b140bcbRs
8: 0x106f67aaf - codemap::BytePos.Sub::sub::ha963a332df6226d2X7y
9: 0x10479fa30 - middle::astencode::DecodeContext<'a, 'b, 'tcx>::tr_span::ha609caf2be923751UBa
10: 0x1047b1bb4 - fold::noop_fold_expr::h6052110651558964661
11: 0x1047b18d5 - ptr::P<T>::map::h7940627982087708418
12: 0x1047b5385 - fold::noop_fold_expr::closure.65772
13: 0x1047b200d - fold::noop_fold_expr::h6052110651558964661
14: 0x1047b18d5 - ptr::P<T>::map::h7940627982087708418
15: 0x1047b5385 - fold::noop_fold_expr::closure.65772
16: 0x1047b200d - fold::noop_fold_expr::h6052110651558964661
17: 0x1047b18d5 - ptr::P<T>::map::h7940627982087708418
18: 0x1047b5385 - fold::noop_fold_expr::closure.65772
19: 0x1047b1dea - fold::noop_fold_expr::h6052110651558964661
20: 0x1047b18d5 - ptr::P<T>::map::h7940627982087708418
21: 0x1047b27d8 - fold::noop_fold_expr::h6052110651558964661
22: 0x1047b18d5 - ptr::P<T>::map::h7940627982087708418
23: 0x1047b5322 - fold::noop_fold_expr::closure.65767
24: 0x1047b9b5d - fold::noop_fold_local::closure.65998
25: 0x1047b9558 - fold::noop_fold_decl::closure.65995
26: 0x1047b7631 - fold::Folder::fold_stmt::closure.65925
27: 0x1047b6ded - fold::noop_fold_block::closure.65876
28: 0x1047b6a21 - iter::FlatMap<I, U, F>.Iterator::next::h8831031901394782976
29: 0x1047b61ef - vec::Vec<T>.FromIterator<T>::from_iter::h390922894093893598
30: 0x1047b5b04 - fold::noop_fold_block::closure.65785
31: 0x1047b558a - fold::noop_fold_block::h2848417533559784555
32: 0x1047b2cc4 - fold::noop_fold_expr::h6052110651558964661
33: 0x1047b18d5 - ptr::P<T>::map::h7940627982087708418
34: 0x1047b753f - fold::Folder::fold_stmt::closure.65925
35: 0x1047b6ded - fold::noop_fold_block::closure.65876
36: 0x1047b6a21 - iter::FlatMap<I, U, F>.Iterator::next::h8831031901394782976
37: 0x1047b61ef - vec::Vec<T>.FromIterator<T>::from_iter::h390922894093893598
38: 0x1047b5b04 - fold::noop_fold_block::closure.65785
39: 0x1047b558a - fold::noop_fold_block::h2848417533559784555
40: 0x1047b2cc4 - fold::noop_fold_expr::h6052110651558964661
41: 0x1047b18d5 - ptr::P<T>::map::h7940627982087708418
42: 0x1047b5322 - fold::noop_fold_expr::closure.65767
43: 0x1047b5b90 - fold::noop_fold_block::closure.65785
44: 0x1047b558a - fold::noop_fold_block::h2848417533559784555
45: 0x1047d4df6 - fold::noop_fold_impl_item::closure.66340
46: 0x1047d46fd - fold::noop_fold_impl_item::h1408433769782516448
47: 0x1047a27ff - middle::astencode::decode_inlined_item::h98be5341b5740066vqa
48: 0x104363b0c - trans::inline::instantiate_inline::closure.39503
49: 0x104bc9c2f - metadata::decoder::maybe_get_item_ast::h9f3b16f53943285a3hg
50: 0x1049aeb48 - metadata::csearch::maybe_get_item_ast::hc0376cacdb4fc82fVHi
51: 0x10436236b - trans::inline::instantiate_inline::hcb4baf4731bceaee7hd
52: 0x1043b4a06 - trans::callee::trans_fn_ref_with_substs::h3dd799fcfb10c61ankg
53: 0x1043b3b84 - trans::meth::trans_static_method_callee::h87b6e738c13b7befj8x
54: 0x1043b0654 - trans::callee::trans::hebb18e30873529a9eYf
55: 0x1043c78ad - trans::callee::trans_call_inner::h11696719501217594510
56: 0x1043d54dc - trans::expr::trans_rvalue_dps_unadjusted::he9f6005922fd4409xzi
57: 0x1043d2e0c - trans::expr::trans_unadjusted::h9175a3adfcc3bf5723h
58: 0x104383f5b - trans::expr::trans::h95e8c24c95ef80fcath
59: 0x104483bae - trans::_match::trans_match_inner::hb05eebe09d542d345Ew
60: 0x1043d48d3 - trans::expr::trans_rvalue_dps_unadjusted::he9f6005922fd4409xzi
61: 0x1043823c6 - trans::expr::trans_into::h3e47f96968378458Smh
62: 0x10449db76 - trans::_match::mk_binding_alloca::h6146964086414757799
63: 0x104381830 - trans::base::init_local::h0459eb09a8f2f5e3Vys
64: 0x1043831e2 - trans::controlflow::trans_block::hec4993ebaa40ee52t6d
65: 0x104462739 - trans::base::trans_closure::h1c51c7ed964051ddRjt
66: 0x10436a895 - trans::base::trans_fn::hd22a8a4bf4f7572dKut
67: 0x10436c022 - trans::monomorphize::monomorphic_fn::hc946d75d050bcc6e2td
68: 0x1043b4bbb - trans::callee::trans_fn_ref_with_substs::h3dd799fcfb10c61ankg
69: 0x1043b314e - trans::callee::trans_fn_ref::h2efc8153c5a2595dX8f
70: 0x1043b0810 - trans::callee::trans::hebb18e30873529a9eYf
71: 0x1043c78ad - trans::callee::trans_call_inner::h11696719501217594510
72: 0x1043d54dc - trans::expr::trans_rvalue_dps_unadjusted::he9f6005922fd4409xzi
73: 0x1043d2e0c - trans::expr::trans_unadjusted::h9175a3adfcc3bf5723h
74: 0x104383f5b - trans::expr::trans::h95e8c24c95ef80fcath
75: 0x1043c2e11 - trans::callee::trans_args::he2b83edef17c4356F0g
76: 0x1043ca547 - trans::callee::trans_call_inner::h37094392144590770
77: 0x1043d405a - trans::expr::trans_rvalue_dps_unadjusted::he9f6005922fd4409xzi
78: 0x1043823c6 - trans::expr::trans_into::h3e47f96968378458Smh
79: 0x10449db76 - trans::_match::mk_binding_alloca::h6146964086414757799
80: 0x104381830 - trans::base::init_local::h0459eb09a8f2f5e3Vys
81: 0x1043831e2 - trans::controlflow::trans_block::hec4993ebaa40ee52t6d
82: 0x104462739 - trans::base::trans_closure::h1c51c7ed964051ddRjt
83: 0x10436a895 - trans::base::trans_fn::hd22a8a4bf4f7572dKut
84: 0x10436c022 - trans::monomorphize::monomorphic_fn::hc946d75d050bcc6e2td
85: 0x1043b4bbb - trans::callee::trans_fn_ref_with_substs::h3dd799fcfb10c61ankg
86: 0x1043b314e - trans::callee::trans_fn_ref::h2efc8153c5a2595dX8f
87: 0x1043b0810 - trans::callee::trans::hebb18e30873529a9eYf
88: 0x1043c78ad - trans::callee::trans_call_inner::h11696719501217594510
89: 0x1043d54dc - trans::expr::trans_rvalue_dps_unadjusted::he9f6005922fd4409xzi
90: 0x1043823c6 - trans::expr::trans_into::h3e47f96968378458Smh
91: 0x10449db76 - trans::_match::mk_binding_alloca::h6146964086414757799
92: 0x104381830 - trans::base::init_local::h0459eb09a8f2f5e3Vys
93: 0x1043831e2 - trans::controlflow::trans_block::hec4993ebaa40ee52t6d
94: 0x104462739 - trans::base::trans_closure::h1c51c7ed964051ddRjt
95: 0x10436a895 - trans::base::trans_fn::hd22a8a4bf4f7572dKut
96: 0x10436627d - trans::base::trans_item::hb9b1cc2d4ac9a43fCSt
97: 0x10446b9db - trans::base::trans_crate::h162d55e78175069bfPu
98: 0x103dc1007 - driver::phase_4_translate_to_llvm::he30ee8c0cb343082kOa
99: 0x103d9cd5a - driver::compile_input::h17478feb88f6e172Rba
100: 0x103e5d193 - run_compiler::he252d03d9462df9cx2b
... <frames omitted>"><pre class="notranslate"><code class="notranslate"> Compiling piston2d-gfx_graphics v0.1.7 (~/Documents/code/rust/gfx_graphics)
examples/imagetest.rs:42:10: 42:19 warning: use of deprecated item: use std::path instead, #[warn(deprecated)] on by default
examples/imagetest.rs:42 &Path::new("./assets/rust.png")).unwrap();
^~~~~~~~~
error: internal compiler error: unexpected panic
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
note: run with `RUST_BACKTRACE=1` for a backtrace
thread 'rustc' panicked at 'arithmetic operation overflowed', /Users/rustbuild/src/rust-buildbot/slave/nightly-dist-rustc-mac/build/src/libsyntax/codemap.rs:73
stack backtrace:
1: 0x1078afd1b - sys::backtrace::write::h3b83b15177f4f6b5fCC
2: 0x1078d8afd - panicking::on_panic::h77e742d34f7c8b14DsI
3: 0x1077f8b37 - rt::unwind::begin_unwind_inner::h8c5748c6ec61f668EbI
4: 0x1077f930e - rt::unwind::begin_unwind_fmt::h09f57cab0d3c2b0cfaI
5: 0x1078d85bd - rust_begin_unwind
6: 0x107928325 - panicking::panic_fmt::h81bb86f758192917ZSs
7: 0x1079202e7 - panicking::panic::h67ccdd3fa7b140bcbRs
8: 0x106f67aaf - codemap::BytePos.Sub::sub::ha963a332df6226d2X7y
9: 0x10479fa30 - middle::astencode::DecodeContext<'a, 'b, 'tcx>::tr_span::ha609caf2be923751UBa
10: 0x1047b1bb4 - fold::noop_fold_expr::h6052110651558964661
11: 0x1047b18d5 - ptr::P<T>::map::h7940627982087708418
12: 0x1047b5385 - fold::noop_fold_expr::closure.65772
13: 0x1047b200d - fold::noop_fold_expr::h6052110651558964661
14: 0x1047b18d5 - ptr::P<T>::map::h7940627982087708418
15: 0x1047b5385 - fold::noop_fold_expr::closure.65772
16: 0x1047b200d - fold::noop_fold_expr::h6052110651558964661
17: 0x1047b18d5 - ptr::P<T>::map::h7940627982087708418
18: 0x1047b5385 - fold::noop_fold_expr::closure.65772
19: 0x1047b1dea - fold::noop_fold_expr::h6052110651558964661
20: 0x1047b18d5 - ptr::P<T>::map::h7940627982087708418
21: 0x1047b27d8 - fold::noop_fold_expr::h6052110651558964661
22: 0x1047b18d5 - ptr::P<T>::map::h7940627982087708418
23: 0x1047b5322 - fold::noop_fold_expr::closure.65767
24: 0x1047b9b5d - fold::noop_fold_local::closure.65998
25: 0x1047b9558 - fold::noop_fold_decl::closure.65995
26: 0x1047b7631 - fold::Folder::fold_stmt::closure.65925
27: 0x1047b6ded - fold::noop_fold_block::closure.65876
28: 0x1047b6a21 - iter::FlatMap<I, U, F>.Iterator::next::h8831031901394782976
29: 0x1047b61ef - vec::Vec<T>.FromIterator<T>::from_iter::h390922894093893598
30: 0x1047b5b04 - fold::noop_fold_block::closure.65785
31: 0x1047b558a - fold::noop_fold_block::h2848417533559784555
32: 0x1047b2cc4 - fold::noop_fold_expr::h6052110651558964661
33: 0x1047b18d5 - ptr::P<T>::map::h7940627982087708418
34: 0x1047b753f - fold::Folder::fold_stmt::closure.65925
35: 0x1047b6ded - fold::noop_fold_block::closure.65876
36: 0x1047b6a21 - iter::FlatMap<I, U, F>.Iterator::next::h8831031901394782976
37: 0x1047b61ef - vec::Vec<T>.FromIterator<T>::from_iter::h390922894093893598
38: 0x1047b5b04 - fold::noop_fold_block::closure.65785
39: 0x1047b558a - fold::noop_fold_block::h2848417533559784555
40: 0x1047b2cc4 - fold::noop_fold_expr::h6052110651558964661
41: 0x1047b18d5 - ptr::P<T>::map::h7940627982087708418
42: 0x1047b5322 - fold::noop_fold_expr::closure.65767
43: 0x1047b5b90 - fold::noop_fold_block::closure.65785
44: 0x1047b558a - fold::noop_fold_block::h2848417533559784555
45: 0x1047d4df6 - fold::noop_fold_impl_item::closure.66340
46: 0x1047d46fd - fold::noop_fold_impl_item::h1408433769782516448
47: 0x1047a27ff - middle::astencode::decode_inlined_item::h98be5341b5740066vqa
48: 0x104363b0c - trans::inline::instantiate_inline::closure.39503
49: 0x104bc9c2f - metadata::decoder::maybe_get_item_ast::h9f3b16f53943285a3hg
50: 0x1049aeb48 - metadata::csearch::maybe_get_item_ast::hc0376cacdb4fc82fVHi
51: 0x10436236b - trans::inline::instantiate_inline::hcb4baf4731bceaee7hd
52: 0x1043b4a06 - trans::callee::trans_fn_ref_with_substs::h3dd799fcfb10c61ankg
53: 0x1043b3b84 - trans::meth::trans_static_method_callee::h87b6e738c13b7befj8x
54: 0x1043b0654 - trans::callee::trans::hebb18e30873529a9eYf
55: 0x1043c78ad - trans::callee::trans_call_inner::h11696719501217594510
56: 0x1043d54dc - trans::expr::trans_rvalue_dps_unadjusted::he9f6005922fd4409xzi
57: 0x1043d2e0c - trans::expr::trans_unadjusted::h9175a3adfcc3bf5723h
58: 0x104383f5b - trans::expr::trans::h95e8c24c95ef80fcath
59: 0x104483bae - trans::_match::trans_match_inner::hb05eebe09d542d345Ew
60: 0x1043d48d3 - trans::expr::trans_rvalue_dps_unadjusted::he9f6005922fd4409xzi
61: 0x1043823c6 - trans::expr::trans_into::h3e47f96968378458Smh
62: 0x10449db76 - trans::_match::mk_binding_alloca::h6146964086414757799
63: 0x104381830 - trans::base::init_local::h0459eb09a8f2f5e3Vys
64: 0x1043831e2 - trans::controlflow::trans_block::hec4993ebaa40ee52t6d
65: 0x104462739 - trans::base::trans_closure::h1c51c7ed964051ddRjt
66: 0x10436a895 - trans::base::trans_fn::hd22a8a4bf4f7572dKut
67: 0x10436c022 - trans::monomorphize::monomorphic_fn::hc946d75d050bcc6e2td
68: 0x1043b4bbb - trans::callee::trans_fn_ref_with_substs::h3dd799fcfb10c61ankg
69: 0x1043b314e - trans::callee::trans_fn_ref::h2efc8153c5a2595dX8f
70: 0x1043b0810 - trans::callee::trans::hebb18e30873529a9eYf
71: 0x1043c78ad - trans::callee::trans_call_inner::h11696719501217594510
72: 0x1043d54dc - trans::expr::trans_rvalue_dps_unadjusted::he9f6005922fd4409xzi
73: 0x1043d2e0c - trans::expr::trans_unadjusted::h9175a3adfcc3bf5723h
74: 0x104383f5b - trans::expr::trans::h95e8c24c95ef80fcath
75: 0x1043c2e11 - trans::callee::trans_args::he2b83edef17c4356F0g
76: 0x1043ca547 - trans::callee::trans_call_inner::h37094392144590770
77: 0x1043d405a - trans::expr::trans_rvalue_dps_unadjusted::he9f6005922fd4409xzi
78: 0x1043823c6 - trans::expr::trans_into::h3e47f96968378458Smh
79: 0x10449db76 - trans::_match::mk_binding_alloca::h6146964086414757799
80: 0x104381830 - trans::base::init_local::h0459eb09a8f2f5e3Vys
81: 0x1043831e2 - trans::controlflow::trans_block::hec4993ebaa40ee52t6d
82: 0x104462739 - trans::base::trans_closure::h1c51c7ed964051ddRjt
83: 0x10436a895 - trans::base::trans_fn::hd22a8a4bf4f7572dKut
84: 0x10436c022 - trans::monomorphize::monomorphic_fn::hc946d75d050bcc6e2td
85: 0x1043b4bbb - trans::callee::trans_fn_ref_with_substs::h3dd799fcfb10c61ankg
86: 0x1043b314e - trans::callee::trans_fn_ref::h2efc8153c5a2595dX8f
87: 0x1043b0810 - trans::callee::trans::hebb18e30873529a9eYf
88: 0x1043c78ad - trans::callee::trans_call_inner::h11696719501217594510
89: 0x1043d54dc - trans::expr::trans_rvalue_dps_unadjusted::he9f6005922fd4409xzi
90: 0x1043823c6 - trans::expr::trans_into::h3e47f96968378458Smh
91: 0x10449db76 - trans::_match::mk_binding_alloca::h6146964086414757799
92: 0x104381830 - trans::base::init_local::h0459eb09a8f2f5e3Vys
93: 0x1043831e2 - trans::controlflow::trans_block::hec4993ebaa40ee52t6d
94: 0x104462739 - trans::base::trans_closure::h1c51c7ed964051ddRjt
95: 0x10436a895 - trans::base::trans_fn::hd22a8a4bf4f7572dKut
96: 0x10436627d - trans::base::trans_item::hb9b1cc2d4ac9a43fCSt
97: 0x10446b9db - trans::base::trans_crate::h162d55e78175069bfPu
98: 0x103dc1007 - driver::phase_4_translate_to_llvm::he30ee8c0cb343082kOa
99: 0x103d9cd5a - driver::compile_input::h17478feb88f6e172Rba
100: 0x103e5d193 - run_compiler::he252d03d9462df9cx2b
... <frames omitted>
</code></pre></div> | <p dir="auto"><a href="https://travis-ci.org/GuillaumeGomez/rust-GSL/builds/53335854" rel="nofollow">https://travis-ci.org/GuillaumeGomez/rust-GSL/builds/53335854</a></p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="
error: internal compiler error: unexpected panic
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
note: run with `RUST_BACKTRACE=1` for a backtrace
thread 'rustc' panicked at 'arithmetic operation overflowed', /home/rustbuild/src/rust-buildbot/slave/nightly-dist-rustc-linux/build/src/libsyntax/codemap.rs:73
stack backtrace:
1: 0x7fd52b3bcf6f - sys::backtrace::write::h2f046b875b210aadOBA
2: 0x7fd52b3e7c82 - panicking::on_panic::h792ac47fb8c07faehHJ
3: 0x7fd52b31cf2a - rt::unwind::begin_unwind_inner::hbffac672008352c8knJ
4: 0x7fd52b31d641 - rt::unwind::begin_unwind_fmt::hbe64affaa986f482VlJ
5: 0x7fd52b3e7807 - rust_begin_unwind
6: 0x7fd52b433114 - panicking::panic_fmt::h81cd96819f02da8dIZs
7: 0x7fd52b42f53d - panicking::panic::h8ea414638b29b322UXs
8: 0x7fd5286f98ac - codemap::BytePos.Sub::sub::h13c0a0f10f07c348YWB
9: 0x7fd529035ec0 - middle::astencode::DecodeContext<'a, 'b, 'tcx>::tr_span::hdd7910e968f71d01FCa
10: 0x7fd52904679c - fold::noop_fold_expr::h1258022642513463166
11: 0x7fd5290464a3 - ptr::P<T>::map::h4462110055941524197
12: 0x7fd529049c9e - fold::noop_fold_expr::closure.66610
13: 0x7fd5290469e1 - fold::noop_fold_expr::h1258022642513463166
14: 0x7fd5290464a3 - ptr::P<T>::map::h4462110055941524197
15: 0x7fd529049c9e - fold::noop_fold_expr::closure.66610
16: 0x7fd529046bbe - fold::noop_fold_expr::h1258022642513463166
17: 0x7fd5290464a3 - ptr::P<T>::map::h4462110055941524197
18: 0x7fd529049c4b - fold::noop_fold_expr::closure.66605
19: 0x7fd52904e0a4 - fold::noop_fold_local::closure.66836
20: 0x7fd52904da97 - fold::noop_fold_decl::closure.66833
21: 0x7fd52904bc9b - fold::Folder::fold_stmt::closure.66763
22: 0x7fd52904b553 - fold::noop_fold_block::closure.66714
23: 0x7fd52904b208 - iter::FlatMap<I, U, F>.Iterator::next::h9223681505759829108
24: 0x7fd52904a9cf - vec::Vec<T>.FromIterator<T>::from_iter::h13016817088923062838
25: 0x7fd52904a295 - fold::noop_fold_block::closure.66623
26: 0x7fd529049e32 - fold::noop_fold_block::h14827012078068820658
27: 0x7fd529047873 - fold::noop_fold_expr::h1258022642513463166
28: 0x7fd5290464a3 - ptr::P<T>::map::h4462110055941524197
29: 0x7fd529049c4b - fold::noop_fold_expr::closure.66605
30: 0x7fd52904a327 - fold::noop_fold_block::closure.66623
31: 0x7fd529049e32 - fold::noop_fold_block::h14827012078068820658
32: 0x7fd529047873 - fold::noop_fold_expr::h1258022642513463166
33: 0x7fd5290464a3 - ptr::P<T>::map::h4462110055941524197
34: 0x7fd52904c176 - fold::Folder::fold_stmt::closure.66763
35: 0x7fd52904b553 - fold::noop_fold_block::closure.66714
36: 0x7fd52904b208 - iter::FlatMap<I, U, F>.Iterator::next::h9223681505759829108
37: 0x7fd52904a9cf - vec::Vec<T>.FromIterator<T>::from_iter::h13016817088923062838
38: 0x7fd52904a295 - fold::noop_fold_block::closure.66623
39: 0x7fd529049e32 - fold::noop_fold_block::h14827012078068820658
40: 0x7fd529046f87 - fold::noop_fold_expr::h1258022642513463166
41: 0x7fd5290464a3 - ptr::P<T>::map::h4462110055941524197
42: 0x7fd52904bb9b - fold::Folder::fold_stmt::closure.66763
43: 0x7fd52904b553 - fold::noop_fold_block::closure.66714
44: 0x7fd52904b208 - iter::FlatMap<I, U, F>.Iterator::next::h9223681505759829108
45: 0x7fd52904a9cf - vec::Vec<T>.FromIterator<T>::from_iter::h13016817088923062838
46: 0x7fd52904a295 - fold::noop_fold_block::closure.66623
47: 0x7fd529049e32 - fold::noop_fold_block::h14827012078068820658
48: 0x7fd529047873 - fold::noop_fold_expr::h1258022642513463166
49: 0x7fd5290464a3 - ptr::P<T>::map::h4462110055941524197
50: 0x7fd529049c4b - fold::noop_fold_expr::closure.66605
51: 0x7fd52904a327 - fold::noop_fold_block::closure.66623
52: 0x7fd529049e32 - fold::noop_fold_block::h14827012078068820658
53: 0x7fd529069f57 - fold::noop_fold_method::closure.67217
54: 0x7fd5290696c5 - fold::noop_fold_method::h2920979874065131956
55: 0x7fd529038abb - middle::astencode::decode_inlined_item::h674342a5ff4e1a27Pqa
56: 0x7fd52a9f81ff - trans::inline::instantiate_inline::closure.39610
57: 0x7fd529427c2b - metadata::decoder::maybe_get_item_ast::h6b38702aa8f07983PDi
58: 0x7fd52922aec6 - metadata::csearch::maybe_get_item_ast::hf5174e6ae59eb7b5o3k
59: 0x7fd52a9f6a5d - trans::inline::instantiate_inline::h6a8d7203fac7c299bid
60: 0x7fd52aa45d85 - trans::callee::trans_fn_ref_with_substs::h85a6252d422343b2qng
61: 0x7fd52aa4452e - trans::callee::trans_fn_ref::h7eebc758d7f24cf00bg
62: 0x7fd52aa5b344 - trans::meth::trans_method_callee::h175c0aff2b6fe67998x
63: 0x7fd52aa59a19 - trans::callee::trans_call_inner::h18244630176801372264
64: 0x7fd52aa638e9 - trans::expr::trans_rvalue_dps_unadjusted::h62a8f691df1cee3cqCi
65: 0x7fd52aa154e6 - trans::expr::trans_into::h3bbb0e210c9fb401Vph
66: 0x7fd52aa14684 - trans::controlflow::trans_stmt_semi::hd74052e320e3d8baK6d
67: 0x7fd52aa15fc0 - trans::controlflow::trans_block::h4b526e186a057814x7d
68: 0x7fd52aa640de - trans::expr::trans_rvalue_dps_unadjusted::h62a8f691df1cee3cqCi
69: 0x7fd52aa154e6 - trans::expr::trans_into::h3bbb0e210c9fb401Vph
70: 0x7fd52aa14684 - trans::controlflow::trans_stmt_semi::hd74052e320e3d8baK6d
71: 0x7fd52aa15fc0 - trans::controlflow::trans_block::h4b526e186a057814x7d
72: 0x7fd52aaed3b1 - trans::base::trans_closure::h194b7ad0474e43a46mt
73: 0x7fd52a9fe948 - trans::base::trans_fn::h5416ef5d9cea730bZxt
74: 0x7fd52a9fa6e1 - trans::base::trans_item::h2af153dd6f7fd52bRVt
75: 0x7fd52aaf674c - trans::base::trans_crate::h5cb53f6b3e2377862Ru
76: 0x7fd52b9f7613 - driver::phase_4_translate_to_llvm::h60575195b9fa298dENa
77: 0x7fd52b9d305b - driver::compile_input::h9772b425fd1776fdNba
78: 0x7fd52ba97697 - run_compiler::h17c28dbe4dd58e3bV5b
79: 0x7fd52ba952c9 - thunk::F.Invoke<A, R>::invoke::h3041729087284544127
80: 0x7fd52ba93f40 - rt::unwind::try::try_fn::h11775082019993619070
81: 0x7fd52b457e38 - rust_try_inner
82: 0x7fd52b457e25 - rust_try
83: 0x7fd52ba946df - thunk::F.Invoke<A, R>::invoke::h10556879288050829464
84: 0x7fd52b3d29b5 - sys::thread::thread_start::hfe8c2cac3ec4afcdr8E
85: 0x7fd52520fe99 - start_thread
86: 0x7fd52af8a4bc - <unknown>"><pre class="notranslate"><code class="notranslate">
error: internal compiler error: unexpected panic
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
note: run with `RUST_BACKTRACE=1` for a backtrace
thread 'rustc' panicked at 'arithmetic operation overflowed', /home/rustbuild/src/rust-buildbot/slave/nightly-dist-rustc-linux/build/src/libsyntax/codemap.rs:73
stack backtrace:
1: 0x7fd52b3bcf6f - sys::backtrace::write::h2f046b875b210aadOBA
2: 0x7fd52b3e7c82 - panicking::on_panic::h792ac47fb8c07faehHJ
3: 0x7fd52b31cf2a - rt::unwind::begin_unwind_inner::hbffac672008352c8knJ
4: 0x7fd52b31d641 - rt::unwind::begin_unwind_fmt::hbe64affaa986f482VlJ
5: 0x7fd52b3e7807 - rust_begin_unwind
6: 0x7fd52b433114 - panicking::panic_fmt::h81cd96819f02da8dIZs
7: 0x7fd52b42f53d - panicking::panic::h8ea414638b29b322UXs
8: 0x7fd5286f98ac - codemap::BytePos.Sub::sub::h13c0a0f10f07c348YWB
9: 0x7fd529035ec0 - middle::astencode::DecodeContext<'a, 'b, 'tcx>::tr_span::hdd7910e968f71d01FCa
10: 0x7fd52904679c - fold::noop_fold_expr::h1258022642513463166
11: 0x7fd5290464a3 - ptr::P<T>::map::h4462110055941524197
12: 0x7fd529049c9e - fold::noop_fold_expr::closure.66610
13: 0x7fd5290469e1 - fold::noop_fold_expr::h1258022642513463166
14: 0x7fd5290464a3 - ptr::P<T>::map::h4462110055941524197
15: 0x7fd529049c9e - fold::noop_fold_expr::closure.66610
16: 0x7fd529046bbe - fold::noop_fold_expr::h1258022642513463166
17: 0x7fd5290464a3 - ptr::P<T>::map::h4462110055941524197
18: 0x7fd529049c4b - fold::noop_fold_expr::closure.66605
19: 0x7fd52904e0a4 - fold::noop_fold_local::closure.66836
20: 0x7fd52904da97 - fold::noop_fold_decl::closure.66833
21: 0x7fd52904bc9b - fold::Folder::fold_stmt::closure.66763
22: 0x7fd52904b553 - fold::noop_fold_block::closure.66714
23: 0x7fd52904b208 - iter::FlatMap<I, U, F>.Iterator::next::h9223681505759829108
24: 0x7fd52904a9cf - vec::Vec<T>.FromIterator<T>::from_iter::h13016817088923062838
25: 0x7fd52904a295 - fold::noop_fold_block::closure.66623
26: 0x7fd529049e32 - fold::noop_fold_block::h14827012078068820658
27: 0x7fd529047873 - fold::noop_fold_expr::h1258022642513463166
28: 0x7fd5290464a3 - ptr::P<T>::map::h4462110055941524197
29: 0x7fd529049c4b - fold::noop_fold_expr::closure.66605
30: 0x7fd52904a327 - fold::noop_fold_block::closure.66623
31: 0x7fd529049e32 - fold::noop_fold_block::h14827012078068820658
32: 0x7fd529047873 - fold::noop_fold_expr::h1258022642513463166
33: 0x7fd5290464a3 - ptr::P<T>::map::h4462110055941524197
34: 0x7fd52904c176 - fold::Folder::fold_stmt::closure.66763
35: 0x7fd52904b553 - fold::noop_fold_block::closure.66714
36: 0x7fd52904b208 - iter::FlatMap<I, U, F>.Iterator::next::h9223681505759829108
37: 0x7fd52904a9cf - vec::Vec<T>.FromIterator<T>::from_iter::h13016817088923062838
38: 0x7fd52904a295 - fold::noop_fold_block::closure.66623
39: 0x7fd529049e32 - fold::noop_fold_block::h14827012078068820658
40: 0x7fd529046f87 - fold::noop_fold_expr::h1258022642513463166
41: 0x7fd5290464a3 - ptr::P<T>::map::h4462110055941524197
42: 0x7fd52904bb9b - fold::Folder::fold_stmt::closure.66763
43: 0x7fd52904b553 - fold::noop_fold_block::closure.66714
44: 0x7fd52904b208 - iter::FlatMap<I, U, F>.Iterator::next::h9223681505759829108
45: 0x7fd52904a9cf - vec::Vec<T>.FromIterator<T>::from_iter::h13016817088923062838
46: 0x7fd52904a295 - fold::noop_fold_block::closure.66623
47: 0x7fd529049e32 - fold::noop_fold_block::h14827012078068820658
48: 0x7fd529047873 - fold::noop_fold_expr::h1258022642513463166
49: 0x7fd5290464a3 - ptr::P<T>::map::h4462110055941524197
50: 0x7fd529049c4b - fold::noop_fold_expr::closure.66605
51: 0x7fd52904a327 - fold::noop_fold_block::closure.66623
52: 0x7fd529049e32 - fold::noop_fold_block::h14827012078068820658
53: 0x7fd529069f57 - fold::noop_fold_method::closure.67217
54: 0x7fd5290696c5 - fold::noop_fold_method::h2920979874065131956
55: 0x7fd529038abb - middle::astencode::decode_inlined_item::h674342a5ff4e1a27Pqa
56: 0x7fd52a9f81ff - trans::inline::instantiate_inline::closure.39610
57: 0x7fd529427c2b - metadata::decoder::maybe_get_item_ast::h6b38702aa8f07983PDi
58: 0x7fd52922aec6 - metadata::csearch::maybe_get_item_ast::hf5174e6ae59eb7b5o3k
59: 0x7fd52a9f6a5d - trans::inline::instantiate_inline::h6a8d7203fac7c299bid
60: 0x7fd52aa45d85 - trans::callee::trans_fn_ref_with_substs::h85a6252d422343b2qng
61: 0x7fd52aa4452e - trans::callee::trans_fn_ref::h7eebc758d7f24cf00bg
62: 0x7fd52aa5b344 - trans::meth::trans_method_callee::h175c0aff2b6fe67998x
63: 0x7fd52aa59a19 - trans::callee::trans_call_inner::h18244630176801372264
64: 0x7fd52aa638e9 - trans::expr::trans_rvalue_dps_unadjusted::h62a8f691df1cee3cqCi
65: 0x7fd52aa154e6 - trans::expr::trans_into::h3bbb0e210c9fb401Vph
66: 0x7fd52aa14684 - trans::controlflow::trans_stmt_semi::hd74052e320e3d8baK6d
67: 0x7fd52aa15fc0 - trans::controlflow::trans_block::h4b526e186a057814x7d
68: 0x7fd52aa640de - trans::expr::trans_rvalue_dps_unadjusted::h62a8f691df1cee3cqCi
69: 0x7fd52aa154e6 - trans::expr::trans_into::h3bbb0e210c9fb401Vph
70: 0x7fd52aa14684 - trans::controlflow::trans_stmt_semi::hd74052e320e3d8baK6d
71: 0x7fd52aa15fc0 - trans::controlflow::trans_block::h4b526e186a057814x7d
72: 0x7fd52aaed3b1 - trans::base::trans_closure::h194b7ad0474e43a46mt
73: 0x7fd52a9fe948 - trans::base::trans_fn::h5416ef5d9cea730bZxt
74: 0x7fd52a9fa6e1 - trans::base::trans_item::h2af153dd6f7fd52bRVt
75: 0x7fd52aaf674c - trans::base::trans_crate::h5cb53f6b3e2377862Ru
76: 0x7fd52b9f7613 - driver::phase_4_translate_to_llvm::h60575195b9fa298dENa
77: 0x7fd52b9d305b - driver::compile_input::h9772b425fd1776fdNba
78: 0x7fd52ba97697 - run_compiler::h17c28dbe4dd58e3bV5b
79: 0x7fd52ba952c9 - thunk::F.Invoke<A, R>::invoke::h3041729087284544127
80: 0x7fd52ba93f40 - rt::unwind::try::try_fn::h11775082019993619070
81: 0x7fd52b457e38 - rust_try_inner
82: 0x7fd52b457e25 - rust_try
83: 0x7fd52ba946df - thunk::F.Invoke<A, R>::invoke::h10556879288050829464
84: 0x7fd52b3d29b5 - sys::thread::thread_start::hfe8c2cac3ec4afcdr8E
85: 0x7fd52520fe99 - start_thread
86: 0x7fd52af8a4bc - <unknown>
</code></pre></div>
<p dir="auto">Offending code:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="
impl Sub for BytePos {
type Output = BytePos;
fn sub(self, rhs: BytePos) -> BytePos {
BytePos((self.to_usize() - rhs.to_usize()) as u32)
}
}"><pre class="notranslate"><code class="notranslate">
impl Sub for BytePos {
type Output = BytePos;
fn sub(self, rhs: BytePos) -> BytePos {
BytePos((self.to_usize() - rhs.to_usize()) as u32)
}
}
</code></pre></div>
<p dir="auto">and the code calling it:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" pub fn tr_span(&self, span: Span) -> Span {
let imported_filemaps = &self.cdata.codemap_import_info[..];
let filemap_index = {
// Optimize for the case that most spans within a translated item
// originate from the same filemap.
let last_filemap_index = self.last_filemap_index.get();
if span.lo >= imported_filemaps[last_filemap_index].original_start_pos &&
span.hi <= imported_filemaps[last_filemap_index].original_end_pos {
last_filemap_index
} else {
let mut a = 0;
let mut b = imported_filemaps.len();
while b - a > 1 {
let m = (a + b) / 2;
if imported_filemaps[m].original_start_pos > span.lo {
b = m;
} else {
a = m;
}
}
self.last_filemap_index.set(a);
a
}
};
let lo = (span.lo - imported_filemaps[filemap_index].original_start_pos) +
imported_filemaps[filemap_index].translated_filemap.start_pos;
let hi = (span.hi - imported_filemaps[filemap_index].original_start_pos) +
imported_filemaps[filemap_index].translated_filemap.start_pos;
codemap::mk_sp(lo, hi)
}"><pre class="notranslate"><code class="notranslate"> pub fn tr_span(&self, span: Span) -> Span {
let imported_filemaps = &self.cdata.codemap_import_info[..];
let filemap_index = {
// Optimize for the case that most spans within a translated item
// originate from the same filemap.
let last_filemap_index = self.last_filemap_index.get();
if span.lo >= imported_filemaps[last_filemap_index].original_start_pos &&
span.hi <= imported_filemaps[last_filemap_index].original_end_pos {
last_filemap_index
} else {
let mut a = 0;
let mut b = imported_filemaps.len();
while b - a > 1 {
let m = (a + b) / 2;
if imported_filemaps[m].original_start_pos > span.lo {
b = m;
} else {
a = m;
}
}
self.last_filemap_index.set(a);
a
}
};
let lo = (span.lo - imported_filemaps[filemap_index].original_start_pos) +
imported_filemaps[filemap_index].translated_filemap.start_pos;
let hi = (span.hi - imported_filemaps[filemap_index].original_start_pos) +
imported_filemaps[filemap_index].translated_filemap.start_pos;
codemap::mk_sp(lo, hi)
}
</code></pre></div>
<p dir="auto">We might want a bounds check there (resolving to 0?), but there seems to be something broken in the astencode code too.</p>
<p dir="auto">cc <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/GuillaumeGomez/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/GuillaumeGomez">@GuillaumeGomez</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/pnkfelix/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/pnkfelix">@pnkfelix</a></p> | 1 |
<p dir="auto">Here's a demonstration of the issue:<br>
<a href="http://jsfiddle.net/phillipadsmith/5qS9d/" rel="nofollow">http://jsfiddle.net/phillipadsmith/5qS9d/</a></p>
<p dir="auto">If you double-click a button that is not the active button, the post values for that button-group are not sent with the post body.</p>
<p dir="auto">To test:</p>
<ul dir="auto">
<li>Use the fiddle above</li>
<li>Double-click on the buttons</li>
<li>Hit "finish," then check the request bin: <a href="http://requestb.in/vb0id1vb?inspect" rel="nofollow">http://requestb.in/vb0id1vb?inspect</a></li>
</ul>
<p dir="auto">You'll see an empty post body.</p>
<p dir="auto">I've been struggling to figure out this bug for a week, as I noticed it in a production app. Some users received form validation errors and there was no rhyme or reason as to why (as far as browser/os/etc.).</p>
<p dir="auto">Then I thought of my mom! She double-clicks her way around the Web. Tested that in all browsers, and -- in each case -- the buttons don't send any post value if double-clicked.</p>
<p dir="auto">Let me know if you have any questions.</p> | <p dir="auto">The active class stays on the button, but the checked property is removed from the radio input.</p>
<p dir="auto"><a href="http://jsfiddle.net/meleyal/dafPH/" rel="nofollow">http://jsfiddle.net/meleyal/dafPH/</a></p> | 1 |
<h2 dir="auto"><g-emoji class="g-emoji" alias="bug" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/1f41b.png">🐛</g-emoji> Bug</h2>
<p dir="auto">When I use libtorch1.3.1 of debug version in my C++ app, it threw a runtime error when I was trying to load a script model:</p>
<p dir="auto">cuda_dispatch_ptr INTERNAL ASSERT FAILED at C:\w\1\s\windows\pytorch\aten\src\ATen/native/DispatchStub.h:74, please report a bug to PyTorch. DispatchStub: missing CUDA kernel (operator () at C:\w\1\s\windows\pytorch\aten\src\ATen/native/DispatchStub.h:74)</p>
<h2 dir="auto">To Reproduce</h2>
<p dir="auto">Steps to reproduce the behavior:</p>
<ol dir="auto">
<li>Configure libtorch1.3.1 of debug version in my C++ project</li>
<li>Run the project by "Debug x64" model</li>
<li>It throw a runtime error when trying to load the model</li>
</ol>
<p dir="auto">Exception thrown at 0x00007FFD9A96A839 in EasyCyte.exe: Microsoft C++ exception: c10::Error at memory location 0x0000000F166F8450.<br>
Exception thrown at 0x00007FFD9A96A839 in EasyCyte.exe: Microsoft C++ exception: c10::Error at memory location 0x0000000F166F7F90.<br>
Unhandled exception at 0x00007FFD9A96A839 in EasyCyte.exe: Microsoft C++ exception: c10::Error at memory location 0x0000000F166F7F90.</p>
<h2 dir="auto">Expected behavior</h2>
<p dir="auto">The model should be loaded successfully without errors.</p>
<h2 dir="auto">Environment</h2>
<ul dir="auto">
<li>PyTorch Version (e.g., 1.0):1.3.1(libtorch debug)</li>
<li>OS (e.g., Linux):Windows10</li>
<li>How you installed PyTorch (<code class="notranslate">conda</code>, <code class="notranslate">pip</code>, source):pip</li>
<li>Python version:3.6</li>
<li>CUDA/cuDNN version:CUDA9.2+CUDNN7.5.0</li>
<li>GPU models and configuration:</li>
<li>Any other relevant information:VS2017 with toolset 14.11</li>
</ul>
<h2 dir="auto">Additional context</h2> | <h2 dir="auto"><g-emoji class="g-emoji" alias="bug" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/1f41b.png">🐛</g-emoji> Bug</h2>
<p dir="auto">When doing inference using LibTorch in C++ for semantic segmentation on the GPU, i get the following error in debug compilation mode:</p>
<p dir="auto">cuda_dispatch_ptr INTERNAL ASSERT FAILED at C:\w\1\s\windows\pytorch\aten\src\ATen/native/DispatchStub.h:70, please report a bug to PyTorch. DispatchStub: missing CUDA kernel (operator () at C:\w\1\s\windows\pytorch\aten\src\ATen/native/DispatchStub.h:70)<br>
(no backtrace available)</p>
<p dir="auto">When I run it in release mode it does not crash and delivers the expected result. Also on the CPU, this assert is not shown.</p>
<h2 dir="auto">Environment</h2>
<ul dir="auto">
<li>PyTorch Version (e.g., 1.0): latest nightly</li>
<li>OS (e.g., Linux): WIndows 10, Visual Studio 19</li>
<li>How you installed PyTorch (<code class="notranslate">conda</code>, <code class="notranslate">pip</code>, source): downloaded prebuild libtorch</li>
<li>Build command you used (if compiling from source):</li>
<li>Python version:</li>
<li>CUDA/cuDNN version: the one included in the prebuild (cuda 10)</li>
<li>GPU models and configuration: Titan X</li>
<li>Any other relevant information:</li>
</ul> | 1 |
<h1 dir="auto">Environment</h1>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Windows build number: [run "ver" at a command prompt]
Windows Terminal version (if applicable):
Any other software?"><pre lang="none" class="notranslate"><code class="notranslate">Windows build number: [run "ver" at a command prompt]
Windows Terminal version (if applicable):
Any other software?
</code></pre></div>
<h1 dir="auto">Steps to reproduce</h1>
<p dir="auto">Title tab is very large, don't auto scale size. If I open many tab, i can't click "x" to close this tab (use exit command to exit)<br>
There is many tab but can't see three tab<br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/26348718/62345261-e27b8100-b51b-11e9-86fa-24897814cc75.png"><img src="https://user-images.githubusercontent.com/26348718/62345261-e27b8100-b51b-11e9-86fa-24897814cc75.png" alt="image" style="max-width: 100%;"></a></p>
<h1 dir="auto">Expected behavior</h1>
<p dir="auto">Auto scale size title tab as chrome</p>
<h1 dir="auto">Actual behavior</h1>
<p dir="auto">Hidden title tab</p> | <p dir="auto">Windows (Insider) Build is 10.0.17713.1002</p>
<p dir="auto">I'm trying out the new pseudo terminal support, and capturing the output of a program that simply prints <code class="notranslate">hello, world!</code> to stdout produces the following:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="�[2J�[?25l�[39m�[49m�[Hhello, world!��[?25h�[Hh�[Hh�[1;14H�[1;14H"><pre class="notranslate"><code class="notranslate">�[2J�[?25l�[39m�[49m�[Hhello, world!��[?25h�[Hh�[Hh�[1;14H�[1;14H
</code></pre></div>
<p dir="auto">Breaking this down:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="0x1B[2J # clear screen??
0x1B[?25l # hide cursor
0x1B[39m # default foreground color
0x1B[49m # default background color
0x1B[H # move cursor home??
hello, world! #
0x08 # Backspace key??
0x1B[?25h # show cursor
0x1B[H # move cursor home??
h # print 'h' over the first char??
0x1B[H #
h # ...twice??
0x1B[1;14H # move cursor after printed text
0x1B[1;14H # ...twice??"><pre class="notranslate"><code class="notranslate">0x1B[2J # clear screen??
0x1B[?25l # hide cursor
0x1B[39m # default foreground color
0x1B[49m # default background color
0x1B[H # move cursor home??
hello, world! #
0x08 # Backspace key??
0x1B[?25h # show cursor
0x1B[H # move cursor home??
h # print 'h' over the first char??
0x1B[H #
h # ...twice??
0x1B[1;14H # move cursor after printed text
0x1B[1;14H # ...twice??
</code></pre></div>
<p dir="auto">Now some of these make sense, but a few I find confusing.<br>
Why clear the screen? (Either the user provided an empty file or a pipe to the PTY, or they intended to collect more than once programs output - at worst the clearing is unnecessary, at worst unwanted)<br>
Why move the cursor to the top left?<br>
Where does the backspace control character come from?<br>
Why is the first character (h) overwritten twice, are erroneously detected changes of the output buffer being rendered as VT sequences here?</p> | 0 |
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I tried using the <code class="notranslate">@types/xxxx</code> package and had problems.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I tried using the latest stable version of tsc. <a href="https://www.npmjs.com/package/typescript" rel="nofollow">https://www.npmjs.com/package/typescript</a></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have a question that is inappropriate for <a href="https://stackoverflow.com/" rel="nofollow">StackOverflow</a>. (Please ask any appropriate questions there).</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> <a href="https://github.com/blog/821-mention-somebody-they-re-notified">Mention</a> the authors (see <code class="notranslate">Definitions by:</code> in <code class="notranslate">index.d.ts</code>) so they can respond.
<ul dir="auto">
<li>Authors: @....</li>
</ul>
</li>
</ul>
<p dir="auto">Mentioning <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/blakeembrey/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/blakeembrey">@blakeembrey</a>, <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/andy-ms/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/andy-ms">@andy-ms</a>, <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/alecmerdler/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/alecmerdler">@alecmerdler</a> <g-emoji class="g-emoji" alias="wink" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/1f609.png">😉</g-emoji></p>
<p dir="auto">Code:</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import React, { Component } from "react";
import { connect } from "react-redux";
import { RootState } from "@src/state/state";
interface Props {
normal: string;
optional?: number;
}
class TestComponent extends Component<Props> {
render() {
return <h1>Hello</h1>;
};
}
function mapStateToProps(_state: RootState) {
return {
normal: "test",
optional: 5,
};
}
const Connected = connect(mapStateToProps)(TestComponent);"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-smi">React</span><span class="pl-kos">,</span> <span class="pl-kos">{</span> <span class="pl-smi">Component</span> <span class="pl-kos">}</span> <span class="pl-k">from</span> <span class="pl-s">"react"</span><span class="pl-kos">;</span>
<span class="pl-k">import</span> <span class="pl-kos">{</span> <span class="pl-s1">connect</span> <span class="pl-kos">}</span> <span class="pl-k">from</span> <span class="pl-s">"react-redux"</span><span class="pl-kos">;</span>
<span class="pl-k">import</span> <span class="pl-kos">{</span> <span class="pl-smi">RootState</span> <span class="pl-kos">}</span> <span class="pl-k">from</span> <span class="pl-s">"@src/state/state"</span><span class="pl-kos">;</span>
<span class="pl-k">interface</span> <span class="pl-smi">Props</span> <span class="pl-kos">{</span>
<span class="pl-c1">normal</span>: <span class="pl-smi">string</span><span class="pl-kos">;</span>
<span class="pl-c1">optional</span>?: <span class="pl-smi">number</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span>
<span class="pl-k">class</span> <span class="pl-smi">TestComponent</span> <span class="pl-k">extends</span> <span class="pl-smi">Component</span><span class="pl-kos"><</span><span class="pl-smi">Props</span><span class="pl-kos">></span> <span class="pl-kos">{</span>
<span class="pl-en">render</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-k">return</span> <span class="pl-kos"><</span><span class="pl-smi">h1</span><span class="pl-kos">></span><span class="pl-smi">Hello</span><span class="pl-c1"><</span><span class="pl-pds"><span class="pl-c1">/</span>h1>;</span><span class="pl-c1"></span>
<span class="pl-kos">}</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span>
<span class="pl-k">function</span> <span class="pl-en">mapStateToProps</span><span class="pl-kos">(</span><span class="pl-s1">_state</span>: <span class="pl-smi">RootState</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-k">return</span> <span class="pl-kos">{</span>
<span class="pl-c1">normal</span>: <span class="pl-s">"test"</span><span class="pl-kos">,</span>
<span class="pl-c1">optional</span>: <span class="pl-c1">5</span><span class="pl-kos">,</span>
<span class="pl-kos">}</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span>
<span class="pl-k">const</span> <span class="pl-smi">Connected</span> <span class="pl-c1">=</span> <span class="pl-en">connect</span><span class="pl-kos">(</span><span class="pl-s1">mapStateToProps</span><span class="pl-kos">)</span><span class="pl-kos">(</span><span class="pl-smi">TestComponent</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<p dir="auto">Error:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="[ts]
Argument of type 'typeof TestComponent' is not assignable to parameter of type 'ComponentType<{ normal: string; optional: number | undefined; } & DispatchProp<any>>'.
Type 'typeof TestComponent' is not assignable to type 'StatelessComponent<{ normal: string; optional: number | undefined; } & DispatchProp<any>>'.
Type 'typeof TestComponent' provides no match for the signature '(props: { normal: string; optional: number | undefined; } & DispatchProp<any> & { children?: ReactNode; }, context?: any): ReactElement<any> | null'."><pre class="notranslate"><code class="notranslate">[ts]
Argument of type 'typeof TestComponent' is not assignable to parameter of type 'ComponentType<{ normal: string; optional: number | undefined; } & DispatchProp<any>>'.
Type 'typeof TestComponent' is not assignable to type 'StatelessComponent<{ normal: string; optional: number | undefined; } & DispatchProp<any>>'.
Type 'typeof TestComponent' provides no match for the signature '(props: { normal: string; optional: number | undefined; } & DispatchProp<any> & { children?: ReactNode; }, context?: any): ReactElement<any> | null'.
</code></pre></div>
<p dir="auto">The problem is when the <code class="notranslate">optional</code> prop is marked as optional - the <code class="notranslate">TestComponent</code> part of <code class="notranslate">connect(mapStateToProps)(TestComponent);</code> is reported red with above error code.</p>
<p dir="auto">For unknown reasons the inferred type is <code class="notranslate">StatelessComponent</code> but <code class="notranslate">TestComponent</code> is a class.<br>
When the prop is marked as <code class="notranslate">optional: number|undefined</code> all is ok, so it's a workaround for now.</p> | <p dir="auto">I just install the latest updates and I got a bunch of errors.</p>
<p dir="auto">Using</p>
<ul dir="auto">
<li>"typescript": "^2.9.1"</li>
<li>"types/react-native": "^0.55.16",</li>
</ul>
<p dir="auto">cc: <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/VincentLanglet/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/VincentLanglet">@VincentLanglet</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/alloy/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/alloy">@alloy</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/tkrotoff/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/tkrotoff">@tkrotoff</a></p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="node_modules/@types/react-native/globals.d.ts:92:14 - error TS2300: Duplicate identifier 'RequestInfo'.
92 declare type RequestInfo = Request | string;
~~~~~~~~~~~
node_modules/@types/react-native/index.d.ts:8751:11 - error TS2451: Cannot redeclare block-scoped variable 'console'.
8751 const console: Console;
~~~~~~~
node_modules/@types/react-native/index.d.ts:8759:18 - error TS2717: Subsequent property declarations must have the same type. Property 'geolocation' must be of type 'Geolocation', but here has type 'GeolocationStatic'.
8759 readonly geolocation: Geolocation;
~~~~~~~~~~~
node_modules/@types/react-native/index.d.ts:8762:11 - error TS2451: Cannot redeclare block-scoped variable 'navigator'.
8762 const navigator: Navigator;
~~~~~~~~~
node_modules/typescript/lib/lib.dom.d.ts:15764:13 - error TS2451: Cannot redeclare block-scoped variable 'navigator'.
15764 declare var navigator: Navigator;
~~~~~~~~~
node_modules/typescript/lib/lib.dom.d.ts:15940:13 - error TS2451: Cannot redeclare block-scoped variable 'console'.
15940 declare var console: Console;
~~~~~~~
node_modules/typescript/lib/lib.dom.d.ts:15997:6 - error TS2300: Duplicate identifier 'RequestInfo'.
15997 type RequestInfo = Request | string;
~~~~~~~~~~~"><pre class="notranslate"><code class="notranslate">node_modules/@types/react-native/globals.d.ts:92:14 - error TS2300: Duplicate identifier 'RequestInfo'.
92 declare type RequestInfo = Request | string;
~~~~~~~~~~~
node_modules/@types/react-native/index.d.ts:8751:11 - error TS2451: Cannot redeclare block-scoped variable 'console'.
8751 const console: Console;
~~~~~~~
node_modules/@types/react-native/index.d.ts:8759:18 - error TS2717: Subsequent property declarations must have the same type. Property 'geolocation' must be of type 'Geolocation', but here has type 'GeolocationStatic'.
8759 readonly geolocation: Geolocation;
~~~~~~~~~~~
node_modules/@types/react-native/index.d.ts:8762:11 - error TS2451: Cannot redeclare block-scoped variable 'navigator'.
8762 const navigator: Navigator;
~~~~~~~~~
node_modules/typescript/lib/lib.dom.d.ts:15764:13 - error TS2451: Cannot redeclare block-scoped variable 'navigator'.
15764 declare var navigator: Navigator;
~~~~~~~~~
node_modules/typescript/lib/lib.dom.d.ts:15940:13 - error TS2451: Cannot redeclare block-scoped variable 'console'.
15940 declare var console: Console;
~~~~~~~
node_modules/typescript/lib/lib.dom.d.ts:15997:6 - error TS2300: Duplicate identifier 'RequestInfo'.
15997 type RequestInfo = Request | string;
~~~~~~~~~~~
</code></pre></div> | 0 |
<h4 dir="auto">Challenge Name</h4>
<p dir="auto">.freecodecamp.com/challenges/record-collection</p>
<h4 dir="auto">Issue Description</h4>
<p dir="auto">Even with the solution from the challenge guide the 2nd test does not pass<br>
After updateRecords(5439, "tracks", "Take a Chance on Me"), tracks should have "Take a Chance on Me" as the last element.</p>
<h4 dir="auto">Browser Information</h4>
<p dir="auto">tested on Windows 10 with firefox and edge and chrome</p>
<h4 dir="auto">Your Code</h4>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="// If relevant, paste all of your challenge code in here
function updateRecords(id, prop, value) {
if (prop === "tracks" && value !== "") {
collection[id][prop].push(value);
} else if (value !== ""){
collection[id][prop] = value;
} else {
delete collection[id][prop];
}
return collection;
}"><pre class="notranslate"><span class="pl-c">// If relevant, paste all of your challenge code in here</span>
<span class="pl-k">function</span> <span class="pl-en">updateRecords</span><span class="pl-kos">(</span><span class="pl-s1">id</span><span class="pl-kos">,</span> <span class="pl-s1">prop</span><span class="pl-kos">,</span> <span class="pl-s1">value</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-s1">prop</span> <span class="pl-c1">===</span> <span class="pl-s">"tracks"</span> <span class="pl-c1">&&</span> <span class="pl-s1">value</span> <span class="pl-c1">!==</span> <span class="pl-s">""</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-s1">collection</span><span class="pl-kos">[</span><span class="pl-s1">id</span><span class="pl-kos">]</span><span class="pl-kos">[</span><span class="pl-s1">prop</span><span class="pl-kos">]</span><span class="pl-kos">.</span><span class="pl-en">push</span><span class="pl-kos">(</span><span class="pl-s1">value</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span> <span class="pl-k">else</span> <span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-s1">value</span> <span class="pl-c1">!==</span> <span class="pl-s">""</span><span class="pl-kos">)</span><span class="pl-kos">{</span>
<span class="pl-s1">collection</span><span class="pl-kos">[</span><span class="pl-s1">id</span><span class="pl-kos">]</span><span class="pl-kos">[</span><span class="pl-s1">prop</span><span class="pl-kos">]</span> <span class="pl-c1">=</span> <span class="pl-s1">value</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span> <span class="pl-k">else</span> <span class="pl-kos">{</span>
<span class="pl-k">delete</span> <span class="pl-s1">collection</span><span class="pl-kos">[</span><span class="pl-s1">id</span><span class="pl-kos">]</span><span class="pl-kos">[</span><span class="pl-s1">prop</span><span class="pl-kos">]</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span>
<span class="pl-k">return</span> <span class="pl-s1">collection</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span></pre></div>
<h4 dir="auto">Screenshot</h4>
<p dir="auto">![screenshot-www freecodecamp com 2016-06-07 <code class="notranslate">21-32-40](https://cloud.githubusercontent.com/assets/1762608/15881945/89af329c-2cf7-11e6-8c0b-1d4a31a27c49.png)</code></p> | <p dir="auto">Challenge <a href="http://www.freecodecamp.com/challenges/waypoint-use-comments-to-clarify-code" rel="nofollow">http://www.freecodecamp.com/challenges/waypoint-use-comments-to-clarify-code</a> has an issue. Please describe how to reproduce it, and include links to screenshots if possible.</p>
<p dir="auto">Adding a <-- at the very first line of the code somehow added the --> at the very last line which triggered the "Go to my next challenge" button as if it was correctly completed.</p> | 0 |
<p dir="auto">Start with:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" volumeMounts:
- mountPath: /vol
name: vol
- mountPath: /vol-456
name: vol
subPath: d456"><pre class="notranslate"><code class="notranslate"> volumeMounts:
- mountPath: /vol
name: vol
- mountPath: /vol-456
name: vol
subPath: d456
</code></pre></div>
<p dir="auto">Edit to:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" volumeMounts:
- mountPath: /vol
name: vol
- mountPath: /vol-d2
name: vol
subPath: d2 "><pre class="notranslate"><code class="notranslate"> volumeMounts:
- mountPath: /vol
name: vol
- mountPath: /vol-d2
name: vol
subPath: d2
</code></pre></div>
<p dir="auto">Read back what happened:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" volumeMounts:
- mountPath: /vol-d2
name: vol
subPath: d2
- mountPath: /vol-456
name: vol
subPath: d456"><pre class="notranslate"><code class="notranslate"> volumeMounts:
- mountPath: /vol-d2
name: vol
subPath: d2
- mountPath: /vol-456
name: vol
subPath: d456
</code></pre></div>
<p dir="auto">It synthesized a COMPLETELY WRONG result. At this point, I can not, in good conscience, advocate using kubectl edit.</p>
<p dir="auto">Can I please have <code class="notranslate">kubectl edit --replace</code> that doesn't go through patch brokenness. Or better, make that default for 1.5 and make <code class="notranslate">kubectl edit --patch</code> be the broken (but eventually fixed) path.</p> | <p dir="auto"><strong>Is this a request for help?</strong> (If yes, you should use our troubleshooting guide and community support channels, see <a href="http://kubernetes.io/docs/troubleshooting/" rel="nofollow">http://kubernetes.io/docs/troubleshooting/</a>.): No.</p>
<p dir="auto"><strong>What keywords did you search in Kubernetes issues before filing this one?</strong> (If you have found any duplicates, you should instead reply there.): kubeadm kubelet</p>
<hr>
<p dir="auto"><strong>Is this a BUG REPORT or FEATURE REQUEST?</strong> (choose one): FEATURE REQUEST</p>
<p dir="auto"><strong>Kubernetes version</strong> (use <code class="notranslate">kubectl version</code>):</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="[root@192 lib]# kubectl version
Client Version: version.Info{Major:"1", Minor:"4", GitVersion:"v1.4.0", GitCommit:"a16c0a7f71a6f93c7e0f222d961f4675cd97a46b", GitTreeState:"clean", BuildDate:"2016-09-26T18:16:57Z", GoVersion:"go1.6.3", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"4", GitVersion:"v1.4.0", GitCommit:"a16c0a7f71a6f93c7e0f222d961f4675cd97a46b", GitTreeState:"clean", BuildDate:"2016-09-26T18:10:32Z", GoVersion:"go1.6.3", Compiler:"gc", Platform:"linux/amd64"}"><pre class="notranslate"><code class="notranslate">[root@192 lib]# kubectl version
Client Version: version.Info{Major:"1", Minor:"4", GitVersion:"v1.4.0", GitCommit:"a16c0a7f71a6f93c7e0f222d961f4675cd97a46b", GitTreeState:"clean", BuildDate:"2016-09-26T18:16:57Z", GoVersion:"go1.6.3", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"4", GitVersion:"v1.4.0", GitCommit:"a16c0a7f71a6f93c7e0f222d961f4675cd97a46b", GitTreeState:"clean", BuildDate:"2016-09-26T18:10:32Z", GoVersion:"go1.6.3", Compiler:"gc", Platform:"linux/amd64"}
</code></pre></div>
<p dir="auto"><strong>Environment</strong>:</p>
<ul dir="auto">
<li><strong>Cloud provider or hardware configuration</strong>: VMs</li>
<li><strong>OS</strong> (e.g. from /etc/os-release): CentOS 7</li>
<li><strong>Kernel</strong> (e.g. <code class="notranslate">uname -a</code>): Linux 3.10.0-327.el7.x86_64 <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="35192559" data-permission-text="Title is private" data-url="https://github.com/kubernetes/kubernetes/issues/1" data-hovercard-type="issue" data-hovercard-url="/kubernetes/kubernetes/issues/1/hovercard" href="https://github.com/kubernetes/kubernetes/issues/1">#1</a> SMP Thu Nov 19 22:10:57 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux</li>
<li><strong>Install tools</strong>: kubeadm init</li>
<li><strong>Others</strong>:</li>
</ul>
<p dir="auto"><strong>What happened</strong>:<br>
ps aux | grep kubelet shows following:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="root 9796 2.7 0.9 1089780 75944 ? Ssl 10月13 147:04 /usr/bin/kubelet --kubeconfig=/etc/kubernetes/kubelet.conf --require-kubeconfig=true --pod-manifest-path=/etc/kubernetes/manifests --allow-privileged=true --network-plugin=cni --cni-conf-dir=/etc/cni/net.d --cni-bin-dir=/opt/cni/bin --cluster-dns=100.64.0.10 --cluster-domain=cluster.local --v=4"><pre class="notranslate"><code class="notranslate">root 9796 2.7 0.9 1089780 75944 ? Ssl 10月13 147:04 /usr/bin/kubelet --kubeconfig=/etc/kubernetes/kubelet.conf --require-kubeconfig=true --pod-manifest-path=/etc/kubernetes/manifests --allow-privileged=true --network-plugin=cni --cni-conf-dir=/etc/cni/net.d --cni-bin-dir=/opt/cni/bin --cluster-dns=100.64.0.10 --cluster-domain=cluster.local --v=4
</code></pre></div>
<p dir="auto">Where can we configure the parameters for kubelet?<br>
I have checked the source code of kubeadm but cannot find the correct place to change the configuration if kubelet.</p>
<p dir="auto"><strong>What you expected to happen</strong>:<br>
Specify the right place of customizing kubelet.</p>
<p dir="auto"><strong>How to reproduce it</strong> (as minimally and precisely as possible):<br>
No need to reproduce</p>
<p dir="auto">@kubernetes/sig-cluster-lifecycle</p> | 0 |
<h3 dir="auto">System information</h3>
<ul dir="auto">
<li><strong>Have I written custom code (as opposed to using a stock example script provided in TensorFlow)</strong>: NO</li>
<li><strong>OS Platform and Distribution (e.g., Linux Ubuntu 16.04)</strong>: Windows 10</li>
<li><strong>TensorFlow installed from (source or binary)</strong>: Source</li>
<li><strong>TensorFlow version (use command below)</strong>: Master</li>
<li><strong>Python version</strong>: Python 3.6.7rc1</li>
<li><strong>Bazel version (if compiling from source)</strong>: Build label: 0.17.2<br>
Build target: bazel-out/x64_windows-opt/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar<br>
Build time: Fri Sep 21 10:31:06 2018 (1537525866)<br>
Build timestamp: 1537525866<br>
Build timestamp as int: 1537525866</li>
<li><strong>GCC/Compiler version (if compiling from source)</strong>:</li>
<li><strong>CUDA/cuDNN version</strong>: 10.0 / 7.3.1</li>
<li><strong>GPU model and memory</strong>: GeForce 1050</li>
<li><strong>Exact command to reproduce</strong>:<br>
INFO: From Linking tensorflow/core/liblib_internal_impl.a:<br>
android_armv7a_cpu_utils_helper.o : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library<br>
random_distributions.o : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library<br>
ERROR: D:/tensorflow/tensorflow/core/kernels/BUILD:4420:1: C++ compilation of rule '//tensorflow/core/kernels:scatter_nd_op_gpu' failed (Exit 1): msvc_wrapper_for_nvcc.bat failed: error executing command<br>
cd C:/users/sirto/<em>bazel_sirto/26orbg4z/execroot/org_tensorflow<br>
SET CUDA_TOOLKIT_PATH=C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v10.0<br>
SET CUDNN_INSTALL_PATH=C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v10.0<br>
SET INCLUDE=C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\INCLUDE;C:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt;C:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um;C:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\shared;C:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\um;C:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\winrt;<br>
SET LIB=C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\LIB\amd64;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\LIB\amd64;C:\Program Files (x86)\Windows Kits\10\lib\10.0.10240.0\ucrt\x64;C:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\lib\um\x64;C:\Program Files (x86)\Windows Kits\10\lib\10.0.10240.0\um\x64;<br>
SET PATH=C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\amd64;C:\WINDOWS\Microsoft.NET\Framework64\v4.0.30319;C:\WINDOWS\Microsoft.NET\Framework64;C:\Program Files (x86)\Windows Kits\10\bin\x64;C:\Program Files (x86)\Windows Kits\10\bin\x86;C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6.1 Tools\x64;;C:\WINDOWS\system32<br>
SET PWD=/proc/self/cwd<br>
SET PYTHON_BIN_PATH=D:/Program Files/Python36/python.exe<br>
SET PYTHON_LIB_PATH=D:/Program Files/Python36/lib/site-packages<br>
SET TEMP=C:\Users\sirto\AppData\Local\Temp<br>
SET TF_CUDA_CLANG=0<br>
SET TF_CUDA_COMPUTE_CAPABILITIES=6.1<br>
SET TF_CUDA_VERSION=10.0<br>
SET TF_CUDNN_VERSION=7<br>
SET TF_NEED_CUDA=1<br>
SET TF_NEED_OPENCL_SYCL=0<br>
SET TF_NEED_ROCM=0<br>
SET TMP=C:\Users\sirto\AppData\Local\Temp<br>
external/local_config_cuda/crosstool/windows/msvc_wrapper_for_nvcc.bat /nologo /DCOMPILER_MSVC /DNOMINMAX /D_WIN32_WINNT=0x0600 /D_CRT_SECURE_NO_DEPRECATE /D_CRT_SECURE_NO_WARNINGS /D_SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS /bigobj /Zm500 /J /Gy /GF /EHsc /wd4351 /wd4291 /wd4250 /wd4996 /I. /Ibazel-out/x64_windows-opt/genfiles /Ibazel-out/x64_windows-opt/bin /Iexternal/com_google_absl /Ibazel-out/x64_windows-opt/genfiles/external/com_google_absl /Ibazel-out/x64_windows-opt/bin/external/com_google_absl /Iexternal/bazel_tools /Ibazel-out/x64_windows-opt/genfiles/external/bazel_tools /Ibazel-out/x64_windows-opt/bin/external/bazel_tools /Iexternal/eigen_archive /Ibazel-out/x64_windows-opt/genfiles/external/eigen_archive /Ibazel-out/x64_windows-opt/bin/external/eigen_archive /Iexternal/local_config_sycl /Ibazel-out/x64_windows-opt/genfiles/external/local_config_sycl /Ibazel-out/x64_windows-opt/bin/external/local_config_sycl /Iexternal/nsync /Ibazel-out/x64_windows-opt/genfiles/external/nsync /Ibazel-out/x64_windows-opt/bin/external/nsync /Iexternal/gif_archive /Ibazel-out/x64_windows-opt/genfiles/external/gif_archive /Ibazel-out/x64_windows-opt/bin/external/gif_archive /Iexternal/jpeg /Ibazel-out/x64_windows-opt/genfiles/external/jpeg /Ibazel-out/x64_windows-opt/bin/external/jpeg /Iexternal/protobuf_archive /Ibazel-out/x64_windows-opt/genfiles/external/protobuf_archive /Ibazel-out/x64_windows-opt/bin/external/protobuf_archive /Iexternal/com_googlesource_code_re2 /Ibazel-out/x64_windows-opt/genfiles/external/com_googlesource_code_re2 /Ibazel-out/x64_windows-opt/bin/external/com_googlesource_code_re2 /Iexternal/farmhash_archive /Ibazel-out/x64_windows-opt/genfiles/external/farmhash_archive /Ibazel-out/x64_windows-opt/bin/external/farmhash_archive /Iexternal/fft2d /Ibazel-out/x64_windows-opt/genfiles/external/fft2d /Ibazel-out/x64_windows-opt/bin/external/fft2d /Iexternal/highwayhash /Ibazel-out/x64_windows-opt/genfiles/external/highwayhash /Ibazel-out/x64_windows-opt/bin/external/highwayhash /Iexternal/zlib_archive /Ibazel-out/x64_windows-opt/genfiles/external/zlib_archive /Ibazel-out/x64_windows-opt/bin/external/zlib_archive /Iexternal/double_conversion /Ibazel-out/x64_windows-opt/genfiles/external/double_conversion /Ibazel-out/x64_windows-opt/bin/external/double_conversion /Iexternal/snappy /Ibazel-out/x64_windows-opt/genfiles/external/snappy /Ibazel-out/x64_windows-opt/bin/external/snappy /Iexternal/local_config_cuda /Ibazel-out/x64_windows-opt/genfiles/external/local_config_cuda /Ibazel-out/x64_windows-opt/bin/external/local_config_cuda /Iexternal/eigen_archive /Ibazel-out/x64_windows-opt/genfiles/external/eigen_archive /Ibazel-out/x64_windows-opt/bin/external/eigen_archive /Iexternal/nsync/public /Ibazel-out/x64_windows-opt/genfiles/external/nsync/public /Ibazel-out/x64_windows-opt/bin/external/nsync/public /Iexternal/gif_archive/lib /Ibazel-out/x64_windows-opt/genfiles/external/gif_archive/lib /Ibazel-out/x64_windows-opt/bin/external/gif_archive/lib /Iexternal/gif_archive/windows /Ibazel-out/x64_windows-opt/genfiles/external/gif_archive/windows /Ibazel-out/x64_windows-opt/bin/external/gif_archive/windows /Iexternal/protobuf_archive/src /Ibazel-out/x64_windows-opt/genfiles/external/protobuf_archive/src /Ibazel-out/x64_windows-opt/bin/external/protobuf_archive/src /Iexternal/farmhash_archive/src /Ibazel-out/x64_windows-opt/genfiles/external/farmhash_archive/src /Ibazel-out/x64_windows-opt/bin/external/farmhash_archive/src /Iexternal/zlib_archive /Ibazel-out/x64_windows-opt/genfiles/external/zlib_archive /Ibazel-out/x64_windows-opt/bin/external/zlib_archive /Iexternal/double_conversion /Ibazel-out/x64_windows-opt/genfiles/external/double_conversion /Ibazel-out/x64_windows-opt/bin/external/double_conversion /Iexternal/local_config_cuda/cuda /Ibazel-out/x64_windows-opt/genfiles/external/local_config_cuda/cuda /Ibazel-out/x64_windows-opt/bin/external/local_config_cuda/cuda /Iexternal/local_config_cuda/cuda/cuda/include /Ibazel-out/x64_windows-opt/genfiles/external/local_config_cuda/cuda/cuda/include /Ibazel-out/x64_windows-opt/bin/external/local_config_cuda/cuda/cuda/include /Iexternal/local_config_cuda/cuda/cuda/include/crt /Ibazel-out/x64_windows-opt/genfiles/external/local_config_cuda/cuda/cuda/include/crt /Ibazel-out/x64_windows-opt/bin/external/local_config_cuda/cuda/cuda/include/crt /D__CLANG_SUPPORT_DYN_ANNOTATION</em>_ /DEIGEN_MPL2_ONLY /DEIGEN_MAX_ALIGN_BYTES=64 /DTF_USE_SNAPPY /showIncludes /MD /O2 /DNDEBUG -w /arch:AVX -nvcc_options=disable-warnings -DGOOGLE_CUDA=1 -DTENSORFLOW_MONOLITHIC_BUILD /DPLATFORM_WINDOWS /DEIGEN_HAS_C99_MATH /DTENSORFLOW_USE_EIGEN_THREADPOOL /DEIGEN_AVOID_STL_ARRAY /Iexternal/gemmlowp /wd4018 /wd4577 /DNOGDI /DTF_COMPILE_LIBRARY -x cuda -DGOOGLE_CUDA=1 -nvcc_options=relaxed-constexpr -nvcc_options=ftz=true /Fobazel-out/x64_windows-opt/bin/tensorflow/core/kernels/_objs/scatter_nd_op_gpu/scatter_nd_op_gpu.cu.o /c tensorflow/core/kernels/scatter_nd_op_gpu.cu.cc<br>
c:\users\sirto_bazel_sirto\26orbg4z\execroot\org_tensorflow\external\eigen_archive\eigen\src/Core/arch/CUDA/Half.h(212): error: more than one instance of overloaded function "__hadd" matches the argument list:<br>
function "__hadd(int, int)"<br>
function "__hadd(__half, __half)"<br>
argument types are: (const Eigen::half, const Eigen::half)</li>
</ul>
<p dir="auto">1 error detected in the compilation of "C:/Users/sirto/AppData/Local/Temp/nvcc_inter_files_tmp_dir/scatter_nd_op_gpu.cu.cpp1.ii".<br>
Target //tensorflow/tools/pip_package:build_pip_package failed to build<br>
ERROR: D:/tensorflow/tensorflow/tools/pip_package/BUILD:124:1 C++ compilation of rule '//tensorflow/core/kernels:scatter_nd_op_gpu' failed (Exit 1): msvc_wrapper_for_nvcc.bat failed: error executing command<br>
cd C:/users/sirto/<em>bazel_sirto/26orbg4z/execroot/org_tensorflow<br>
SET CUDA_TOOLKIT_PATH=C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v10.0<br>
SET CUDNN_INSTALL_PATH=C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v10.0<br>
SET INCLUDE=C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\INCLUDE;C:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt;C:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um;C:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\shared;C:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\um;C:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\winrt;<br>
SET LIB=C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\LIB\amd64;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\LIB\amd64;C:\Program Files (x86)\Windows Kits\10\lib\10.0.10240.0\ucrt\x64;C:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\lib\um\x64;C:\Program Files (x86)\Windows Kits\10\lib\10.0.10240.0\um\x64;<br>
SET PATH=C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\amd64;C:\WINDOWS\Microsoft.NET\Framework64\v4.0.30319;C:\WINDOWS\Microsoft.NET\Framework64;C:\Program Files (x86)\Windows Kits\10\bin\x64;C:\Program Files (x86)\Windows Kits\10\bin\x86;C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6.1 Tools\x64;;C:\WINDOWS\system32<br>
SET PWD=/proc/self/cwd<br>
SET PYTHON_BIN_PATH=D:/Program Files/Python36/python.exe<br>
SET PYTHON_LIB_PATH=D:/Program Files/Python36/lib/site-packages<br>
SET TEMP=C:\Users\sirto\AppData\Local\Temp<br>
SET TF_CUDA_CLANG=0<br>
SET TF_CUDA_COMPUTE_CAPABILITIES=6.1<br>
SET TF_CUDA_VERSION=10.0<br>
SET TF_CUDNN_VERSION=7<br>
SET TF_NEED_CUDA=1<br>
SET TF_NEED_OPENCL_SYCL=0<br>
SET TF_NEED_ROCM=0<br>
SET TMP=C:\Users\sirto\AppData\Local\Temp<br>
external/local_config_cuda/crosstool/windows/msvc_wrapper_for_nvcc.bat /nologo /DCOMPILER_MSVC /DNOMINMAX /D_WIN32_WINNT=0x0600 /D_CRT_SECURE_NO_DEPRECATE /D_CRT_SECURE_NO_WARNINGS /D_SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS /bigobj /Zm500 /J /Gy /GF /EHsc /wd4351 /wd4291 /wd4250 /wd4996 /I. /Ibazel-out/x64_windows-opt/genfiles /Ibazel-out/x64_windows-opt/bin /Iexternal/com_google_absl /Ibazel-out/x64_windows-opt/genfiles/external/com_google_absl /Ibazel-out/x64_windows-opt/bin/external/com_google_absl /Iexternal/bazel_tools /Ibazel-out/x64_windows-opt/genfiles/external/bazel_tools /Ibazel-out/x64_windows-opt/bin/external/bazel_tools /Iexternal/eigen_archive /Ibazel-out/x64_windows-opt/genfiles/external/eigen_archive /Ibazel-out/x64_windows-opt/bin/external/eigen_archive /Iexternal/local_config_sycl /Ibazel-out/x64_windows-opt/genfiles/external/local_config_sycl /Ibazel-out/x64_windows-opt/bin/external/local_config_sycl /Iexternal/nsync /Ibazel-out/x64_windows-opt/genfiles/external/nsync /Ibazel-out/x64_windows-opt/bin/external/nsync /Iexternal/gif_archive /Ibazel-out/x64_windows-opt/genfiles/external/gif_archive /Ibazel-out/x64_windows-opt/bin/external/gif_archive /Iexternal/jpeg /Ibazel-out/x64_windows-opt/genfiles/external/jpeg /Ibazel-out/x64_windows-opt/bin/external/jpeg /Iexternal/protobuf_archive /Ibazel-out/x64_windows-opt/genfiles/external/protobuf_archive /Ibazel-out/x64_windows-opt/bin/external/protobuf_archive /Iexternal/com_googlesource_code_re2 /Ibazel-out/x64_windows-opt/genfiles/external/com_googlesource_code_re2 /Ibazel-out/x64_windows-opt/bin/external/com_googlesource_code_re2 /Iexternal/farmhash_archive /Ibazel-out/x64_windows-opt/genfiles/external/farmhash_archive /Ibazel-out/x64_windows-opt/bin/external/farmhash_archive /Iexternal/fft2d /Ibazel-out/x64_windows-opt/genfiles/external/fft2d /Ibazel-out/x64_windows-opt/bin/external/fft2d /Iexternal/highwayhash /Ibazel-out/x64_windows-opt/genfiles/external/highwayhash /Ibazel-out/x64_windows-opt/bin/external/highwayhash /Iexternal/zlib_archive /Ibazel-out/x64_windows-opt/genfiles/external/zlib_archive /Ibazel-out/x64_windows-opt/bin/external/zlib_archive /Iexternal/double_conversion /Ibazel-out/x64_windows-opt/genfiles/external/double_conversion /Ibazel-out/x64_windows-opt/bin/external/double_conversion /Iexternal/snappy /Ibazel-out/x64_windows-opt/genfiles/external/snappy /Ibazel-out/x64_windows-opt/bin/external/snappy /Iexternal/local_config_cuda /Ibazel-out/x64_windows-opt/genfiles/external/local_config_cuda /Ibazel-out/x64_windows-opt/bin/external/local_config_cuda /Iexternal/eigen_archive /Ibazel-out/x64_windows-opt/genfiles/external/eigen_archive /Ibazel-out/x64_windows-opt/bin/external/eigen_archive /Iexternal/nsync/public /Ibazel-out/x64_windows-opt/genfiles/external/nsync/public /Ibazel-out/x64_windows-opt/bin/external/nsync/public /Iexternal/gif_archive/lib /Ibazel-out/x64_windows-opt/genfiles/external/gif_archive/lib /Ibazel-out/x64_windows-opt/bin/external/gif_archive/lib /Iexternal/gif_archive/windows /Ibazel-out/x64_windows-opt/genfiles/external/gif_archive/windows /Ibazel-out/x64_windows-opt/bin/external/gif_archive/windows /Iexternal/protobuf_archive/src /Ibazel-out/x64_windows-opt/genfiles/external/protobuf_archive/src /Ibazel-out/x64_windows-opt/bin/external/protobuf_archive/src /Iexternal/farmhash_archive/src /Ibazel-out/x64_windows-opt/genfiles/external/farmhash_archive/src /Ibazel-out/x64_windows-opt/bin/external/farmhash_archive/src /Iexternal/zlib_archive /Ibazel-out/x64_windows-opt/genfiles/external/zlib_archive /Ibazel-out/x64_windows-opt/bin/external/zlib_archive /Iexternal/double_conversion /Ibazel-out/x64_windows-opt/genfiles/external/double_conversion /Ibazel-out/x64_windows-opt/bin/external/double_conversion /Iexternal/local_config_cuda/cuda /Ibazel-out/x64_windows-opt/genfiles/external/local_config_cuda/cuda /Ibazel-out/x64_windows-opt/bin/external/local_config_cuda/cuda /Iexternal/local_config_cuda/cuda/cuda/include /Ibazel-out/x64_windows-opt/genfiles/external/local_config_cuda/cuda/cuda/include /Ibazel-out/x64_windows-opt/bin/external/local_config_cuda/cuda/cuda/include /Iexternal/local_config_cuda/cuda/cuda/include/crt /Ibazel-out/x64_windows-opt/genfiles/external/local_config_cuda/cuda/cuda/include/crt /Ibazel-out/x64_windows-opt/bin/external/local_config_cuda/cuda/cuda/include/crt /D__CLANG_SUPPORT_DYN_ANNOTATION</em>_ /DEIGEN_MPL2_ONLY /DEIGEN_MAX_ALIGN_BYTES=64 /DTF_USE_SNAPPY /showIncludes /MD /O2 /DNDEBUG -w /arch:AVX -nvcc_options=disable-warnings -DGOOGLE_CUDA=1 -DTENSORFLOW_MONOLITHIC_BUILD /DPLATFORM_WINDOWS /DEIGEN_HAS_C99_MATH /DTENSORFLOW_USE_EIGEN_THREADPOOL /DEIGEN_AVOID_STL_ARRAY /Iexternal/gemmlowp /wd4018 /wd4577 /DNOGDI /DTF_COMPILE_LIBRARY -x cuda -DGOOGLE_CUDA=1 -nvcc_options=relaxed-constexpr -nvcc_options=ftz=true /Fobazel-out/x64_windows-opt/bin/tensorflow/core/kernels/_objs/scatter_nd_op_gpu/scatter_nd_op_gpu.cu.o /c tensorflow/core/kernels/scatter_nd_op_gpu.cu.cc<br>
INFO: Elapsed time: 653.206s, Critical Path: 181.89s<br>
INFO: 2220 processes: 2220 local.<br>
FAILED: Build did NOT complete successfully</p> | <h3 dir="auto">System information</h3>
<ul dir="auto">
<li><strong>Have I written custom code</strong>: I change the CUDA capabilities to 6.1 and 7.0.</li>
<li><strong>OS Platform and Distribution</strong>: Windows 10</li>
<li><strong>TensorFlow installed from (source or binary)</strong>: I'm compiling the source code.</li>
<li><strong>TensorFlow version (use command below)</strong>: branch <code class="notranslate">r1.8</code>, <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/tensorflow/tensorflow/commit/8753e2ebde6c58b56675cc19ab7ff83072824a62/hovercard" href="https://github.com/tensorflow/tensorflow/commit/8753e2ebde6c58b56675cc19ab7ff83072824a62"><tt>8753e2e</tt></a></li>
<li><strong>Python version</strong>: 3.6.0</li>
<li><strong>Bazel version (if compiling from source)</strong>: No</li>
<li><strong>GCC/Compiler version (if compiling from source)</strong>: VS 2017(v141), but v140 for CUDA host compiler</li>
<li><strong>CUDA/cuDNN version</strong>: CUDA 9.0, cuDNN 7.1</li>
<li><strong>GPU model and memory</strong>: 1080 Ti, Titan V</li>
<li><strong>Exact command to reproduce</strong>: cmake-gui, enable GPU, and change CUDA host compiler to v140</li>
</ul>
<h3 dir="auto">Describe the problem</h3>
<p dir="auto"><a href="https://github.com/eigenteam/eigen-git-mirror/blob/2bdd9e80c43ee491fb0cb299940995e094b1647b/Eigen/src/Core/arch/CUDA/Half.h#L212">__hadd()</a> is ambiguous when <a href="https://github.com/eigenteam/eigen-git-mirror/blob/2bdd9e80c43ee491fb0cb299940995e094b1647b/Eigen/src/Core/arch/CUDA/Half.h#L204">EIGEN_CUDA_ARCH >= 530</a>.</p>
<p dir="auto">The following is where the ambiguity comes from found in VS 2017:<br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/6009211/39873593-f19954bc-549d-11e8-8bb6-3c02e33c44c5.png"><img src="https://user-images.githubusercontent.com/6009211/39873593-f19954bc-549d-11e8-8bb6-3c02e33c44c5.png" alt="image" style="max-width: 100%;"></a></p>
<h3 dir="auto">Source code / logs</h3>
<p dir="auto"><code class="notranslate">tf_core_gpu_kernels</code> compilation fails because of this problem:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="42>Building NVCC (Device) object CMakeFiles/tf_core_gpu_kernels.dir/__/__/core/kernels/Release/tf_core_gpu_kernels_generated_check_numerics_op_gpu.cu.cc.obj
42>check_numerics_op_gpu.cu.cc
42>e:\program\ml\tensorflow_build_05-10-01\external\eigen_archive\eigen\src/Core/arch/CUDA/Half.h(212): error : more than one instance of overloaded function "__hadd" matches the argument list:
42> function "__hadd(int, int)"
42> function "__hadd(__half, __half)"
42> argument types are: (const Eigen::half, const Eigen::half)"><pre class="notranslate"><code class="notranslate">42>Building NVCC (Device) object CMakeFiles/tf_core_gpu_kernels.dir/__/__/core/kernels/Release/tf_core_gpu_kernels_generated_check_numerics_op_gpu.cu.cc.obj
42>check_numerics_op_gpu.cu.cc
42>e:\program\ml\tensorflow_build_05-10-01\external\eigen_archive\eigen\src/Core/arch/CUDA/Half.h(212): error : more than one instance of overloaded function "__hadd" matches the argument list:
42> function "__hadd(int, int)"
42> function "__hadd(__half, __half)"
42> argument types are: (const Eigen::half, const Eigen::half)
</code></pre></div>
<p dir="auto">I'm confused that nobody has every post such an issue.<br>
Nobody has ever tried changing CUDA capabilities to >=5.3?<br>
Or is there something wrong with my environment?</p>
<p dir="auto">It seems that this is a pure Eigen issue...</p> | 1 |
<p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=ndeloof" rel="nofollow">nicolas de loof</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-5149?redirect=false" rel="nofollow">SPR-5149</a></strong> and commented</p>
<p dir="auto">When using Spring Assert class to check preconditions, the message is expected to be a String. If you want to pass contextual datas in the message, this requires some String concat even if condition is validated.</p>
<p dir="auto">It would be nice to follow slf4j example and support a MessageFormat pattern. With help of varargs, we could write :</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Assert.isTrue( text.length() <= maxSize, "Value '{0}' is too large ! max size is {1}", text, maxSize );"><pre class="notranslate"><code class="notranslate">Assert.isTrue( text.length() <= maxSize, "Value '{0}' is too large ! max size is {1}", text, maxSize );
</code></pre></div>
<hr>
<p dir="auto"><strong>Affects:</strong> 2.5.5</p>
<p dir="auto"><strong>Issue Links:</strong></p>
<ul dir="auto">
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398099073" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/11001" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/11001/hovercard" href="https://github.com/spring-projects/spring-framework/issues/11001">#11001</a> Assert should use MessageFormat to avoid building unecessary Strings as error message (<em><strong>"is duplicated by"</strong></em>)</li>
</ul> | <p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=sam_bernet" rel="nofollow">Samuel Bernet</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-9627?redirect=false" rel="nofollow">SPR-9627</a></strong> and commented</p>
<p dir="auto">The bugfix <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398117629" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/13814" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/13814/hovercard" href="https://github.com/spring-projects/spring-framework/issues/13814">#13814</a> "Scoped-proxy memory leak w/ <code class="notranslate">@Resource</code> injection" leads to bean instances being cached too eagerly in <code class="notranslate">CommonAnnotationBeanPostProcessor</code>. Besides the (desired) caching of AOP scoped-proxies to prevent the memory leak the current code also caches custom scoped bean instances that should not be cached. This happens for example if client code uses <code class="notranslate">AutowireCapableBeanFactory#autowireBean(Object)</code> to inject dependencies (annotation-based) into a manually created bean. In this case no AOP proxies are involved but the cached instances are still used. The underlying scope is never consulted and can thus never signalize that a new instance is to be created and injected because the context of the scope (e.g. request, session) is different from the first call which resulted in the cached instance.</p>
<p dir="auto">I attached a Test-Case (JUnit 4 Test, requires JUnit and Spring to run). The test-case illustrates the breaking change:</p>
<ul dir="auto">
<li>Runs fine with Spring version 3.1.1 and older (tested with 3.0.5)</li>
<li>Fails with Spring version 3.1.2 and 3.2.M1</li>
<li>The defect was introduced in the bugfix for <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398117629" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/13814" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/13814/hovercard" href="https://github.com/spring-projects/spring-framework/issues/13814">#13814</a> in version 3.2.M1 with commit <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/spring-projects/spring-framework/commit/f779c199ea272cf61781e120b1ab2efc50de0cbb/hovercard" href="https://github.com/spring-projects/spring-framework/commit/f779c199ea272cf61781e120b1ab2efc50de0cbb"><tt>f779c19</tt></a></li>
<li>The defect was back-ported to version 3.1.2 with <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398118859" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/14000" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/14000/hovercard" href="https://github.com/spring-projects/spring-framework/issues/14000">#14000</a></li>
</ul>
<p dir="auto">I understand this calling pattern is not very common but nevertheless the affected API is public and our framework relies on this to provide service beans to instances of "visual" classes (a visual models a single page in a web application). This basically renders custom scoped beans (also being used heavily) unusable for us in releases > 3.1.1, thus my classification as "major".</p>
<p dir="auto">Best regards<br>
Samuel Bernet<br>
MSc ETH Software Engineering<br>
<a href="mailto:samuel.bernet@raiffeisen.ch">samuel.bernet@raiffeisen.ch</a></p>
<hr>
<p dir="auto"><strong>Affects:</strong> 3.1.2, 3.2 M1</p>
<p dir="auto"><strong>Attachments:</strong></p>
<ul dir="auto">
<li><a href="https://jira.spring.io/secure/attachment/20123/SPR-9176-TestCase.zip" rel="nofollow">SPR-9176-TestCase.zip</a> (<em>3.29 kB</em>)</li>
</ul>
<p dir="auto"><strong>Issue Links:</strong></p>
<ul dir="auto">
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398152449" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/14318" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/14318/hovercard" href="https://github.com/spring-projects/spring-framework/issues/14318">#14318</a> <code class="notranslate">@Resource</code> injection regression with scope prototype (<em><strong>"is duplicated by"</strong></em>)</li>
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398117629" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/13814" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/13814/hovercard" href="https://github.com/spring-projects/spring-framework/issues/13814">#13814</a> Scoped-proxy memory leak w/ <code class="notranslate">@Resource</code> injection</li>
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398151713" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/14214" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/14214/hovercard" href="https://github.com/spring-projects/spring-framework/issues/14214">#14214</a> Injecting prototypes into tests using <code class="notranslate">@Resource</code> appears to be broken</li>
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398118859" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/14000" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/14000/hovercard" href="https://github.com/spring-projects/spring-framework/issues/14000">#14000</a> Backport "Scoped-proxy memory leak w/ <code class="notranslate">@Resource</code> injection"</li>
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398153826" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/14485" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/14485/hovercard" href="https://github.com/spring-projects/spring-framework/issues/14485">#14485</a> <code class="notranslate">@Resource</code> injection of singleton in prototype using AnnotationConfigApplicationContext is not thread-safe</li>
</ul>
<p dir="auto"><strong>Referenced from:</strong> commits <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/spring-projects/spring-framework/commit/04af54ad4cd7ac335d275487b19e96ed3335f221/hovercard" href="https://github.com/spring-projects/spring-framework/commit/04af54ad4cd7ac335d275487b19e96ed3335f221"><tt>04af54a</tt></a>, <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/spring-projects/spring-framework/commit/26ee0c4842ca83dec213b5422d0af18ba2e3ce6c/hovercard" href="https://github.com/spring-projects/spring-framework/commit/26ee0c4842ca83dec213b5422d0af18ba2e3ce6c"><tt>26ee0c4</tt></a>, <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/spring-projects/spring-framework/commit/68c5f20bc7891ef9435ffc096e97f626277d27a7/hovercard" href="https://github.com/spring-projects/spring-framework/commit/68c5f20bc7891ef9435ffc096e97f626277d27a7"><tt>68c5f20</tt></a>, <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/spring-projects/spring-framework/commit/19718700cf5a99e8e10af5d11d8005835838ddba/hovercard" href="https://github.com/spring-projects/spring-framework/commit/19718700cf5a99e8e10af5d11d8005835838ddba"><tt>1971870</tt></a></p>
<p dir="auto">1 votes, 5 watchers</p> | 0 |
<h5 dir="auto">ISSUE TYPE</h5>
<ul dir="auto">
<li>Bug Report</li>
</ul>
<h5 dir="auto">COMPONENT NAME</h5>
<p dir="auto">SSH connection plugin</p>
<h5 dir="auto">ANSIBLE VERSION</h5>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="ansible 2.3.1.0
config file = /etc/ansible/ansible.cfg
configured module search path = Default w/o overrides
python version = 2.7.6 (default, Oct 26 2016, 20:30:19) [GCC 4.8.4]"><pre class="notranslate"><code class="notranslate">ansible 2.3.1.0
config file = /etc/ansible/ansible.cfg
configured module search path = Default w/o overrides
python version = 2.7.6 (default, Oct 26 2016, 20:30:19) [GCC 4.8.4]
</code></pre></div>
<h5 dir="auto">CONFIGURATION</h5>
<p dir="auto">Default configuration.</p>
<h5 dir="auto">OS / ENVIRONMENT</h5>
<p dir="auto">Ubuntu 14.04.5<br>
Kernel 3.13.0-83-generic<br>
Ansible installed via pip</p>
<h5 dir="auto">SUMMARY</h5>
<p dir="auto">Looks like SSH connection sharing is broken. I have one single server defined in inventory twice – with the same hostname, but different alias.</p>
<h5 dir="auto">STEPS TO REPRODUCE</h5>
<ol dir="auto">
<li>Any playbook.</li>
<li>Inventory like:</li>
</ol>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="server.io-8721 ansible_host=server.io
server.io-d4f2 ansible_host=server.io"><pre class="notranslate"><code class="notranslate">server.io-8721 ansible_host=server.io
server.io-d4f2 ansible_host=server.io
</code></pre></div>
<h5 dir="auto">EXPECTED RESULTS</h5>
<p dir="auto">Setup task success.</p>
<h5 dir="auto">ACTUAL RESULTS</h5>
<p dir="auto">On <code class="notranslate">setup</code> task I get:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="TASK [setup] *******************************************************************
fatal: [server.io-8721]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect to the host via ssh: Shared connection to server.io closed.\r\n", "unreachable": true}
msg: Failed to connect to the host via ssh: Shared connection to server.io closed.
fatal: [server.io-d4f2]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect to the host via ssh: Shared connection to server.io closed.\r\n", "unreachable": true}
msg: Failed to connect to the host via ssh: Shared connection to server.io closed."><pre class="notranslate"><code class="notranslate">TASK [setup] *******************************************************************
fatal: [server.io-8721]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect to the host via ssh: Shared connection to server.io closed.\r\n", "unreachable": true}
msg: Failed to connect to the host via ssh: Shared connection to server.io closed.
fatal: [server.io-d4f2]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect to the host via ssh: Shared connection to server.io closed.\r\n", "unreachable": true}
msg: Failed to connect to the host via ssh: Shared connection to server.io closed.
</code></pre></div> | <h5 dir="auto">ISSUE TYPE</h5>
<ul dir="auto">
<li>Bug Report</li>
</ul>
<h5 dir="auto">COMPONENT NAME</h5>
<p dir="auto">ansible-playbook / SSH connection type</p>
<h5 dir="auto">ANSIBLE VERSION</h5>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="ansible 2.1.1.0
config file =
configured module search path = Default w/o overrides"><pre class="notranslate"><code class="notranslate">ansible 2.1.1.0
config file =
configured module search path = Default w/o overrides
</code></pre></div>
<h5 dir="auto">CONFIGURATION</h5>
<p dir="auto">No custom config present</p>
<h5 dir="auto">OS / ENVIRONMENT</h5>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="# OracleLinux 7.2
# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 7.2 (Maipo)"><pre class="notranslate"><code class="notranslate"># OracleLinux 7.2
# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 7.2 (Maipo)
</code></pre></div>
<h5 dir="auto">SUMMARY</h5>
<p dir="auto">I'm seeing random (but persistent) failures in ansible-playbook around the setup task failing due to what seems to be SSH multiplexing.</p>
<p dir="auto">We run a playbook comprised of about 15 roles, each with a multitude of tasks. Almost without fail, each run of the playbook will fail at some random point during the "setup" stage, at which point it dumps the contents of the facts discovered about the target node and continues on to the next node. I can reproduce this with a very simple playbook, which I will link below[0] along with the error[1].</p>
<p dir="auto">Looking in the error output, you can see the following type of output: "mux_client_read_packet: read header failed: Broken pipe". I can reproduce this using a very simple SSH command, trimmed down from what Ansible is using:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="# ssh -vvv -o ControlMaster=auto -o ControlPath=/root/.ansible/cp/ansible-ssh-%h-%p-%r database02 hostname
...
debug2: set_control_persist_exit_time: schedule exit in 60 seconds
debug3: mux_client_read_packet: read header failed: Broken pipe
debug2: Received exit status from master 0"><pre class="notranslate"><code class="notranslate"># ssh -vvv -o ControlMaster=auto -o ControlPath=/root/.ansible/cp/ansible-ssh-%h-%p-%r database02 hostname
...
debug2: set_control_persist_exit_time: schedule exit in 60 seconds
debug3: mux_client_read_packet: read header failed: Broken pipe
debug2: Received exit status from master 0
</code></pre></div>
<p dir="auto">If I remove the -o ControlPath from the above, or clean out ~/.ansible/cp, the ssh command works fine, but a re-run of ansible-playbook seems to recreate the faulty socket (at a non deterministic point in the playbook).</p>
<p dir="auto">I have played with <em>many</em> different combinations of ssh_args in ~/.ansible.cfg, including higher values for ControlPersist, ServerAliveInterval, ServerAliveCountMax, changing ControlPath, and enabling pipelining, none seem to make a difference.</p>
<p dir="auto">Can anyone provide any other possible workarounds or ways I can debug this? Is there a way to force Ansible to disable ControlPersist?</p>
<h5 dir="auto">STEPS TO REPRODUCE</h5>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="ansible-playbook -i ~/multinode test.yml -vvvv"><pre class="notranslate"><code class="notranslate">ansible-playbook -i ~/multinode test.yml -vvvv
</code></pre></div>
<p dir="auto">[0] <a href="https://gist.github.com/brk3/1562e595a04d85b9df04bac9c8054273">https://gist.github.com/brk3/1562e595a04d85b9df04bac9c8054273</a> (playbook: test.yml)<br>
[1] <a href="https://gist.github.com/brk3/f06da830405d0cb3ffeed59d2901e5a9">https://gist.github.com/brk3/f06da830405d0cb3ffeed59d2901e5a9</a> (error output)<br>
[2] <a href="https://gist.github.com/brk3/7fe02114c804eef58a108c086d8cb26c">https://gist.github.com/brk3/7fe02114c804eef58a108c086d8cb26c</a> (inventory)</p> | 1 |
<p dir="auto">There is a bug (TypeScript 1.4.1) in js code generation when new line is missing after end comment.</p>
<p dir="auto">To reproduce create new ts project add foo.ts:</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="/*
class Foo {
foo() {
}
} */"><pre class="notranslate"><span class="pl-c">/*</span>
<span class="pl-c">class Foo {</span>
<span class="pl-c"> foo() {</span>
<span class="pl-c"> }</span>
<span class="pl-c">} */</span></pre></div>
<p dir="auto">The generated js is:</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="/*
class Foo {
foo() {
}
/*
class Foo {
foo() {
}
//# sourceMappingURL=foo.js.map"><pre class="notranslate"><span class="pl-c1">/</span><span class="pl-c1">*</span>
<span class="pl-k">class</span> <span class="pl-smi">Foo</span> <span class="pl-kos">{</span>
<span class="pl-en">foo</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-kos">}</span>
<span class="pl-c1">/</span><span class="pl-c1">*</span>
<span class="pl-c1">class</span> <span class="pl-smi">Foo</span> <span class="pl-kos">{</span>
<span class="pl-en">foo</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-kos">}</span>
<span class="pl-c">//# sourceMappingURL=foo.js.map</span><span class="pl-kos"></span></pre></div>
<p dir="auto">If there is new line after */ it works ok.</p> | <p dir="auto">We have a large <code class="notranslate">Typescript</code> application, and sometimes we have code like</p>
<p dir="auto"><code class="notranslate">if (shouldFireNuclearMissiles)...</code></p>
<p dir="auto">while we should have written</p>
<p dir="auto"><code class="notranslate">if (shouldFireNuclearMissiles())...</code></p>
<p dir="auto">(pun intended).</p>
<p dir="auto">So forgetting to evaluate a function results in a <code class="notranslate">truthy</code> value.</p>
<p dir="auto">I forked the <code class="notranslate">tsc</code> compiler to add basic checks for this in the conditional operator, the <code class="notranslate">if-then-else</code>, <code class="notranslate">while</code>, <code class="notranslate">do</code> and <code class="notranslate">for</code> statements, and that was very easy. We found several bugs in our large code using this forked compiler.</p>
<p dir="auto">Would such a stricter compiler option (maybe even emitting warnings) be a sound idea?</p>
<p dir="auto">These automatic <code class="notranslate">truthy</code> and <code class="notranslate">falsy</code> conversions are very handy, but IMHO, for large projects, the comfort they bring does not outweigh the dangers.</p>
<p dir="auto">Most likely this idea is too much non-<code class="notranslate">Javascript</code>-like, but we're coming from sharp & strongly-typed languages, so I must make this suggestion ;-)</p>
<p dir="auto">Thanks,<br>
Peter</p>
<p dir="auto">PS: I first <a href="https://github.com/Microsoft/tslint-microsoft-contrib/issues/112" data-hovercard-type="issue" data-hovercard-url="/microsoft/tslint-microsoft-contrib/issues/112/hovercard">suggested this as a TSLINT rule </a>, but from the friendly feedback I got, it seems this belongs in the compiler instead.</p> | 0 |
<p dir="auto">Like most users, I deal with query related parse error messages quite regularly. One thing that has annoyed me for ages is how unreadable these messages are and I was wondering if it would be possible to improve this. Especially with large complicated queries this would be enormously helpful for many users, I imagine.</p>
<p dir="auto">For reference below is an example. The only problem with this query is that I deliberately changed query into querie to trigger a validation error.</p>
<p dir="auto">The message basically tells me that each of my shards failed to parse it. Unless you are running some weird mix of different es versions in one cluster, the parse error is going to be pretty much always identical across shards. So, repeating it is just clutter in this case. The escaped input makes things hard to read in any case and the fact that the actual problem is listed after this makes it hard to figure out what the problem is.</p>
<p dir="auto">More helpful would if SearchParseException would return a proper json message that would be embedded in the aggregate SearchPhaseExecutionException with a separate field for the original input. Or if that is hard, it would be nice if the message would at least mention the problem before listing the content at least. Also, the from and size attrubute seems to be -1 here. This is probably because the json is actually well formed and there is no syntax problem to report from jackson.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="{
"error": "SearchPhaseExecutionException[Failed to execute phase [query], all shards failed; shardFailures {[XtMbDAz6TBqSKZAUL5zfhA][inbot_users_v20][3]: SearchParseException[[inbot_users_v20][3]: from[-1],size[-1]: Parse Failure [Failed to parse source [{\n \"querie\": {\n \"term\": {\n \"user_id\": {\n \"value\": \"QA0vNmxMevzGf8HCMh8y4A\"\n }\n }\n }\n}\n]]]; nested: SearchParseException[[inbot_users_v20][3]: from[-1],size[-1]: Parse Failure [No parser for element [querie]]]; }{[XtMbDAz6TBqSKZAUL5zfhA][inbot_users_v20][2]: SearchParseException[[inbot_users_v20][2]: from[-1],size[-1]: Parse Failure [Failed to parse source [{\n \"querie\": {\n \"term\": {\n \"user_id\": {\n \"value\": \"QA0vNmxMevzGf8HCMh8y4A\"\n }\n }\n }\n}\n]]]; nested: SearchParseException[[inbot_users_v20][2]: from[-1],size[-1]: Parse Failure [No parser for element [querie]]]; }{[XtMbDAz6TBqSKZAUL5zfhA][inbot_users_v20][1]: SearchParseException[[inbot_users_v20][1]: from[-1],size[-1]: Parse Failure [Failed to parse source [{\n \"querie\": {\n \"term\": {\n \"user_id\": {\n \"value\": \"QA0vNmxMevzGf8HCMh8y4A\"\n }\n }\n }\n}\n]]]; nested: SearchParseException[[inbot_users_v20][1]: from[-1],size[-1]: Parse Failure [No parser for element [querie]]]; }{[XtMbDAz6TBqSKZAUL5zfhA][inbot_users_v20][0]: SearchParseException[[inbot_users_v20][0]: from[-1],size[-1]: Parse Failure [Failed to parse source [{\n \"querie\": {\n \"term\": {\n \"user_id\": {\n \"value\": \"QA0vNmxMevzGf8HCMh8y4A\"\n }\n }\n }\n}\n]]]; nested: SearchParseException[[inbot_users_v20][0]: from[-1],size[-1]: Parse Failure [No parser for element [querie]]]; }{[XtMbDAz6TBqSKZAUL5zfhA][inbot_users_v20][4]: SearchParseException[[inbot_users_v20][4]: from[-1],size[-1]: Parse Failure [Failed to parse source [{\n \"querie\": {\n \"term\": {\n \"user_id\": {\n \"value\": \"QA0vNmxMevzGf8HCMh8y4A\"\n }\n }\n }\n}\n]]]; nested: SearchParseException[[inbot_users_v20][4]: from[-1],size[-1]: Parse Failure [No parser for element [querie]]]; }]",
"status": 400
}"><pre class="notranslate"><code class="notranslate">{
"error": "SearchPhaseExecutionException[Failed to execute phase [query], all shards failed; shardFailures {[XtMbDAz6TBqSKZAUL5zfhA][inbot_users_v20][3]: SearchParseException[[inbot_users_v20][3]: from[-1],size[-1]: Parse Failure [Failed to parse source [{\n \"querie\": {\n \"term\": {\n \"user_id\": {\n \"value\": \"QA0vNmxMevzGf8HCMh8y4A\"\n }\n }\n }\n}\n]]]; nested: SearchParseException[[inbot_users_v20][3]: from[-1],size[-1]: Parse Failure [No parser for element [querie]]]; }{[XtMbDAz6TBqSKZAUL5zfhA][inbot_users_v20][2]: SearchParseException[[inbot_users_v20][2]: from[-1],size[-1]: Parse Failure [Failed to parse source [{\n \"querie\": {\n \"term\": {\n \"user_id\": {\n \"value\": \"QA0vNmxMevzGf8HCMh8y4A\"\n }\n }\n }\n}\n]]]; nested: SearchParseException[[inbot_users_v20][2]: from[-1],size[-1]: Parse Failure [No parser for element [querie]]]; }{[XtMbDAz6TBqSKZAUL5zfhA][inbot_users_v20][1]: SearchParseException[[inbot_users_v20][1]: from[-1],size[-1]: Parse Failure [Failed to parse source [{\n \"querie\": {\n \"term\": {\n \"user_id\": {\n \"value\": \"QA0vNmxMevzGf8HCMh8y4A\"\n }\n }\n }\n}\n]]]; nested: SearchParseException[[inbot_users_v20][1]: from[-1],size[-1]: Parse Failure [No parser for element [querie]]]; }{[XtMbDAz6TBqSKZAUL5zfhA][inbot_users_v20][0]: SearchParseException[[inbot_users_v20][0]: from[-1],size[-1]: Parse Failure [Failed to parse source [{\n \"querie\": {\n \"term\": {\n \"user_id\": {\n \"value\": \"QA0vNmxMevzGf8HCMh8y4A\"\n }\n }\n }\n}\n]]]; nested: SearchParseException[[inbot_users_v20][0]: from[-1],size[-1]: Parse Failure [No parser for element [querie]]]; }{[XtMbDAz6TBqSKZAUL5zfhA][inbot_users_v20][4]: SearchParseException[[inbot_users_v20][4]: from[-1],size[-1]: Parse Failure [Failed to parse source [{\n \"querie\": {\n \"term\": {\n \"user_id\": {\n \"value\": \"QA0vNmxMevzGf8HCMh8y4A\"\n }\n }\n }\n}\n]]]; nested: SearchParseException[[inbot_users_v20][4]: from[-1],size[-1]: Parse Failure [No parser for element [querie]]]; }]",
"status": 400
}
</code></pre></div> | <p dir="auto">Errors returned by the REST API are not easily human readable due to the way the data is stored in the <code class="notranslate">error</code> property.<br>
Eg. <a href="https://gist.github.com/missinglink/e3cb9b127ae00e8c561c">https://gist.github.com/missinglink/e3cb9b127ae00e8c561c</a></p>
<p dir="auto">You can 'prettify' the results, but it is still un-readable.<br>
Eg. <a href="https://gist.github.com/pecke01/5956684">https://gist.github.com/pecke01/5956684</a></p>
<p dir="auto">Note: (this specific error was caused by invalid syntax, the outer curly brackets were missing)</p>
<p dir="auto">This issue makes it difficult for beginners to understand syntax errors and for advanced users to debug quickly when they make silly errors.</p>
<p dir="auto">Ideally usage of <code class="notranslate">?pretty=1</code> would return "developer friendly" messages.</p>
<p dir="auto">Any thoughts / suggestions? Maybe there is a tool which may help?</p> | 1 |
<h2 dir="auto">Checklist</h2>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have included the output of <code class="notranslate">celery -A proj report</code> in the issue.<br>
software -> celery:4.2.1 (windowlicker) kombu:4.2.1 py:3.6.6<br>
billiard:3.5.0.4 py-amqp:2.3.2<br>
platform -> system:Linux arch:64bit, ELF imp:CPython<br>
loader -> celery.loaders.app.AppLoader<br>
settings -> transport:pyamqp results:redis://localhost/</li>
</ul>
<p dir="auto">broker_url: 'amqp://guest:********<a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/localhost/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/localhost">@localhost</a>:5672//'<br>
result_backend: 'redis://localhost/'</p>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have verified that the issue exists against the <code class="notranslate">master</code> branch of Celery.<br>
<em>I've installed Celery using pip.</em></li>
</ul>
<h2 dir="auto">Environment</h2>
<p dir="auto">Miniconda - Python 3.6.6 (see requirements.txt for details below)<br>
Debian 9 running in Virtualbox. VM Config: 4 cores and 8GB RAM<br>
Redis 4.0.11<br>
RabbitMQ 3.6.6 on Erlang 19.2.1</p>
<h2 dir="auto">Steps to reproduce</h2>
<ol start="0" dir="auto">
<li>
<p dir="auto">Install RabbitMQ and Redis, use default config.</p>
</li>
<li>
<p dir="auto">Create conda environment using <a href="https://github.com/celery/celery/files/2360605/requirements.txt">requirements.txt</a></p>
</li>
<li>
<p dir="auto">Save the script below as tasks.py</p>
</li>
<li>
<p dir="auto">Start a worker: <code class="notranslate">celery -A tasks worker -l info</code></p>
</li>
<li>
<p dir="auto">Start python and call the <code class="notranslate">start()</code> function</p>
</li>
</ol>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=">> from tasks import *
>> start(20,100)
"><pre class="notranslate"><code class="notranslate">>> from tasks import *
>> start(20,100)
</code></pre></div>
<p dir="auto">tasks.py:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="from celery import Celery
from celery import group
import time
app = Celery()
app.conf.update(
broker_url='pyamqp://guest@localhost//',
result_backend='redis://localhost',
)
@app.task
def my_calc(data):
for i in range(100):
data[0]=data[0]/1.04856
data[1]=data[1]/1.02496
return data
def compute(parallel_tasks):
tasks=[]
for i in range(parallel_tasks):
tasks.append([i+1.3,i+2.65])
job = group([my_calc.s(task) for task in tasks])
results = job.apply_async().join()
#results = job.apply_async().join(timeout=120)
def start(parallel_tasks,iterations):
for i in range(iterations):
exec_time = int(round(time.time() * 1000))
compute(parallel_tasks)
exec_time = int(round(time.time() * 1000)) - exec_time
print('Iteration {} Exec time: {}ms'.format(i,exec_time))"><pre class="notranslate"><code class="notranslate">from celery import Celery
from celery import group
import time
app = Celery()
app.conf.update(
broker_url='pyamqp://guest@localhost//',
result_backend='redis://localhost',
)
@app.task
def my_calc(data):
for i in range(100):
data[0]=data[0]/1.04856
data[1]=data[1]/1.02496
return data
def compute(parallel_tasks):
tasks=[]
for i in range(parallel_tasks):
tasks.append([i+1.3,i+2.65])
job = group([my_calc.s(task) for task in tasks])
results = job.apply_async().join()
#results = job.apply_async().join(timeout=120)
def start(parallel_tasks,iterations):
for i in range(iterations):
exec_time = int(round(time.time() * 1000))
compute(parallel_tasks)
exec_time = int(round(time.time() * 1000)) - exec_time
print('Iteration {} Exec time: {}ms'.format(i,exec_time))
</code></pre></div>
<h2 dir="auto">Expected behavior</h2>
<p dir="auto">The script should run without error even if the parallel_tasks value is relatively high.</p>
<h2 dir="auto">Actual behavior</h2>
<p dir="auto">Execution stops somewhere between the 5th and 12th iteration in the <code class="notranslate">start()</code> function. Note that the higher the <code class="notranslate">parallel_tasks</code> value the sooner process stuck. The example script runs just fine when the <code class="notranslate">parallel_tasks</code> value is relatively low. (e.g. 4).<br>
If is set a timeout <code class="notranslate">results = job.apply_async().join(timeout=120)</code> it throws the following exception:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Traceback (most recent call last):
File "/home/bakcsa/tools/miniconda3/envs/cel/lib/python3.6/site-packages/celery/backends/async.py", line 255, in _wait_for_pending
on_interval=on_interval):
File "/home/bakcsa/tools/miniconda3/envs/cel/lib/python3.6/site-packages/celery/backends/async.py", line 54, in drain_events_until
raise socket.timeout()
socket.timeout
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/bakcsa/work/awst/projects/qa4sm/celery-test/celery_test/tasks2.py", line 31, in start
compute(parallel_tasks)
File "/home/bakcsa/work/awst/projects/qa4sm/celery-test/celery_test/tasks2.py", line 25, in compute
print(result.get(timeout=20))
File "/home/bakcsa/tools/miniconda3/envs/cel/lib/python3.6/site-packages/celery/result.py", line 224, in get
on_message=on_message,
File "/home/bakcsa/tools/miniconda3/envs/cel/lib/python3.6/site-packages/celery/backends/async.py", line 188, in wait_for_pending
for _ in self._wait_for_pending(result, **kwargs):
File "/home/bakcsa/tools/miniconda3/envs/cel/lib/python3.6/site-packages/celery/backends/async.py", line 259, in _wait_for_pending
raise TimeoutError('The operation timed out.')
celery.exceptions.TimeoutError: The operation timed out."><pre class="notranslate"><code class="notranslate">Traceback (most recent call last):
File "/home/bakcsa/tools/miniconda3/envs/cel/lib/python3.6/site-packages/celery/backends/async.py", line 255, in _wait_for_pending
on_interval=on_interval):
File "/home/bakcsa/tools/miniconda3/envs/cel/lib/python3.6/site-packages/celery/backends/async.py", line 54, in drain_events_until
raise socket.timeout()
socket.timeout
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/bakcsa/work/awst/projects/qa4sm/celery-test/celery_test/tasks2.py", line 31, in start
compute(parallel_tasks)
File "/home/bakcsa/work/awst/projects/qa4sm/celery-test/celery_test/tasks2.py", line 25, in compute
print(result.get(timeout=20))
File "/home/bakcsa/tools/miniconda3/envs/cel/lib/python3.6/site-packages/celery/result.py", line 224, in get
on_message=on_message,
File "/home/bakcsa/tools/miniconda3/envs/cel/lib/python3.6/site-packages/celery/backends/async.py", line 188, in wait_for_pending
for _ in self._wait_for_pending(result, **kwargs):
File "/home/bakcsa/tools/miniconda3/envs/cel/lib/python3.6/site-packages/celery/backends/async.py", line 259, in _wait_for_pending
raise TimeoutError('The operation timed out.')
celery.exceptions.TimeoutError: The operation timed out.
</code></pre></div> | <h2 dir="auto">Checklist</h2>
<p dir="auto">software -> celery:4.2.0 (windowlicker) kombu:4.2.1 py:3.6.3<br>
billiard:3.5.0.4 py-amqp:2.3.2<br>
platform -> system:Linux arch:64bit imp:CPython<br>
loader -> celery.loaders.app.AppLoader<br>
settings -> transport:amqp results:redis://127.0.0.1:6379/</p>
<p dir="auto">BROKER_URL: 'amqp://guest:********@127.0.0.1:5672//'<br>
CELERY_ACCEPT_CONTENT: ['json']<br>
CELERY_RESULT_BACKEND: 'redis://127.0.0.1:6379/'<br>
CELERY_RESULT_SERIALIZER: 'json'<br>
CELERY_TASK_PROTOCOL: 2<br>
CELERY_TASK_SERIALIZER: 'json'<br>
os: <module 'os' from '/home/ehengao/miniconda3/envs/nia-dcs/lib/python3.6/os.py'><br>
CELERY_INCLUDE: ['nia_dcs.ccwp.tasks']</p>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have verified that the issue exists against the <code class="notranslate">master</code> branch of Celery.<br>
yes</li>
</ul>
<h2 dir="auto">Steps to reproduce</h2>
<p dir="auto">Run following test</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="def test_add_with_group():
"""test add task from the tutorial as a group
"""
for i in range(100):
print(f'Runnint test {i}')
add1 = add.s(1, 2)
add2 = add.s(3, 4)
g = group(add1, add2)()
print(f'GroupTasks:{g} sent!')
r = g.get()
print(r)"><pre class="notranslate"><code class="notranslate">def test_add_with_group():
"""test add task from the tutorial as a group
"""
for i in range(100):
print(f'Runnint test {i}')
add1 = add.s(1, 2)
add2 = add.s(3, 4)
g = group(add1, add2)()
print(f'GroupTasks:{g} sent!')
r = g.get()
print(r)
</code></pre></div>
<h2 dir="auto">Expected behavior</h2>
<p dir="auto">Task would pass every time. (randomly not always happen)</p>
<h2 dir="auto">Actual behavior</h2>
<p dir="auto">Task some time blocked and causing pytest in continues integration never returns. After doing some digging into the celery code. noticed that things randomly happen when the AsyncResult.<strong>del</strong> triggered somehow to delete RedisBacken._pending_result before the result is adding to the ResultConsumer.buckets causing the GroupResult still waiting for one of the task to finish.</p> | 1 |
<p dir="auto">Hi,<br>
a really good way to improve test performance would be to add the flag/option to run async tests in parallel. Currently this is not possible but it would increase test speed of independent (well-written) tests A LOT.<br>
I understand that this might break some existing tests so I would either go with the <code class="notranslate">--unstable</code> flag or add a new option like <code class="notranslate">--parallel</code>.</p>
<p dir="auto">What do you think about this?</p> | <p dir="auto">Would be nice if tests could be run in parallel.</p>
<p dir="auto">Of course, assuming you take care of any shared resources correctly.</p>
<p dir="auto">I'm fine giving up "leaking async ops" checks, or maybe just have one at the end "One of your tests leaked async ops, run without --parallel to troubleshoot"...</p> | 1 |
<p dir="auto">#I get an Error if I wan't to push an MaterialPage.</p>
<h2 dir="auto">Screenshot</h2>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/1265139/43197842-cd396418-900c-11e8-816f-a0479d32b4db.png"><img src="https://user-images.githubusercontent.com/1265139/43197842-cd396418-900c-11e8-816f-a0479d32b4db.png" alt="bildschirmfoto 2018-07-25 um 13 14 20" style="max-width: 100%;"></a></p>
<h2 dir="auto">Code</h2>
<div class="highlight highlight-source-dart notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import 'package:flutter/material.dart';
void main() {
runApp(MaterialApp(
title: 'Navigation Basics',
home: FirstScreen(),
));
}
class FirstScreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('First Screen'),
),
body: Center(
child: RaisedButton(
child: Text('Launch screen'),
onPressed: () {
Navigator.push(
context,
new MaterialPageRoute(
builder: (BuildContext context) => new SecondScreen()),
);
},
),
),
);
}
}
class SecondScreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text("Second Screen"),
),
body: Center(
child: RaisedButton(
onPressed: () {
Navigator.pop(context);
},
child: Text('Go back!'),
),
),
);
}
}
"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s">'package:flutter/material.dart'</span>;
<span class="pl-k">void</span> <span class="pl-en">main</span>() {
<span class="pl-en">runApp</span>(<span class="pl-c1">MaterialApp</span>(
title<span class="pl-k">:</span> <span class="pl-s">'Navigation Basics'</span>,
home<span class="pl-k">:</span> <span class="pl-c1">FirstScreen</span>(),
));
}
<span class="pl-k">class</span> <span class="pl-c1">FirstScreen</span> <span class="pl-k">extends</span> <span class="pl-c1">StatelessWidget</span> {
<span class="pl-k">@override</span>
<span class="pl-c1">Widget</span> <span class="pl-en">build</span>(<span class="pl-c1">BuildContext</span> context) {
<span class="pl-k">return</span> <span class="pl-c1">Scaffold</span>(
appBar<span class="pl-k">:</span> <span class="pl-c1">AppBar</span>(
title<span class="pl-k">:</span> <span class="pl-c1">Text</span>(<span class="pl-s">'First Screen'</span>),
),
body<span class="pl-k">:</span> <span class="pl-c1">Center</span>(
child<span class="pl-k">:</span> <span class="pl-c1">RaisedButton</span>(
child<span class="pl-k">:</span> <span class="pl-c1">Text</span>(<span class="pl-s">'Launch screen'</span>),
onPressed<span class="pl-k">:</span> () {
<span class="pl-c1">Navigator</span>.<span class="pl-en">push</span>(
context,
<span class="pl-k">new</span> <span class="pl-c1">MaterialPageRoute</span>(
builder<span class="pl-k">:</span> (<span class="pl-c1">BuildContext</span> context) <span class="pl-k">=></span> <span class="pl-k">new</span> <span class="pl-c1">SecondScreen</span>()),
);
},
),
),
);
}
}
<span class="pl-k">class</span> <span class="pl-c1">SecondScreen</span> <span class="pl-k">extends</span> <span class="pl-c1">StatelessWidget</span> {
<span class="pl-k">@override</span>
<span class="pl-c1">Widget</span> <span class="pl-en">build</span>(<span class="pl-c1">BuildContext</span> context) {
<span class="pl-k">return</span> <span class="pl-c1">Scaffold</span>(
appBar<span class="pl-k">:</span> <span class="pl-c1">AppBar</span>(
title<span class="pl-k">:</span> <span class="pl-c1">Text</span>(<span class="pl-s">"Second Screen"</span>),
),
body<span class="pl-k">:</span> <span class="pl-c1">Center</span>(
child<span class="pl-k">:</span> <span class="pl-c1">RaisedButton</span>(
onPressed<span class="pl-k">:</span> () {
<span class="pl-c1">Navigator</span>.<span class="pl-en">pop</span>(context);
},
child<span class="pl-k">:</span> <span class="pl-c1">Text</span>(<span class="pl-s">'Go back!'</span>),
),
),
);
}
}
</pre></div>
<h2 dir="auto">Error</h2>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Launching lib/main.dart on iPhone X in debug mode...
compiler message: file:///Users/abuder/flutter/packages/flutter/lib/src/widgets/navigator.dart:815:95: Error: Duplicated parameter name 'context'.
compiler message: static Future<T> push<T extends Object>(BuildContext context, Route<T> route, {BuildContext context}) {
compiler message: ^^^^^^^
compiler message: file:///Users/abuder/flutter/packages/flutter/lib/src/widgets/navigator.dart:815:56: Context: Other parameter named 'context'.
compiler message: static Future<T> push<T extends Object>(BuildContext context, Route<T> route, {BuildContext context}) {
compiler message: ^^^^^^^
Compiler failed on /Users/abuder/projects/flutter/butterfly_member/lib/main.dart
Error launching application on iPhone X.
Exited (sigterm)"><pre class="notranslate"><code class="notranslate">Launching lib/main.dart on iPhone X in debug mode...
compiler message: file:///Users/abuder/flutter/packages/flutter/lib/src/widgets/navigator.dart:815:95: Error: Duplicated parameter name 'context'.
compiler message: static Future<T> push<T extends Object>(BuildContext context, Route<T> route, {BuildContext context}) {
compiler message: ^^^^^^^
compiler message: file:///Users/abuder/flutter/packages/flutter/lib/src/widgets/navigator.dart:815:56: Context: Other parameter named 'context'.
compiler message: static Future<T> push<T extends Object>(BuildContext context, Route<T> route, {BuildContext context}) {
compiler message: ^^^^^^^
Compiler failed on /Users/abuder/projects/flutter/butterfly_member/lib/main.dart
Error launching application on iPhone X.
Exited (sigterm)
</code></pre></div> | <p dir="auto">I am trying to add flutter to existing ios app. So before adding to the production app i decided to bring it some demo app. The flutter app independent is working fine in both android and ios. Even in the existing ios app its working fine except the plugin. I followed the tutorial and ran all commands like<br>
<strong>flutter run</strong>,<strong>flutter clean</strong> but nothing made it to work in the existing app. when doing the <strong>pod install</strong> it's showing that it's adding the plugin and fetching the related files for it but when I am using the app its throwing the below error</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="2018-11-01 22:31:44.193838+0530 EgluDiscoverIOS[8186:2926742] flutter: Observatory listening on http://127.0.0.1:53871/
2018-11-01 22:31:49.533104+0530 EgluDiscoverIOS[8186:2926733] [VERBOSE-2:shell.cc(188)] Dart Error: Unhandled exception:
MissingPluginException(No implementation found for method canLaunch on channel plugins.flutter.io/url_launcher)
#0 MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:278:7)
<asynchronous suspension>
#1 canLaunch (package:url_launcher/url_launcher.dart:88:25)
<asynchronous suspension>
#2 AssistantWidget.build._launchUrl (package:eglu_discover_final/assistant.dart:90:17)
<asynchronous suspension>
#3 _InkResponseState._handleTap (package:flutter/src/material/ink_well.dart:507:14)
#4 _InkResponseState.build.<anonymous closure> (package:flutter/src/material/ink_well.dart:562:30)
#5 GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:102:24)
#6 TapGestureRecognizer._checkUp (package:flutter/src/gestures/tap.dart:242:9)
#7 TapGestureRecognizer.acceptGesture (package:flutter/src/gestures/tap.dart:204:7)
#8 GestureArenaManager.sweep (package:flutter/src/gestures/arena.dart:156:27)
#9 _WidgetsFlutterBinding&BindingBase&GestureBinding.handleEvent (package:flutter/src/gestures/binding.dart:143:20)
#10 _WidgetsFlutterBinding&BindingBase&GestureBinding.dispatchEvent (package:flutter/src/gestures/binding.dart:117:22)
#11 _WidgetsFlutterBinding&BindingBase&GestureBinding._handlePointerEvent (package:flutter/src/gestures/binding.dart:97:7)
#12 _WidgetsFlutterBinding&BindingBase&GestureBinding._flushPointerEventQueue (package:flutter/src/gestures/binding.dart:60:7)
#13 _WidgetsFlutterBinding&BindingBase&GestureBinding._handlePointerDataPacket (package:flutter/src/gestures/binding.dart:44:7)
#14 _invoke1 (dart:ui/hooks.dart:159:13)
#15 _dispatchPointerDataPacket (dart:ui/hooks.dart:113:5)
2018-11-01 22:32:05.187471+0530 EgluDiscoverIOS[8186:2926733] [VERBOSE-2:shell.cc(188)] Dart Error: Unhandled exception:
MissingPluginException(No implementation found for method canLaunch on channel plugins.flutter.io/url_launcher)
#0 MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:278:7)
<asynchronous suspension>
#1 canLaunch (package:url_launcher/url_launcher.dart:88:25)
<asynchronous suspension>
#2 UpdateCard._launchUrl (package:eglu_discover_final/update_card.dart:10:17)
<asynchronous suspension>
#3 _InkResponseState._handleTap (package:flutter/src/material/ink_well.dart:507:14)
#4 _InkResponseState.build.<anonymous closure> (package:flutter/src/material/ink_well.dart:562:30)
#5 GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:102:24)
#6 TapGestureRecognizer._checkUp (package:flutter/src/gestures/tap.dart:242:9)
#7 TapGestureRecognizer.acceptGesture (package:flutter/src/gestures/tap.dart:204:7)
#8 GestureArenaManager.sweep (package:flutter/src/gestures/arena.dart:156:27)
#9 _WidgetsFlutterBinding&BindingBase&GestureBinding.handleEvent (package:flutter/src/gestures/binding.dart:143:20)
#10 _WidgetsFlutterBinding&BindingBase&GestureBinding.dispatchEvent (package:flutter/src/gestures/binding.dart:117:22)
#11 _WidgetsFlutterBinding&BindingBase&GestureBinding._handlePointerEvent (package:flutter/src/gestures/binding.dart:97:7)
#12 _WidgetsFlutterBinding&BindingBase&GestureBinding._flushPointerEventQueue (package:flutter/src/gestures/binding.dart:60:7)
#13 _WidgetsFlutterBinding&BindingBase&GestureBinding._handlePointerDataPacket (package:flutter/src/gestures/binding.dart:44:7)
#14 _invoke1 (dart:ui/hooks.dart:159:13)
#15 _dispatchPointerDataPacket (dart:ui/hooks.dart:113:5)"><pre class="notranslate"><code class="notranslate">2018-11-01 22:31:44.193838+0530 EgluDiscoverIOS[8186:2926742] flutter: Observatory listening on http://127.0.0.1:53871/
2018-11-01 22:31:49.533104+0530 EgluDiscoverIOS[8186:2926733] [VERBOSE-2:shell.cc(188)] Dart Error: Unhandled exception:
MissingPluginException(No implementation found for method canLaunch on channel plugins.flutter.io/url_launcher)
#0 MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:278:7)
<asynchronous suspension>
#1 canLaunch (package:url_launcher/url_launcher.dart:88:25)
<asynchronous suspension>
#2 AssistantWidget.build._launchUrl (package:eglu_discover_final/assistant.dart:90:17)
<asynchronous suspension>
#3 _InkResponseState._handleTap (package:flutter/src/material/ink_well.dart:507:14)
#4 _InkResponseState.build.<anonymous closure> (package:flutter/src/material/ink_well.dart:562:30)
#5 GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:102:24)
#6 TapGestureRecognizer._checkUp (package:flutter/src/gestures/tap.dart:242:9)
#7 TapGestureRecognizer.acceptGesture (package:flutter/src/gestures/tap.dart:204:7)
#8 GestureArenaManager.sweep (package:flutter/src/gestures/arena.dart:156:27)
#9 _WidgetsFlutterBinding&BindingBase&GestureBinding.handleEvent (package:flutter/src/gestures/binding.dart:143:20)
#10 _WidgetsFlutterBinding&BindingBase&GestureBinding.dispatchEvent (package:flutter/src/gestures/binding.dart:117:22)
#11 _WidgetsFlutterBinding&BindingBase&GestureBinding._handlePointerEvent (package:flutter/src/gestures/binding.dart:97:7)
#12 _WidgetsFlutterBinding&BindingBase&GestureBinding._flushPointerEventQueue (package:flutter/src/gestures/binding.dart:60:7)
#13 _WidgetsFlutterBinding&BindingBase&GestureBinding._handlePointerDataPacket (package:flutter/src/gestures/binding.dart:44:7)
#14 _invoke1 (dart:ui/hooks.dart:159:13)
#15 _dispatchPointerDataPacket (dart:ui/hooks.dart:113:5)
2018-11-01 22:32:05.187471+0530 EgluDiscoverIOS[8186:2926733] [VERBOSE-2:shell.cc(188)] Dart Error: Unhandled exception:
MissingPluginException(No implementation found for method canLaunch on channel plugins.flutter.io/url_launcher)
#0 MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:278:7)
<asynchronous suspension>
#1 canLaunch (package:url_launcher/url_launcher.dart:88:25)
<asynchronous suspension>
#2 UpdateCard._launchUrl (package:eglu_discover_final/update_card.dart:10:17)
<asynchronous suspension>
#3 _InkResponseState._handleTap (package:flutter/src/material/ink_well.dart:507:14)
#4 _InkResponseState.build.<anonymous closure> (package:flutter/src/material/ink_well.dart:562:30)
#5 GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:102:24)
#6 TapGestureRecognizer._checkUp (package:flutter/src/gestures/tap.dart:242:9)
#7 TapGestureRecognizer.acceptGesture (package:flutter/src/gestures/tap.dart:204:7)
#8 GestureArenaManager.sweep (package:flutter/src/gestures/arena.dart:156:27)
#9 _WidgetsFlutterBinding&BindingBase&GestureBinding.handleEvent (package:flutter/src/gestures/binding.dart:143:20)
#10 _WidgetsFlutterBinding&BindingBase&GestureBinding.dispatchEvent (package:flutter/src/gestures/binding.dart:117:22)
#11 _WidgetsFlutterBinding&BindingBase&GestureBinding._handlePointerEvent (package:flutter/src/gestures/binding.dart:97:7)
#12 _WidgetsFlutterBinding&BindingBase&GestureBinding._flushPointerEventQueue (package:flutter/src/gestures/binding.dart:60:7)
#13 _WidgetsFlutterBinding&BindingBase&GestureBinding._handlePointerDataPacket (package:flutter/src/gestures/binding.dart:44:7)
#14 _invoke1 (dart:ui/hooks.dart:159:13)
#15 _dispatchPointerDataPacket (dart:ui/hooks.dart:113:5)
</code></pre></div>
<p dir="auto">below is my AppDelegate.swift</p>
<div class="highlight highlight-source-swift notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import UIKit
import Flutter
import FlutterPluginRegistrant
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate,FlutterAppLifeCycleProvider {
let lifeCycleDelegate=FlutterPluginAppLifeCycleDelegate()
func addApplicationLifeCycleDelegate(_ delegate: FlutterPlugin) {
lifeCycleDelegate.add(delegate)
}
var rootFlutterViewController:FlutterViewController? {
let viewController = UIApplication.shared.keyWindow?.rootViewController
if viewController!.isKind(of: FlutterViewController.self) {
return viewController as? FlutterViewController
}
return nil
}
var window: UIWindow?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
if launchOptions == nil {
return true
}else {
GeneratedPluginRegistrant.register(with: self as? FlutterPluginRegistry)
return lifeCycleDelegate.application(application, didFinishLaunchingWithOptions: launchOptions!)
}
}
func applicationWillResignActive(_ application: UIApplication) {
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
// Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game.
lifeCycleDelegate.applicationWillResignActive(application)
}
func applicationDidEnterBackground(_ application: UIApplication) {
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
lifeCycleDelegate.applicationDidEnterBackground(application)
}
func applicationWillEnterForeground(_ application: UIApplication) {
// Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background.
lifeCycleDelegate.applicationWillEnterForeground(application)
}
func applicationDidBecomeActive(_ application: UIApplication) {
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
lifeCycleDelegate.applicationDidBecomeActive(application)
}
func applicationWillTerminate(_ application: UIApplication) {
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
lifeCycleDelegate.applicationWillTerminate(application)
}
}"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-en">UIKit</span>
<span class="pl-k">import</span> <span class="pl-en">Flutter</span>
<span class="pl-k">import</span> <span class="pl-en">FlutterPluginRegistrant</span>
<span class="pl-k">@UIApplicationMain</span>
<span class="pl-k">class</span> <span class="pl-en">AppDelegate</span>: <span class="pl-e">UIResponder</span>, <span class="pl-e">UIApplicationDelegate</span>,<span class="pl-e">FlutterAppLifeCycleProvider </span>{
<span class="pl-k">let</span> lifeCycleDelegate<span class="pl-k">=</span><span class="pl-c1">FlutterPluginAppLifeCycleDelegate</span>()
<span class="pl-k">func</span> <span class="pl-en">addApplicationLifeCycleDelegate</span>(<span class="pl-en">_</span> <span class="pl-smi">delegate</span>: FlutterPlugin) {
lifeCycleDelegate.<span class="pl-c1">add</span>(delegate)
}
<span class="pl-k">var</span> rootFlutterViewController:FlutterViewController<span class="pl-k">?</span> {
<span class="pl-k">let</span> viewController <span class="pl-k">=</span> UIApplication.<span class="pl-smi">shared</span>.<span class="pl-smi">keyWindow</span><span class="pl-k">?</span>.<span class="pl-smi">rootViewController</span>
<span class="pl-k">if</span> viewController<span class="pl-k">!</span>.<span class="pl-c1">isKind</span>(<span class="pl-c1">of</span>: FlutterViewController.<span class="pl-k">self</span>) {
<span class="pl-k">return</span> viewController <span class="pl-k">as?</span> FlutterViewController
}
<span class="pl-k">return</span> <span class="pl-c1">nil</span>
}
<span class="pl-k">var</span> window: UIWindow<span class="pl-k">?</span>
<span class="pl-k">func</span> <span class="pl-en">application</span>(<span class="pl-en">_</span> <span class="pl-smi">application</span>: UIApplication, <span class="pl-en">didFinishLaunchingWithOptions</span> <span class="pl-smi">launchOptions</span>: [UIApplication.LaunchOptionsKey: <span class="pl-c1">Any</span>]<span class="pl-k">?</span>) <span class="pl-k">-></span> <span class="pl-c1">Bool</span> {
<span class="pl-c"><span class="pl-c">//</span> Override point for customization after application launch.</span>
<span class="pl-c"></span> <span class="pl-k">if</span> launchOptions <span class="pl-k">==</span> <span class="pl-c1">nil</span> {
<span class="pl-k">return</span> <span class="pl-c1">true</span>
}<span class="pl-k">else</span> {
GeneratedPluginRegistrant.<span class="pl-c1">register</span>(<span class="pl-c1">with</span>: <span class="pl-c1">self</span> <span class="pl-k">as?</span> FlutterPluginRegistry)
<span class="pl-k">return</span> lifeCycleDelegate.<span class="pl-c1">application</span>(application, <span class="pl-c1">didFinishLaunchingWithOptions</span>: launchOptions<span class="pl-k">!</span>)
}
}
<span class="pl-k">func</span> <span class="pl-en">applicationWillResignActive</span>(<span class="pl-en">_</span> <span class="pl-smi">application</span>: UIApplication) {
<span class="pl-c"><span class="pl-c">//</span> Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.</span>
<span class="pl-c"></span> <span class="pl-c"><span class="pl-c">//</span> Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game.</span>
<span class="pl-c"></span> lifeCycleDelegate.<span class="pl-c1">applicationWillResignActive</span>(application)
}
<span class="pl-k">func</span> <span class="pl-en">applicationDidEnterBackground</span>(<span class="pl-en">_</span> <span class="pl-smi">application</span>: UIApplication) {
<span class="pl-c"><span class="pl-c">//</span> Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.</span>
<span class="pl-c"></span> <span class="pl-c"><span class="pl-c">//</span> If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.</span>
<span class="pl-c"></span> lifeCycleDelegate.<span class="pl-c1">applicationDidEnterBackground</span>(application)
}
<span class="pl-k">func</span> <span class="pl-en">applicationWillEnterForeground</span>(<span class="pl-en">_</span> <span class="pl-smi">application</span>: UIApplication) {
<span class="pl-c"><span class="pl-c">//</span> Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background.</span>
<span class="pl-c"></span> lifeCycleDelegate.<span class="pl-c1">applicationWillEnterForeground</span>(application)
}
<span class="pl-k">func</span> <span class="pl-en">applicationDidBecomeActive</span>(<span class="pl-en">_</span> <span class="pl-smi">application</span>: UIApplication) {
<span class="pl-c"><span class="pl-c">//</span> Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.</span>
<span class="pl-c"></span> lifeCycleDelegate.<span class="pl-c1">applicationDidBecomeActive</span>(application)
}
<span class="pl-k">func</span> <span class="pl-en">applicationWillTerminate</span>(<span class="pl-en">_</span> <span class="pl-smi">application</span>: UIApplication) {
<span class="pl-c"><span class="pl-c">//</span> Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.</span>
<span class="pl-c"></span> lifeCycleDelegate.<span class="pl-c1">applicationWillTerminate</span>(application)
}
}</pre></div>
<p dir="auto">I am trying to use this plugin <a href="https://pub.dartlang.org/packages/url_launcher" rel="nofollow">https://pub.dartlang.org/packages/url_launcher</a></p> | 0 |
<h4 dir="auto">A small, complete example of the issue</h4>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content=""""Example of Pandas bug."""
from numpy.random import randn
from pandas import DataFrame, read_msgpack
POWER = 6
ROWS = 10 ** POWER
COLS = 280
SIZE = ROWS * COLS
# COL_NAMES = ['Columns']
print('rows: {:,}; cols: {}; data points: {:,}; float memory (bytes): {:,}; '
'float memory (GiB): {:.3}'.format(ROWS, COLS, SIZE, SIZE * 8,
float(SIZE * 8) / 1024 / 1024 / 1024))
DTF = DataFrame(randn(ROWS, COLS)) # , columns=COL_NAMES
print(DTF)
DTF.to_msgpack('foobar_{}.msg'.format(POWER))
print('Reading exercise')
DTF2 = read_msgpack('foobar_{}.msg'.format(POWER))
print(DTF2)"><pre class="notranslate"><span class="pl-s">"""Example of Pandas bug."""</span>
<span class="pl-k">from</span> <span class="pl-s1">numpy</span>.<span class="pl-s1">random</span> <span class="pl-k">import</span> <span class="pl-s1">randn</span>
<span class="pl-k">from</span> <span class="pl-s1">pandas</span> <span class="pl-k">import</span> <span class="pl-v">DataFrame</span>, <span class="pl-s1">read_msgpack</span>
<span class="pl-v">POWER</span> <span class="pl-c1">=</span> <span class="pl-c1">6</span>
<span class="pl-v">ROWS</span> <span class="pl-c1">=</span> <span class="pl-c1">10</span> <span class="pl-c1">**</span> <span class="pl-v">POWER</span>
<span class="pl-v">COLS</span> <span class="pl-c1">=</span> <span class="pl-c1">280</span>
<span class="pl-v">SIZE</span> <span class="pl-c1">=</span> <span class="pl-v">ROWS</span> <span class="pl-c1">*</span> <span class="pl-v">COLS</span>
<span class="pl-c"># COL_NAMES = ['Columns']</span>
<span class="pl-en">print</span>(<span class="pl-s">'rows: {:,}; cols: {}; data points: {:,}; float memory (bytes): {:,}; '</span>
<span class="pl-s">'float memory (GiB): {:.3}'</span>.<span class="pl-en">format</span>(<span class="pl-v">ROWS</span>, <span class="pl-v">COLS</span>, <span class="pl-v">SIZE</span>, <span class="pl-v">SIZE</span> <span class="pl-c1">*</span> <span class="pl-c1">8</span>,
<span class="pl-en">float</span>(<span class="pl-v">SIZE</span> <span class="pl-c1">*</span> <span class="pl-c1">8</span>) <span class="pl-c1">/</span> <span class="pl-c1">1024</span> <span class="pl-c1">/</span> <span class="pl-c1">1024</span> <span class="pl-c1">/</span> <span class="pl-c1">1024</span>))
<span class="pl-v">DTF</span> <span class="pl-c1">=</span> <span class="pl-v">DataFrame</span>(<span class="pl-en">randn</span>(<span class="pl-v">ROWS</span>, <span class="pl-v">COLS</span>)) <span class="pl-c"># , columns=COL_NAMES</span>
<span class="pl-en">print</span>(<span class="pl-v">DTF</span>)
<span class="pl-v">DTF</span>.<span class="pl-en">to_msgpack</span>(<span class="pl-s">'foobar_{}.msg'</span>.<span class="pl-en">format</span>(<span class="pl-v">POWER</span>))
<span class="pl-en">print</span>(<span class="pl-s">'Reading exercise'</span>)
<span class="pl-v">DTF2</span> <span class="pl-c1">=</span> <span class="pl-en">read_msgpack</span>(<span class="pl-s">'foobar_{}.msg'</span>.<span class="pl-en">format</span>(<span class="pl-v">POWER</span>))
<span class="pl-en">print</span>(<span class="pl-v">DTF2</span>)</pre></div>
<h4 dir="auto">Current Output</h4>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="rows: 1,000,000; cols: 280; data points: 280,000,000; float memory (bytes): 2,240,000,000; float memory (GiB): 2.09
0 1 2 3 4 5 6 \
0 -0.026045 1.102096 0.702563 -1.508039 0.308464 0.504351 2.887272
7 8 9 ... 270 271 272 273 \
0 -0.700034 -0.11521 -0.447198 ... -0.566173 0.16131 -0.581333 -0.362
274 275 276 277 278 279
0 -1.433336 0.60287 0.799355 0.628572 0.542312 -0.410359
[1 rows x 280 columns]
Reading exercise
Traceback (most recent call last):
File "../bug/pandas_bug6.py", line 20, in <module>
print(DTF2.head(1))
AttributeError: 'list' object has no attribute 'head'"><pre class="notranslate"><code class="notranslate">rows: 1,000,000; cols: 280; data points: 280,000,000; float memory (bytes): 2,240,000,000; float memory (GiB): 2.09
0 1 2 3 4 5 6 \
0 -0.026045 1.102096 0.702563 -1.508039 0.308464 0.504351 2.887272
7 8 9 ... 270 271 272 273 \
0 -0.700034 -0.11521 -0.447198 ... -0.566173 0.16131 -0.581333 -0.362
274 275 276 277 278 279
0 -1.433336 0.60287 0.799355 0.628572 0.542312 -0.410359
[1 rows x 280 columns]
Reading exercise
Traceback (most recent call last):
File "../bug/pandas_bug6.py", line 20, in <module>
print(DTF2.head(1))
AttributeError: 'list' object has no attribute 'head'
</code></pre></div>
<h4 dir="auto">Expected Output</h4>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="rows: 1,000,000; cols: 280; data points: 280,000,000; float memory (bytes): 2,240,000,000; float memory (GiB): 2.09
0 1 2 3 4 5 6 \
0 -0.026045 1.102096 0.702563 -1.508039 0.308464 0.504351 2.887272
7 8 9 ... 270 271 272 273 \
0 -0.700034 -0.11521 -0.447198 ... -0.566173 0.16131 -0.581333 -0.362
274 275 276 277 278 279
0 -1.433336 0.60287 0.799355 0.628572 0.542312 -0.410359
[1 rows x 280 columns]
Reading exercise
0 1 2 3 4 5 6 \
0 -0.026045 1.102096 0.702563 -1.508039 0.308464 0.504351 2.887272
7 8 9 ... 270 271 272 273 \
0 -0.700034 -0.11521 -0.447198 ... -0.566173 0.16131 -0.581333 -0.362
274 275 276 277 278 279
0 -1.433336 0.60287 0.799355 0.628572 0.542312 -0.410359
[1 rows x 280 columns]"><pre class="notranslate"><code class="notranslate">rows: 1,000,000; cols: 280; data points: 280,000,000; float memory (bytes): 2,240,000,000; float memory (GiB): 2.09
0 1 2 3 4 5 6 \
0 -0.026045 1.102096 0.702563 -1.508039 0.308464 0.504351 2.887272
7 8 9 ... 270 271 272 273 \
0 -0.700034 -0.11521 -0.447198 ... -0.566173 0.16131 -0.581333 -0.362
274 275 276 277 278 279
0 -1.433336 0.60287 0.799355 0.628572 0.542312 -0.410359
[1 rows x 280 columns]
Reading exercise
0 1 2 3 4 5 6 \
0 -0.026045 1.102096 0.702563 -1.508039 0.308464 0.504351 2.887272
7 8 9 ... 270 271 272 273 \
0 -0.700034 -0.11521 -0.447198 ... -0.566173 0.16131 -0.581333 -0.362
274 275 276 277 278 279
0 -1.433336 0.60287 0.799355 0.628572 0.542312 -0.410359
[1 rows x 280 columns]
</code></pre></div>
<h4 dir="auto">Output of <code class="notranslate">pd.show_versions()</code></h4>
<details>
## INSTALLED VERSIONS
<p dir="auto">commit: None<br>
python: 2.7.10.final.0<br>
python-bits: 64<br>
OS: Darwin<br>
OS-release: 16.0.0<br>
machine: x86_64<br>
processor: i386<br>
byteorder: little<br>
LC_ALL: None<br>
LANG: None</p>
<p dir="auto">pandas: 0.18.1<br>
nose: None<br>
pip: 8.1.2<br>
setuptools: 18.5<br>
Cython: None<br>
numpy: 1.8.0rc1<br>
scipy: 0.13.0b1<br>
statsmodels: None<br>
xarray: None<br>
IPython: None<br>
sphinx: None<br>
patsy: None<br>
dateutil: 1.5<br>
pytz: 2013.7<br>
blosc: None<br>
bottleneck: None<br>
tables: None<br>
numexpr: None<br>
matplotlib: 1.3.1<br>
openpyxl: None<br>
xlrd: None<br>
xlwt: None<br>
xlsxwriter: None<br>
lxml: None<br>
bs4: None<br>
html5lib: None<br>
httplib2: None<br>
apiclient: None<br>
sqlalchemy: None<br>
pymysql: None<br>
psycopg2: None<br>
jinja2: None<br>
boto: None<br>
pandas_datareader: None<br>
None</p>
</details> | <p dir="auto">Hi guys,</p>
<p dir="auto">I am happy to help you improve <code class="notranslate">msgpack.</code><br>
I tried to export my massive dataframe this morning using <code class="notranslate">msgpack</code>, and I got this error.</p>
<p dir="auto"><code class="notranslate">ValueError: EXT data is too large</code></p>
<p dir="auto">What does that mean? Is there a size limit?</p> | 1 |
<p dir="auto">--></p>
<h1 dir="auto">Environment</h1>
<p dir="auto">Windows build number: Windows 1903<br>
Windows Terminal version (if applicable): 0.2.1715.0</p>
<p dir="auto">Any other software?<br>
Tried different version of PSh (5.x / 6.2.1 / 7.0.0), and CMD</p>
<h1 dir="auto">Steps to reproduce</h1>
<p dir="auto">the sign | cannot by typed using a german keyboard in Windows 10.</p>
<h1 dir="auto">Expected behavior</h1>
<p dir="auto">I expected this sign to work as it is one of the most important commands in PoSh</p>
<h1 dir="auto">Actual behavior</h1>
<p dir="auto">the output is < instead of |</p>
<p dir="auto"><strong>parent issues:</strong><br>
<a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="441319503" data-permission-text="Title is private" data-url="https://github.com/microsoft/terminal/issues/521" data-hovercard-type="issue" data-hovercard-url="/microsoft/terminal/issues/521/hovercard" href="https://github.com/microsoft/terminal/issues/521">#521</a></p>
<p dir="auto"><strong>related duplicate issues:</strong><br>
<a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="460360445" data-permission-text="Title is private" data-url="https://github.com/microsoft/terminal/issues/1596" data-hovercard-type="issue" data-hovercard-url="/microsoft/terminal/issues/1596/hovercard" href="https://github.com/microsoft/terminal/issues/1596">#1596</a>,<a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="447130607" data-permission-text="Title is private" data-url="https://github.com/microsoft/terminal/issues/940" data-hovercard-type="issue" data-hovercard-url="/microsoft/terminal/issues/940/hovercard" href="https://github.com/microsoft/terminal/issues/940">#940</a>,<a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="448754725" data-permission-text="Title is private" data-url="https://github.com/microsoft/terminal/issues/1027" data-hovercard-type="issue" data-hovercard-url="/microsoft/terminal/issues/1027/hovercard" href="https://github.com/microsoft/terminal/issues/1027">#1027</a>,<a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="448353698" data-permission-text="Title is private" data-url="https://github.com/microsoft/terminal/issues/1010" data-hovercard-type="issue" data-hovercard-url="/microsoft/terminal/issues/1010/hovercard" href="https://github.com/microsoft/terminal/issues/1010">#1010</a></p> | <p dir="auto">I don't know if this can be done already, but can we have an option to launch the terminal as an normal/elevated user from the context menu in explorer, similar to what you can already do with CMD/Powershell?</p> | 0 |
<p dir="auto">Since the verify parameter is designed with the certificate stored on the filesystem, I have had to do some workarounds in my application, since I am expecting certificates to be passed in using environment variables. While experimenting with these workarounds, I noticed some strange behaviors.</p>
<p dir="auto">Main Issue:</p>
<ul dir="auto">
<li>The docs claim that path/path-like objects are the intended use case, however, you are able to pass some things in that aren't path-like, and it is able to work.</li>
<li>You should definitely be able to just pass in a certificate as a variable, why is this not supported?</li>
</ul>
<p dir="auto">Please read the <em>Reproduction Steps</em> below, that is best way to understand the issue.</p>
<h2 dir="auto">Expected Result</h2>
<p dir="auto">When using the verify= parameter, I expect to be able to pass in these types of objects:</p>
<ul dir="auto">
<li>string of path</li>
<li>os.PathLike</li>
</ul>
<p dir="auto">Current Error Message, when passing in a wrong Type:<br>
TypeError: stat: path should be string, bytes, os.PathLike or integer, not _io.StringIO</p>
<h2 dir="auto">Actual Result</h2>
<p dir="auto">Things passed in that could work:</p>
<ul dir="auto">
<li>certificate in string form, however only when using .read() function</li>
<li>path or pathlike of certificate</li>
</ul>
<p dir="auto">What happened instead.</p>
<h2 dir="auto">Reproduction Steps</h2>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import requests
from io import StringIO
import os
import tempfile
## Get certificate stored in env variable
tls = os.getenv("TLS")
## Do some conversions of the certificate
# StringIO Form
f = StringIO(codecs.decode(tls, encoding="hex").decode())
# String Form
y = f.read()
# Tempfile Form
a = bytes.fromhex(tls)
fp = tempfile.NamedTemporaryFile()
fn = fp.name
fp.write(a)
fp.seek(0)
cert_path = fn
## Use the certificate in various ways:
requests.get("https://192.168.1.12:8080/v1/getinfo", headers=headers, verify=cert_path).json()
# Successful, most canonical way to do it
requests.get("https://192.168.1.12:8080/v1/getinfo", headers=headers, verify=f.read()).json()
# Successful, throws WARNING: InsecureRequestWarning: Unverified HTTPS request is being made to host '192.168.1.12'. # Adding certificate verification is strongly advised.
# Since it was successful, it seems the warning isn't valid, since an unverified HTTPS requests was not sent.
requests.get("https://192.168.1.12:8080/v1/getinfo", headers=headers, verify=y).json()
# Failure: OSError: Could not find a suitable TLS CA certificate bundle, invalid path: ..."><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s1">requests</span>
<span class="pl-k">from</span> <span class="pl-s1">io</span> <span class="pl-k">import</span> <span class="pl-v">StringIO</span>
<span class="pl-k">import</span> <span class="pl-s1">os</span>
<span class="pl-k">import</span> <span class="pl-s1">tempfile</span>
<span class="pl-c">## Get certificate stored in env variable</span>
<span class="pl-s1">tls</span> <span class="pl-c1">=</span> <span class="pl-s1">os</span>.<span class="pl-en">getenv</span>(<span class="pl-s">"TLS"</span>)
<span class="pl-c">## Do some conversions of the certificate</span>
<span class="pl-c"># StringIO Form</span>
<span class="pl-s1">f</span> <span class="pl-c1">=</span> <span class="pl-v">StringIO</span>(<span class="pl-s1">codecs</span>.<span class="pl-en">decode</span>(<span class="pl-s1">tls</span>, <span class="pl-s1">encoding</span><span class="pl-c1">=</span><span class="pl-s">"hex"</span>).<span class="pl-en">decode</span>())
<span class="pl-c"># String Form</span>
<span class="pl-s1">y</span> <span class="pl-c1">=</span> <span class="pl-s1">f</span>.<span class="pl-en">read</span>()
<span class="pl-c"># Tempfile Form</span>
<span class="pl-s1">a</span> <span class="pl-c1">=</span> <span class="pl-s1">bytes</span>.<span class="pl-en">fromhex</span>(<span class="pl-s1">tls</span>)
<span class="pl-s1">fp</span> <span class="pl-c1">=</span> <span class="pl-s1">tempfile</span>.<span class="pl-v">NamedTemporaryFile</span>()
<span class="pl-s1">fn</span> <span class="pl-c1">=</span> <span class="pl-s1">fp</span>.<span class="pl-s1">name</span>
<span class="pl-s1">fp</span>.<span class="pl-en">write</span>(<span class="pl-s1">a</span>)
<span class="pl-s1">fp</span>.<span class="pl-en">seek</span>(<span class="pl-c1">0</span>)
<span class="pl-s1">cert_path</span> <span class="pl-c1">=</span> <span class="pl-s1">fn</span>
<span class="pl-c">## Use the certificate in various ways:</span>
<span class="pl-s1">requests</span>.<span class="pl-en">get</span>(<span class="pl-s">"https://192.168.1.12:8080/v1/getinfo"</span>, <span class="pl-s1">headers</span><span class="pl-c1">=</span><span class="pl-s1">headers</span>, <span class="pl-s1">verify</span><span class="pl-c1">=</span><span class="pl-s1">cert_path</span>).<span class="pl-en">json</span>()
<span class="pl-c"># Successful, most canonical way to do it</span>
<span class="pl-s1">requests</span>.<span class="pl-en">get</span>(<span class="pl-s">"https://192.168.1.12:8080/v1/getinfo"</span>, <span class="pl-s1">headers</span><span class="pl-c1">=</span><span class="pl-s1">headers</span>, <span class="pl-s1">verify</span><span class="pl-c1">=</span><span class="pl-s1">f</span>.<span class="pl-en">read</span>()).<span class="pl-en">json</span>()
<span class="pl-c"># Successful, throws WARNING: InsecureRequestWarning: Unverified HTTPS request is being made to host '192.168.1.12'. # Adding certificate verification is strongly advised.</span>
<span class="pl-c"># Since it was successful, it seems the warning isn't valid, since an unverified HTTPS requests was not sent.</span>
<span class="pl-s1">requests</span>.<span class="pl-en">get</span>(<span class="pl-s">"https://192.168.1.12:8080/v1/getinfo"</span>, <span class="pl-s1">headers</span><span class="pl-c1">=</span><span class="pl-s1">headers</span>, <span class="pl-s1">verify</span><span class="pl-c1">=</span><span class="pl-s1">y</span>).<span class="pl-en">json</span>()
<span class="pl-c"># Failure: OSError: Could not find a suitable TLS CA certificate bundle, invalid path: ...</span></pre></div>
<h2 dir="auto">System Information</h2>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$ python -m requests.help"><pre class="notranslate"><code class="notranslate">$ python -m requests.help
</code></pre></div>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="{
"chardet": {
"version": "3.0.4"
},
"cryptography": {
"version": "3.2"
},
"idna": {
"version": "2.10"
},
"implementation": {
"name": "CPython",
"version": "3.8.5"
},
"platform": {
"release": "5.8.0-7642-generic",
"system": "Linux"
},
"pyOpenSSL": {
"openssl_version": "1010108f",
"version": "20.0.1"
},
"requests": {
"version": "2.25.0"
},
"system_ssl": {
"version": "1010106f"
},
"urllib3": {
"version": "1.25.10"
},
"using_pyopenssl": true
}"><pre class="notranslate"><code class="notranslate">{
"chardet": {
"version": "3.0.4"
},
"cryptography": {
"version": "3.2"
},
"idna": {
"version": "2.10"
},
"implementation": {
"name": "CPython",
"version": "3.8.5"
},
"platform": {
"release": "5.8.0-7642-generic",
"system": "Linux"
},
"pyOpenSSL": {
"openssl_version": "1010108f",
"version": "20.0.1"
},
"requests": {
"version": "2.25.0"
},
"system_ssl": {
"version": "1010106f"
},
"urllib3": {
"version": "1.25.10"
},
"using_pyopenssl": true
}
</code></pre></div>
<p dir="auto">This command is only available on Requests v2.16.4 and greater. Otherwise,<br>
please provide some basic information about your system (Python version,<br>
operating system, &c).</p> | <p dir="auto">Since requests can be attached with an auth method, and there is oauth files in the package, so we can pass auth method to requests in order to archive auto auth function.<br>
However, the code of oauth is conflicting with current trunk code.<br>
Let's see<br>
<a href="https://github.com/kennethreitz/requests/blob/develop/requests/models.py#L535">https://github.com/kennethreitz/requests/blob/develop/requests/models.py#L535</a><br>
So if i pass in a dict object as post data, content-type will be set automatically.<br>
Then see here<br>
<a href="https://github.com/kennethreitz/requests/blob/develop/requests/auth.py#L81">https://github.com/kennethreitz/requests/blob/develop/requests/auth.py#L81</a><br>
If content-type is set, oauth won't work! It expects signing will be executed by manual operation!<br>
Let's summarize all things:<br>
Content-Type is set for the existence of non-plain dict object, oauth rejects to work for the existence of content-type.<br>
WTF!<br>
Either cancel automatically adding content-type or always sign the request without thinking about content-type will finally solve the problem.<br>
Plz fix it.</p> | 0 |
<h5 dir="auto">Detailed description</h5>
<p dir="auto">Intel's Inference Engine supports asynchronous forward passes using multiple inference requests. Let users enable async. networks inference.</p>
<h4 dir="auto">Initial proposal</h4>
<ul dir="auto">
<li>Requires adding a new method <code class="notranslate">Net::enableAsync(bool)</code> to specify if we want to execute network asynchronously.</li>
<li><code class="notranslate">Net::setInput</code> is used to set input data in the internal inputs queue and <code class="notranslate">Net::forward</code> to retrieve outputs in the same order.</li>
<li><code class="notranslate">Net::forward</code> returns an empty Mat in case of output is not ready => User need to check that output is not empty.</li>
</ul>
<p dir="auto">Considered scenarios of Net in async mode:</p>
<h5 dir="auto">Standard loop</h5>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="net.enableAsync(1);
net.setInput(inp1);
out1 = net.forward();
net.setInput(inp2);
out = net.forward(); // out is output for inp1 if out1 is empty. Otherwise it's output for inp2
..."><pre class="notranslate"><code class="notranslate">net.enableAsync(1);
net.setInput(inp1);
out1 = net.forward();
net.setInput(inp2);
out = net.forward(); // out is output for inp1 if out1 is empty. Otherwise it's output for inp2
...
</code></pre></div>
<p dir="auto">This way user should store inputs and pop them by ready outputs (i.e. render detections).</p>
<h5 dir="auto">Prefetch</h5>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="net.enableAsync(1);
net.setInput(inp1);
net.setInput(inp2);
...
out1 = net.forward();
out = net.forward(); // out is output for inp1 if out1 is empty. Otherwise it's output for inp2"><pre class="notranslate"><code class="notranslate">net.enableAsync(1);
net.setInput(inp1);
net.setInput(inp2);
...
out1 = net.forward();
out = net.forward(); // out is output for inp1 if out1 is empty. Otherwise it's output for inp2
</code></pre></div>
<h5 dir="auto">Syncing</h5>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="net.enableAsync(1);
net.setInput(inp1);
out = net.forward(); // assume out is empty here (not ready)
out = net.forward(); // assume out is not ready again
net.enableAsync(0);
out = net.forward(); // wait here until output is ready"><pre class="notranslate"><code class="notranslate">net.enableAsync(1);
net.setInput(inp1);
out = net.forward(); // assume out is empty here (not ready)
out = net.forward(); // assume out is not ready again
net.enableAsync(0);
out = net.forward(); // wait here until output is ready
</code></pre></div>
<p dir="auto">Syncing let users control maximum number of asynchronous requests. In example, if number of fetched inputs equals to specified maximum number of requests, we disable async mode and wait for the output of the first input in queue. Note that it doen't disable asynchronous computations at that time but specifies that next <code class="notranslate">Net::forward</code> invocation should return output.</p>
<h5 dir="auto">Steps to reproduce</h5> | <h5 dir="auto">System information (version)</h5>
<ul dir="auto">
<li>OpenCV => OpenCV online documentation</li>
<li>Operating System / Platform => Not applicable</li>
<li>Compiler => Python</li>
</ul>
<h5 dir="auto">Detailed description</h5>
<p dir="auto">The Python code for Otsu's binarization gven in the online documentation for OpenCV Image Thresholding at<br>
<a href="https://docs.opencv.org/3.4/d7/d4d/tutorial_py_thresholding.html" rel="nofollow">https://docs.opencv.org/3.4/d7/d4d/tutorial_py_thresholding.html</a><br>
requires the following corrections:</p>
<ol dir="auto">
<li>
<p dir="auto">Histogram normalization should be done by dividing by the sum, not max:<br>
hist_norm = hist.ravel()/hist.sum()</p>
</li>
<li>
<p dir="auto">The computation of mean and variances can generate the division-by-zero run-time error when either q1 or q2 is zero. To avoid this, we must include the statement<br>
if q1 < 1.e-6 or q2 < 1.e-6: continue</p>
</li>
</ol>
<h5 dir="auto">Corrected code</h5>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="img = cv.imread('noisy2.png',0)
blur = cv.GaussianBlur(img,(5,5),0)
hist = cv.calcHist([blur],[0],None,[256],[0,256])
hist_norm = hist.ravel()/hist.sum()
Q = hist_norm.cumsum()
bins = np.arange(256)
fn_min = np.inf
thresh = -1
for i in xrange(1,256):
p1,p2 = np.hsplit(hist_norm,[i]) # probabilities
q1,q2 = Q[i],Q[255]-Q[i] # cum sum of classes
if q1 < 1.e-6 or q2 < 1.e-6: continue
b1,b2 = np.hsplit(bins,[i]) # weights
m1,m2 = np.sum(p1*b1)/q1, np.sum(p2*b2)/q2
v1,v2 = np.sum(((b1-m1)**2)*p1)/q1,np.sum(((b2-m2)**2)*p2)/q2
fn = v1*q1 + v2*q2
if fn < fn_min:
fn_min = fn
thresh = i
ret, otsu = cv.threshold(blur,0,255,cv.THRESH_BINARY+cv.THRESH_OTSU)
print( "{} {}".format(thresh,ret) )"><pre class="notranslate"><code class="notranslate">img = cv.imread('noisy2.png',0)
blur = cv.GaussianBlur(img,(5,5),0)
hist = cv.calcHist([blur],[0],None,[256],[0,256])
hist_norm = hist.ravel()/hist.sum()
Q = hist_norm.cumsum()
bins = np.arange(256)
fn_min = np.inf
thresh = -1
for i in xrange(1,256):
p1,p2 = np.hsplit(hist_norm,[i]) # probabilities
q1,q2 = Q[i],Q[255]-Q[i] # cum sum of classes
if q1 < 1.e-6 or q2 < 1.e-6: continue
b1,b2 = np.hsplit(bins,[i]) # weights
m1,m2 = np.sum(p1*b1)/q1, np.sum(p2*b2)/q2
v1,v2 = np.sum(((b1-m1)**2)*p1)/q1,np.sum(((b2-m2)**2)*p2)/q2
fn = v1*q1 + v2*q2
if fn < fn_min:
fn_min = fn
thresh = i
ret, otsu = cv.threshold(blur,0,255,cv.THRESH_BINARY+cv.THRESH_OTSU)
print( "{} {}".format(thresh,ret) )
</code></pre></div> | 0 |
<p dir="auto">by <strong>namegduf</strong>:</p>
<pre class="notranslate">What steps will reproduce the problem?
1. Get a copy of the Go source.
2. Set the appropriate environmental variables for compilation and issue
./all.make
What is the expected output? What do you see instead?
The expected result is a successful compilation with all tests passing. What
I see is, during tests:
--- FAIL: path.TestWalk
1. error expected, none found
node testdata/d/x mark = 2; expected 1
node testdata/d/y mark = 2; expected 1
node testdata/d/z mark = 2; expected 1
node testdata/d/z/u mark = 2; expected 1
node testdata/d/z/v mark = 2; expected 1
FAIL
What is your $GOOS? $GOARCH?
Linux/AMD64.
Which revision are you sync'ed to? (hg log -l 1)
4010:91c471680dc9
Please provide any additional information below.
I was performing this compilation and install as root, in order to install
system wide into /usr/local. This might be related, but should work.</pre> | <p dir="auto">by <strong>orthopteroid</strong>:</p>
<pre class="notranslate">The string replacer appears to have a problem with single replacements that would happen
at the start of a string:
s := "Hello World"
fmt.Println(strings.NewReplacer("Hello","").Replace(s))
fmt.Println(strings.NewReplacer("World","").Replace(s))
Produces:
Hello World
Hello
Which is incorrect. I would expect:
World
Hello
Whereas, when I add another substitution for replacement:
s := "Hello World"
fmt.Println(strings.NewReplacer("Hello","","l","").Replace(s))
fmt.Println(strings.NewReplacer("World","","l","").Replace(s))
Producing a correct result:
Word
Heo
Alternatively, if I perform a single replacement which is not at the start of the string:
s := "Hello World"
fmt.Println(strings.NewReplacer("ello","").Replace(s))
fmt.Println(strings.NewReplacer("orld","").Replace(s))
Produces the correct result:
H World
Hello W
So, the problem appears to be with single substitution when the match is at the start of
the string. I have noticed that strings.NewReplacer tries to handle single substitutions
as a special case... perhaps that code has a problem?
--------------
<a href="http://play.golang.org/p/Hj1V9d8fAj" rel="nofollow">http://play.golang.org/p/Hj1V9d8fAj</a>
go version devel +f4d1cb8d9a91 Thu Sep 19 22:34:33 2013 +1000 linux/386</pre> | 0 |
<p dir="auto"><em>Original ticket <a href="http://projects.scipy.org/scipy/ticket/863" rel="nofollow">http://projects.scipy.org/scipy/ticket/863</a> on 2009-02-01 by <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/nilswagner01/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/nilswagner01">@nilswagner01</a>, assigned to unknown.</em></p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="======================================================================
ERROR: test_add_function_ordered (test_catalog.TestCatalog)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/nwagner/local/lib64/python2.6/site-packages/scipy/weave/tests/test_catalog.py", line 279, in test_add_function_ordered
q.add_function('f',string.upper)
File "/home/nwagner/local/lib64/python2.6/site-packages/scipy/weave/catalog.py", line 653, in add_function
self.add_function_persistent(code,function)
File "/home/nwagner/local/lib64/python2.6/site-packages/scipy/weave/catalog.py", line 688, in add_function_persistent
function_list = function_list + cat.get(code,[])
File "/usr/lib64/python2.6/shelve.py", line 113, in get
if key in self.dict:
File "/home/nwagner/local/lib64/python2.6/site-packages/scipy/io/dumbdbm_patched.py", line 73, in __getitem__
pos, siz = self._index[key] # may raise KeyError
KeyError: 0
======================================================================
ERROR: Test persisting a function in the default catalog
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/nwagner/local/lib64/python2.6/site-packages/scipy/weave/tests/test_catalog.py", line 267, in test_add_function_persistent1
q.add_function_persistent('code',i)
File "/home/nwagner/local/lib64/python2.6/site-packages/scipy/weave/catalog.py", line 688, in add_function_persistent
function_list = function_list + cat.get(code,[])
File "/usr/lib64/python2.6/shelve.py", line 113, in get
if key in self.dict:
File "/home/nwagner/local/lib64/python2.6/site-packages/scipy/io/dumbdbm_patched.py", line 73, in __getitem__
pos, siz = self._index[key] # may raise KeyError
KeyError: 0
======================================================================
ERROR: Shouldn't get a single file from the temp dir.
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/nwagner/local/lib64/python2.6/site-packages/scipy/weave/tests/test_catalog.py", line 195, in test_get_existing_files2
q.add_function('code', os.getpid)
File "/home/nwagner/local/lib64/python2.6/site-packages/scipy/weave/catalog.py", line 653, in add_function
self.add_function_persistent(code,function)
File "/home/nwagner/local/lib64/python2.6/site-packages/scipy/weave/catalog.py", line 688, in add_function_persistent
function_list = function_list + cat.get(code,[])
File "/usr/lib64/python2.6/shelve.py", line 113, in get
if key in self.dict:
File "/home/nwagner/local/lib64/python2.6/site-packages/scipy/io/dumbdbm_patched.py", line 73, in __getitem__
pos, siz = self._index[key] # may raise KeyError
KeyError: 0 "><pre class="notranslate"><code class="notranslate">======================================================================
ERROR: test_add_function_ordered (test_catalog.TestCatalog)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/nwagner/local/lib64/python2.6/site-packages/scipy/weave/tests/test_catalog.py", line 279, in test_add_function_ordered
q.add_function('f',string.upper)
File "/home/nwagner/local/lib64/python2.6/site-packages/scipy/weave/catalog.py", line 653, in add_function
self.add_function_persistent(code,function)
File "/home/nwagner/local/lib64/python2.6/site-packages/scipy/weave/catalog.py", line 688, in add_function_persistent
function_list = function_list + cat.get(code,[])
File "/usr/lib64/python2.6/shelve.py", line 113, in get
if key in self.dict:
File "/home/nwagner/local/lib64/python2.6/site-packages/scipy/io/dumbdbm_patched.py", line 73, in __getitem__
pos, siz = self._index[key] # may raise KeyError
KeyError: 0
======================================================================
ERROR: Test persisting a function in the default catalog
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/nwagner/local/lib64/python2.6/site-packages/scipy/weave/tests/test_catalog.py", line 267, in test_add_function_persistent1
q.add_function_persistent('code',i)
File "/home/nwagner/local/lib64/python2.6/site-packages/scipy/weave/catalog.py", line 688, in add_function_persistent
function_list = function_list + cat.get(code,[])
File "/usr/lib64/python2.6/shelve.py", line 113, in get
if key in self.dict:
File "/home/nwagner/local/lib64/python2.6/site-packages/scipy/io/dumbdbm_patched.py", line 73, in __getitem__
pos, siz = self._index[key] # may raise KeyError
KeyError: 0
======================================================================
ERROR: Shouldn't get a single file from the temp dir.
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/nwagner/local/lib64/python2.6/site-packages/scipy/weave/tests/test_catalog.py", line 195, in test_get_existing_files2
q.add_function('code', os.getpid)
File "/home/nwagner/local/lib64/python2.6/site-packages/scipy/weave/catalog.py", line 653, in add_function
self.add_function_persistent(code,function)
File "/home/nwagner/local/lib64/python2.6/site-packages/scipy/weave/catalog.py", line 688, in add_function_persistent
function_list = function_list + cat.get(code,[])
File "/usr/lib64/python2.6/shelve.py", line 113, in get
if key in self.dict:
File "/home/nwagner/local/lib64/python2.6/site-packages/scipy/io/dumbdbm_patched.py", line 73, in __getitem__
pos, siz = self._index[key] # may raise KeyError
KeyError: 0
</code></pre></div> | <p dir="auto"><em>Original ticket <a href="http://projects.scipy.org/scipy/ticket/855" rel="nofollow">http://projects.scipy.org/scipy/ticket/855</a> on 2009-01-24 by <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/nilswagner01/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/nilswagner01">@nilswagner01</a>, assigned to unknown.</em></p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="======================================================================
ERROR: test_add_function_ordered (test_catalog.TestCatalog)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/nwagner/local/lib64/python2.6/site-packages/scipy/weave/tests/test_catalog.py", line 279, in test_add_function_ordered
q.add_function('f',string.upper)
File "/home/nwagner/local/lib64/python2.6/site-packages/scipy/weave/catalog.py", line 653, in add_function
self.add_function_persistent(code,function)
File "/home/nwagner/local/lib64/python2.6/site-packages/scipy/weave/catalog.py", line 688, in add_function_persistent
function_list = function_list + cat.get(code,[])
File "/usr/lib64/python2.6/shelve.py", line 113, in get
if key in self.dict:
File "/home/nwagner/local/lib64/python2.6/site-packages/scipy/io/dumbdbm_patched.py", line 73, in __getitem__
pos, siz = self._index[key] # may raise KeyError
KeyError: 0
======================================================================
ERROR: Test persisting a function in the default catalog
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/nwagner/local/lib64/python2.6/site-packages/scipy/weave/tests/test_catalog.py", line 267, in test_add_function_persistent1
q.add_function_persistent('code',i)
File "/home/nwagner/local/lib64/python2.6/site-packages/scipy/weave/catalog.py", line 688, in add_function_persistent
function_list = function_list + cat.get(code,[])
File "/usr/lib64/python2.6/shelve.py", line 113, in get
if key in self.dict:
File "/home/nwagner/local/lib64/python2.6/site-packages/scipy/io/dumbdbm_patched.py", line 73, in __getitem__
pos, siz = self._index[key] # may raise KeyError
KeyError: 0
======================================================================
ERROR: Shouldn't get a single file from the temp dir.
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/nwagner/local/lib64/python2.6/site-packages/scipy/weave/tests/test_catalog.py", line 195, in test_get_existing_files2
q.add_function('code', os.getpid)
File "/home/nwagner/local/lib64/python2.6/site-packages/scipy/weave/catalog.py", line 653, in add_function
self.add_function_persistent(code,function)
File "/home/nwagner/local/lib64/python2.6/site-packages/scipy/weave/catalog.py", line 688, in add_function_persistent
function_list = function_list + cat.get(code,[])
File "/usr/lib64/python2.6/shelve.py", line 113, in get
if key in self.dict:
File "/home/nwagner/local/lib64/python2.6/site-packages/scipy/io/dumbdbm_patched.py", line 73, in __getitem__
pos, siz = self._index[key] # may raise KeyError
KeyError: 0 "><pre class="notranslate"><code class="notranslate">======================================================================
ERROR: test_add_function_ordered (test_catalog.TestCatalog)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/nwagner/local/lib64/python2.6/site-packages/scipy/weave/tests/test_catalog.py", line 279, in test_add_function_ordered
q.add_function('f',string.upper)
File "/home/nwagner/local/lib64/python2.6/site-packages/scipy/weave/catalog.py", line 653, in add_function
self.add_function_persistent(code,function)
File "/home/nwagner/local/lib64/python2.6/site-packages/scipy/weave/catalog.py", line 688, in add_function_persistent
function_list = function_list + cat.get(code,[])
File "/usr/lib64/python2.6/shelve.py", line 113, in get
if key in self.dict:
File "/home/nwagner/local/lib64/python2.6/site-packages/scipy/io/dumbdbm_patched.py", line 73, in __getitem__
pos, siz = self._index[key] # may raise KeyError
KeyError: 0
======================================================================
ERROR: Test persisting a function in the default catalog
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/nwagner/local/lib64/python2.6/site-packages/scipy/weave/tests/test_catalog.py", line 267, in test_add_function_persistent1
q.add_function_persistent('code',i)
File "/home/nwagner/local/lib64/python2.6/site-packages/scipy/weave/catalog.py", line 688, in add_function_persistent
function_list = function_list + cat.get(code,[])
File "/usr/lib64/python2.6/shelve.py", line 113, in get
if key in self.dict:
File "/home/nwagner/local/lib64/python2.6/site-packages/scipy/io/dumbdbm_patched.py", line 73, in __getitem__
pos, siz = self._index[key] # may raise KeyError
KeyError: 0
======================================================================
ERROR: Shouldn't get a single file from the temp dir.
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/nwagner/local/lib64/python2.6/site-packages/scipy/weave/tests/test_catalog.py", line 195, in test_get_existing_files2
q.add_function('code', os.getpid)
File "/home/nwagner/local/lib64/python2.6/site-packages/scipy/weave/catalog.py", line 653, in add_function
self.add_function_persistent(code,function)
File "/home/nwagner/local/lib64/python2.6/site-packages/scipy/weave/catalog.py", line 688, in add_function_persistent
function_list = function_list + cat.get(code,[])
File "/usr/lib64/python2.6/shelve.py", line 113, in get
if key in self.dict:
File "/home/nwagner/local/lib64/python2.6/site-packages/scipy/io/dumbdbm_patched.py", line 73, in __getitem__
pos, siz = self._index[key] # may raise KeyError
KeyError: 0
</code></pre></div> | 1 |
<p dir="auto">This is on master and a recent build of the release-0.3 branch.</p>
<p dir="auto">If there are duplicates in the indexes, <code class="notranslate">sparsevec</code> creates a matrix as advertised, and values with duplicate indexes are added by default.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="julia> sv = sparsevec([1,1,2,3,4], ones(5))
4x1 sparse matrix with 4 Float64 entries:
[1, 1] = 2.0
[2, 1] = 1.0
[3, 1] = 1.0
[4, 1] = 1.0"><pre lang="jlcon" class="notranslate"><code class="notranslate">julia> sv = sparsevec([1,1,2,3,4], ones(5))
4x1 sparse matrix with 4 Float64 entries:
[1, 1] = 2.0
[2, 1] = 1.0
[3, 1] = 1.0
[4, 1] = 1.0
</code></pre></div>
<p dir="auto">But the <code class="notranslate">rowval</code> and <code class="notranslate">nvval</code> fields sometimes but not always have extra values.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="julia> sv.rowval
5-element Array{Int64,1}:
1
2
3
4
4"><pre lang="jlcon" class="notranslate"><code class="notranslate">julia> sv.rowval
5-element Array{Int64,1}:
1
2
3
4
4
</code></pre></div>
<p dir="auto">I'm not sure that this is actually a bug, because it seems <a href="https://github.com/JuliaLang/julia/blob/215249d7365c302eff312239615d21657c4d07df/base/sparse/sparsematrix.jl#L274-L279">intentional</a>, but this causes hcat not to work:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="julia> [sv sv]
ERROR: DimensionMismatch("tried to assign 5 elements to 4 destinations")
in throw_setindex_mismatch at operators.jl:233
in setindex! at array.jl:330
in hcat at sparse/sparsematrix.jl:1802"><pre lang="jlcon" class="notranslate"><code class="notranslate">julia> [sv sv]
ERROR: DimensionMismatch("tried to assign 5 elements to 4 destinations")
in throw_setindex_mismatch at operators.jl:233
in setindex! at array.jl:330
in hcat at sparse/sparsematrix.jl:1802
</code></pre></div>
<p dir="auto">Using <code class="notranslate">sparse([1,1,2,3,4], ones(Int, 5), ones(5))</code> instead of <code class="notranslate">sparsevec</code> does not cause this issue.</p> | <p dir="auto">hi All,<br>
I am attempting to compile Julia as per instructions but receiving the following message at the end of the compilation</p>
<p dir="auto">make[4]: *** [dgemm_kernel_HASWELL.o] Error 1<br>
make[4]: *** Waiting for unfinished jobs....<br>
make[3]: *** [libs] Error 1<br>
*** Clean the OpenBLAS build with 'make -C deps clean-openblas'. Rebuild with 'make OPENBLAS_USE_THREAD=0 if OpenBLAS had trouble linking libpthread.so, and with 'make OPENBLAS_TARGET_ARCH=NEHALEM' if there were errors building SandyBridge support. Both these options can also be used simultaneously. ***<br>
make[2]: *** [openblas-v0.2.10.rc2/libopenblas.so] Error 1<br>
make[1]: *** [julia-release] Error 2<br>
make: *** [release] Error 2</p>
<p dir="auto">Could anyone help shed some light as to what the problem is please.</p>
<p dir="auto">For Info - the OS is centos 6.5</p>
<p dir="auto">Thanks</p>
<p dir="auto">Peter</p> | 0 |
<p dir="auto">When attempting to play Borderlands 3 the game will keep minimising itself instead of starting. Took a little while to realise that exiting PowerTools returned the correct functionality.</p>
<h1 dir="auto">Environment</h1>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Windows build number: 10.0.17763.805
PowerToys version: Original version (will load latest tonight and try again came to report and found new version)
PowerToy module for which you are reporting the bug (if applicable): FancyZones (I suspect)"><pre class="notranslate"><code class="notranslate">Windows build number: 10.0.17763.805
PowerToys version: Original version (will load latest tonight and try again came to report and found new version)
PowerToy module for which you are reporting the bug (if applicable): FancyZones (I suspect)
</code></pre></div>
<h1 dir="auto">Steps to reproduce</h1>
<p dir="auto">Run Borderlands 3 with PowerTools running in the system tray.</p>
<h1 dir="auto">Expected behavior</h1>
<p dir="auto">Borderlands runs full screen.</p>
<h1 dir="auto">Actual behavior</h1>
<p dir="auto">Borderlands keeps disappearing back to a minimised icon on the task bar.</p> | <h2 dir="auto"><g-emoji class="g-emoji" alias="memo" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/1f4dd.png">📝</g-emoji> Provide a description of the new feature</h2>
<p dir="auto">I would like to see the ability to add a Prefix/Suffix to file names, without the need to subistute anything</p>
<hr>
<p dir="auto">If you'd like to see this feature implemented, add a 👍 reaction to this post.</p> | 0 |
<h2 dir="auto">Steps to Reproduce</h2>
<p dir="auto">I write a demo for display 51 image widget in ListView Widget, the image resource are from CDN server, after all the images are showing, the application use 360+M memory, see the picture down there<br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/23513781/33362827-ee4c640c-d518-11e7-9811-0aed5bed9a39.png"><img width="1177" alt="memory-flutter" src="https://user-images.githubusercontent.com/23513781/33362827-ee4c640c-d518-11e7-9811-0aed5bed9a39.png" style="max-width: 100%;"></a></p>
<p dir="auto">all the images's size are only 200+ KB far less than 1MB, the image resource urls is in the file ImagesSource.dart.txt<br>
<a href="https://github.com/flutter/flutter/files/1512844/ImagesSource.dart.txt">ImagesSource.dart.txt</a></p>
<p dir="auto">and my flutter project code in main.dart.txt<br>
<a href="https://github.com/flutter/flutter/files/1512852/main.dart.txt">main.dart.txt</a></p>
<p dir="auto">Also I write a compare demo by iOS native display the same image resources , iOS native just use 70M memory, why the flutter use much bigger memory than iOS native?</p>
<p dir="auto">and, there also anther problem, in my flutter demo, when click the image widget, the home page will rebuild by calling the setState() function, and the page State build() return a Text Widget instead the ListView widget before, I think the memory will diminish, but the memory keep the same, I try force gc but no effect, how the dart gc work?</p>
<h2 dir="auto">Logs</h2>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/23513781/33365028-ce63bd6c-d521-11e7-81d3-0403788bcfaa.png"><img src="https://user-images.githubusercontent.com/23513781/33365028-ce63bd6c-d521-11e7-81d3-0403788bcfaa.png" alt="flutterrun" style="max-width: 100%;"></a></p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/23513781/33365061-ee3f6154-d521-11e7-8b29-d1b464a129ed.png"><img src="https://user-images.githubusercontent.com/23513781/33365061-ee3f6154-d521-11e7-8b29-d1b464a129ed.png" alt="memoryobseray" style="max-width: 100%;"></a></p>
<h2 dir="auto">Flutter Doctor</h2>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="/Users/chaokong/flutterSDK/bin/flutter --no-color doctor
[✓] Flutter (on Mac OS X 10.12.6 16G1036, locale zh-Hans-CN, channel master)
• Flutter at /Users/chaokong/flutterSDK
• Framework revision bdbe53be01 (4 days ago), 2017-11-24 19:13:18 -0800
• Engine revision 93b2179597
• Tools Dart version 1.25.0-dev.11.0
[✓] Android toolchain - develop for Android devices (Android SDK 26.0.2)
• Android SDK at /Users/chaokong/Library/Android/sdk
• Unable to locate Android NDK.
• Unable to locate compiler in Android NDK.
• Platform android-26, build-tools 26.0.2
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-915-b08)
[✓] iOS toolchain - develop for iOS devices (Xcode 9.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 9.1, Build version 9B55
• ios-deploy 1.9.2
• CocoaPods version 1.1.1
[✓] Android Studio (version 3.0)
• Android Studio at /Applications/Android Studio.app/Contents
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-915-b08)
[✓] IntelliJ IDEA Community Edition (version 2017.2.6)
• Flutter plugin version 19.1
• Dart plugin version 172.4343.25
[✓] Connected devices
• 张伟平的 iPhone • fb87fda18a77f01197d25047bed12a782b21e01f • ios • iOS 11.1
• iPhone X • C598742A-2903-4BE8-A6FF-4168FC8DD581 • ios • iOS 11.1 (simulator)
Process finished with exit code 0"><pre class="notranslate"><code class="notranslate">/Users/chaokong/flutterSDK/bin/flutter --no-color doctor
[✓] Flutter (on Mac OS X 10.12.6 16G1036, locale zh-Hans-CN, channel master)
• Flutter at /Users/chaokong/flutterSDK
• Framework revision bdbe53be01 (4 days ago), 2017-11-24 19:13:18 -0800
• Engine revision 93b2179597
• Tools Dart version 1.25.0-dev.11.0
[✓] Android toolchain - develop for Android devices (Android SDK 26.0.2)
• Android SDK at /Users/chaokong/Library/Android/sdk
• Unable to locate Android NDK.
• Unable to locate compiler in Android NDK.
• Platform android-26, build-tools 26.0.2
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-915-b08)
[✓] iOS toolchain - develop for iOS devices (Xcode 9.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 9.1, Build version 9B55
• ios-deploy 1.9.2
• CocoaPods version 1.1.1
[✓] Android Studio (version 3.0)
• Android Studio at /Applications/Android Studio.app/Contents
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-915-b08)
[✓] IntelliJ IDEA Community Edition (version 2017.2.6)
• Flutter plugin version 19.1
• Dart plugin version 172.4343.25
[✓] Connected devices
• 张伟平的 iPhone • fb87fda18a77f01197d25047bed12a782b21e01f • ios • iOS 11.1
• iPhone X • C598742A-2903-4BE8-A6FF-4168FC8DD581 • ios • iOS 11.1 (simulator)
Process finished with exit code 0
</code></pre></div> | <p dir="auto">So I created a custom class and I'm trying to build it with data from Firebase.</p>
<p dir="auto">I get a Map from firebase and tease it apart with .map() and returning Lists instances of class SocialLink (working merely as a struct).</p>
<p dir="auto">here's the code</p>
<div class="highlight highlight-source-dart notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="void onProjectValue(void callback(List<Project> projects)){
this.dbRef.child('threads').limitToLast(40).onValue.listen((Event event){
List<Project> projects = [];
Map result = event.snapshot.value;
result.forEach((id, projectData){
projects.add(
new Project(
id: int.parse(id),
title: projectData['thread-scrape']['subject'],
iconUrl: 'http://192.168.1.120:8080/services/twitter.png',
tags: projectData['thread-scrape']['tags'].values.map<String>( (value){
return '$value';
}).toList(), // does this work? yes
links: projectData['links-scrape'].entries.map<SocialLink>( (entry)=>
SocialLink(
iconUrl: this.socialUrls[entry.key],
linkUrl: entry.value
)).toList(), // does this work? no!
views: projectData['thread-scrape']['views']
)
);
});
return callback(projects);
});
}"><pre class="notranslate"><span class="pl-k">void</span> <span class="pl-en">onProjectValue</span>(<span class="pl-k">void</span> <span class="pl-en">callback</span>(<span class="pl-c1">List</span><<span class="pl-c1">Project</span>> projects)){
<span class="pl-c1">this</span>.dbRef.<span class="pl-en">child</span>(<span class="pl-s">'threads'</span>).<span class="pl-en">limitToLast</span>(<span class="pl-c1">40</span>).onValue.<span class="pl-en">listen</span>((<span class="pl-c1">Event</span> event){
<span class="pl-c1">List</span><<span class="pl-c1">Project</span>> projects <span class="pl-k">=</span> [];
<span class="pl-c1">Map</span> result <span class="pl-k">=</span> event.snapshot.value;
result.<span class="pl-en">forEach</span>((id, projectData){
projects.<span class="pl-en">add</span>(
<span class="pl-k">new</span> <span class="pl-c1">Project</span>(
id<span class="pl-k">:</span> <span class="pl-c1">int</span>.<span class="pl-en">parse</span>(id),
title<span class="pl-k">:</span> projectData[<span class="pl-s">'thread-scrape'</span>][<span class="pl-s">'subject'</span>],
iconUrl<span class="pl-k">:</span> <span class="pl-s">'http://192.168.1.120:8080/services/twitter.png'</span>,
tags<span class="pl-k">:</span> projectData[<span class="pl-s">'thread-scrape'</span>][<span class="pl-s">'tags'</span>].values.<span class="pl-en">map</span><<span class="pl-c1">String</span>>( (value){
<span class="pl-k">return</span> <span class="pl-s">'$<span class="pl-v">value</span>'</span>;
}).<span class="pl-en">toList</span>(), <span class="pl-c">// does this work? yes</span>
links<span class="pl-k">:</span> projectData[<span class="pl-s">'links-scrape'</span>].entries.<span class="pl-en">map</span><<span class="pl-c1">SocialLink</span>>( (entry)<span class="pl-k">=></span>
<span class="pl-c1">SocialLink</span>(
iconUrl<span class="pl-k">:</span> <span class="pl-c1">this</span>.socialUrls[entry.key],
linkUrl<span class="pl-k">:</span> entry.value
)).<span class="pl-en">toList</span>(), <span class="pl-c">// does this work? no!</span>
views<span class="pl-k">:</span> projectData[<span class="pl-s">'thread-scrape'</span>][<span class="pl-s">'views'</span>]
)
);
});
<span class="pl-k">return</span> <span class="pl-en">callback</span>(projects);
});
}</pre></div>
<p dir="auto">Problem is I get this error (stack trace)</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Launching lib/main.dart on iPhone X in debug mode...
Xcode build done.
CADisplay.name = LCD;
CADisplay.deviceName = PurpleMain;
CADisplay.seed = 1;
tags = 0;
currentMode = <FBSDisplayMode: 0x60c000097700; 375x812@3x (1125x2436/3) 60Hz p3 SDR>;
safeOverscanRatio = {0.89999997615814209, 0.89999997615814209};
nativeCenter = {562.5, 1218};
pixelSize = {1125, 2436};
bounds = {{0, 0}, {375, 812}};
CADisplay = <CADisplay:LCD PurpleMain>;
}
5.4.0 - [Firebase/Analytics][I-ACS023007] Firebase Analytics v.50001000 started
5.4.0 - [Firebase/Analytics][I-ACS023008] To enable debug logging set the following application argument: -FIRAnalyticsDebugEnabled (see http://goo.gl/RfcP7r)
[1.1 69498871-3F7C-4F0A-AFCD-4581EDF0C1ED 192.168.1.120.58897<->172.217.3.106:443]
Connected Path: satisfied (Path is satisfied), interface: en1
Duration: 0.281s, DNS @0.001s took 0.040s, TCP @0.043s took 0.044s, TLS took 0.114s
bytes in/out: 3579/1061, packets in/out: 9/10, rtt: 0.043s, retransmitted packets: 0, out-of-order packets: 0
5.4.0 - [Firebase/Core][I-COR000004] App with name when-coin-test does not exist.
[2.1 32DB1D89-B138-4B98-A6D9-B68CC8652D59 192.168.1.120.58905<->172.217.12.138:443]
Connected Path: satisfied (Path is satisfied), interface: en1
Duration: 0.270s, DNS @0.000s took 0.018s, TCP @0.024s took 0.049s, TLS took 0.129s
bytes in/out: 3337/1061, packets in/out: 9/10, rtt: 0.046s, retransmitted packets: 0, out-of-order packets: 0
flutter: connected!
flutter: {Telegram: https://firebasestorage.googleapis.com/v0/b/when-coin-test.appspot.com/o/img%2Ftelegram.png?alt=media&token=dbbd043f-05db-45ca-b00d-50edfe763f95, Medium: https://firebasestorage.googleapis.com/v0/b/when-coin-test.appspot.com/o/img%2Fmedium.png?alt=media&token=15267fc3-f112-4fa1-9e6c-facbe787e68d, YouTube: https://firebasestorage.googleapis.com/v0/b/when-coin-test.appspot.com/o/img%2Fyoutube.png?alt=media&token=4de33db4-ec85-47d0-9a9e-952479bdb761, GitHub: https://firebasestorage.googleapis.com/v0/b/when-coin-test.appspot.com/o/img%2Fgithub.png?alt=media&token=403440df-65e3-4c1b-8ac8-a8bed7ea2f4c, Steemit: https://firebasestorage.googleapis.com/v0/b/when-coin-test.appspot.com/o/img%2Fsteemit.png?alt=media&token=308f7f2d-0120-454d-b2f7-415d13f57106, Slack: https://firebasestorage.googleapis.com/v0/b/when-coin-test.appspot.com/o/img%2Fslack.png?alt=media&token=6dfa1b2b-33a5-4820-a167-05d25e9c743a, Facebook: https://firebasestorage.googleapis.com/v0/b/when-coin-test.appspot.com/<…>
compiler message: Unhandled exception:
compiler message: NoSuchMethodError: The getter 'className' was called on null.
compiler message: Receiver: null
compiler message: Tried calling: className
compiler message: #0 Object.noSuchMethod (dart:core/runtime/libobject_patch.dart:46:5)
compiler message: #1 serializeProcedure (package:front_end/src/fasta/kernel/utils.dart:82:29)
compiler message: #2 FrontendCompiler.compileExpression (package:vm/frontend_server.dart:452:16)
compiler message: <asynchronous suspension>
compiler message: #3 _FlutterFrontendCompiler.compileExpression (package:frontend_server/server.dart:55:22)
compiler message: #4 listenAndCompile.<anonymous closure> (package:vm/frontend_server.dart:650:20)
compiler message: <asynchronous suspension>
compiler message: #5 _RootZone.runUnaryGuarded (dart:async/zone.dart:1316:10)
compiler message: #6 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:336:11)
compiler message: #7 _BufferingStreamSubscription._add (dart:async/stream_impl.dart:263:7)
compiler message: #8 _SinkTransformerStreamSubscription._add (dart:async/stream_transformers.dart:68:11)
compiler message: #9 _EventSinkWrapper.add (dart:async/stream_transformers.dart:15:11)
compiler message: #10 _StringAdapterSink.add (dart:convert/string_conversion.dart:268:11)
compiler message: #11 _LineSplitterSink._addLines (dart:convert/line_splitter.dart:154:13)
compiler message: #12 _LineSplitterSink.addSlice (dart:convert/line_splitter.dart:129:5)
compiler message: #13 StringConversionSinkMixin.add (dart:convert/string_conversion.dart:189:5)
compiler message: #14 _SinkTransformerStreamSubscription._handleData (dart:async/stream_transformers.dart:120:24)
compiler message: #15 _RootZone.runUnaryGuarded (dart:async/zone.dart:1316:10)
compiler message: #16 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:336:11)
compiler message: #17 _BufferingStreamSubscription._add (dart:async/stream_impl.dart:263:7)
compiler message: #18 _SinkTransformerStreamSubscription._add (dart:async/stream_transformers.dart:68:11)
compiler message: #19 _EventSinkWrapper.add (dart:async/stream_transformers.dart:15:11)
compiler message: #20 _StringAdapterSink.add (dart:convert/string_conversion.dart:268:11)
compiler message: #21 _StringAdapterSink.addSlice (dart:convert/string_conversion.dart:273:7)
compiler message: #22 _Utf8ConversionSink.addSlice (dart:convert/string_conversion.dart:348:20)
compiler message: #23 _Utf8ConversionSink.add (dart:convert/string_conversion.dart:341:5)
compiler message: #24 _ConverterStreamEventSink.add (dart:convert/chunked_conversion.dart:86:18)
compiler message: #25 _SinkTransformerStreamSubscription._handleData (dart:async/stream_transformers.dart:120:24)
compiler message: #26 _RootZone.runUnaryGuarded (dart:async/zone.dart:1316:10)
compiler message: #27 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:336:11)
compiler message: #28 _BufferingStreamSubscription._add (dart:async/stream_impl.dart:263:7)
compiler message: #29 _SyncStreamController._sendData (dart:async/stream_controller.dart:763:19)
compiler message: #30 _StreamController._add (dart:async/stream_controller.dart:639:7)
compiler message: #31 _StreamController.add (dart:async/stream_controller.dart:585:5)
compiler message: #32 _Socket._onData (dart:io/runtime/binsocket_patch.dart:1714:41)
compiler message: #33 _RootZone.runUnaryGuarded (dart:async/zone.dart:1316:10)
compiler message: #34 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:336:11)
compiler message: #35 _BufferingStreamSubscription._add (dart:async/stream_impl.dart:263:7)
compiler message: #36 _SyncStreamController._sendData (dart:async/stream_controller.dart:763:19)
compiler message: #37 _StreamController._add (dart:async/stream_controller.dart:639:7)
compiler message: #38 _StreamController.add (dart:async/stream_controller.dart:585:5)
compiler message: #39 new _RawSocket.<anonymous closure> (dart:io/runtime/binsocket_patch.dart:1276:33)
compiler message: #40 _NativeSocket.issueReadEvent.issue (dart:io/runtime/binsocket_patch.dart:819:14)
compiler message: #41 _microtaskLoop (dart:async/schedule_microtask.dart:41:21)
compiler message: #42 _startMicrotaskLoop (dart:async/schedule_microtask.dart:50:5)
compiler message: #43 _runPendingImmediateCallback (dart:isolate/runtime/libisolate_patch.dart:113:13)
compiler message: #44 _RawReceivePortImpl._handleMessage (dart:isolate/runtime/libisolate_patch.dart:166:5)
Unhandled exception:
SocketException: Write failed (OS Error: Broken pipe, errno = 32), port = 0
#0 _rootHandleUncaughtError.<anonymous closure> (dart:async/zone.dart:1114:29)
#1 _microtaskLoop (dart:async/schedule_microtask.dart:41:21)
#2 _startMicrotaskLoop (dart:async/schedule_microtask.dart:50:5)
#3 _runPendingImmediateCallback (dart:isolate/runtime/libisolate_patch.dart:113:13)
#4 _RawReceivePortImpl._handleMessage (dart:isolate/runtime/libisolate_patch.dart:166:5)
Exited (255)"><pre class="notranslate"><code class="notranslate">Launching lib/main.dart on iPhone X in debug mode...
Xcode build done.
CADisplay.name = LCD;
CADisplay.deviceName = PurpleMain;
CADisplay.seed = 1;
tags = 0;
currentMode = <FBSDisplayMode: 0x60c000097700; 375x812@3x (1125x2436/3) 60Hz p3 SDR>;
safeOverscanRatio = {0.89999997615814209, 0.89999997615814209};
nativeCenter = {562.5, 1218};
pixelSize = {1125, 2436};
bounds = {{0, 0}, {375, 812}};
CADisplay = <CADisplay:LCD PurpleMain>;
}
5.4.0 - [Firebase/Analytics][I-ACS023007] Firebase Analytics v.50001000 started
5.4.0 - [Firebase/Analytics][I-ACS023008] To enable debug logging set the following application argument: -FIRAnalyticsDebugEnabled (see http://goo.gl/RfcP7r)
[1.1 69498871-3F7C-4F0A-AFCD-4581EDF0C1ED 192.168.1.120.58897<->172.217.3.106:443]
Connected Path: satisfied (Path is satisfied), interface: en1
Duration: 0.281s, DNS @0.001s took 0.040s, TCP @0.043s took 0.044s, TLS took 0.114s
bytes in/out: 3579/1061, packets in/out: 9/10, rtt: 0.043s, retransmitted packets: 0, out-of-order packets: 0
5.4.0 - [Firebase/Core][I-COR000004] App with name when-coin-test does not exist.
[2.1 32DB1D89-B138-4B98-A6D9-B68CC8652D59 192.168.1.120.58905<->172.217.12.138:443]
Connected Path: satisfied (Path is satisfied), interface: en1
Duration: 0.270s, DNS @0.000s took 0.018s, TCP @0.024s took 0.049s, TLS took 0.129s
bytes in/out: 3337/1061, packets in/out: 9/10, rtt: 0.046s, retransmitted packets: 0, out-of-order packets: 0
flutter: connected!
flutter: {Telegram: https://firebasestorage.googleapis.com/v0/b/when-coin-test.appspot.com/o/img%2Ftelegram.png?alt=media&token=dbbd043f-05db-45ca-b00d-50edfe763f95, Medium: https://firebasestorage.googleapis.com/v0/b/when-coin-test.appspot.com/o/img%2Fmedium.png?alt=media&token=15267fc3-f112-4fa1-9e6c-facbe787e68d, YouTube: https://firebasestorage.googleapis.com/v0/b/when-coin-test.appspot.com/o/img%2Fyoutube.png?alt=media&token=4de33db4-ec85-47d0-9a9e-952479bdb761, GitHub: https://firebasestorage.googleapis.com/v0/b/when-coin-test.appspot.com/o/img%2Fgithub.png?alt=media&token=403440df-65e3-4c1b-8ac8-a8bed7ea2f4c, Steemit: https://firebasestorage.googleapis.com/v0/b/when-coin-test.appspot.com/o/img%2Fsteemit.png?alt=media&token=308f7f2d-0120-454d-b2f7-415d13f57106, Slack: https://firebasestorage.googleapis.com/v0/b/when-coin-test.appspot.com/o/img%2Fslack.png?alt=media&token=6dfa1b2b-33a5-4820-a167-05d25e9c743a, Facebook: https://firebasestorage.googleapis.com/v0/b/when-coin-test.appspot.com/<…>
compiler message: Unhandled exception:
compiler message: NoSuchMethodError: The getter 'className' was called on null.
compiler message: Receiver: null
compiler message: Tried calling: className
compiler message: #0 Object.noSuchMethod (dart:core/runtime/libobject_patch.dart:46:5)
compiler message: #1 serializeProcedure (package:front_end/src/fasta/kernel/utils.dart:82:29)
compiler message: #2 FrontendCompiler.compileExpression (package:vm/frontend_server.dart:452:16)
compiler message: <asynchronous suspension>
compiler message: #3 _FlutterFrontendCompiler.compileExpression (package:frontend_server/server.dart:55:22)
compiler message: #4 listenAndCompile.<anonymous closure> (package:vm/frontend_server.dart:650:20)
compiler message: <asynchronous suspension>
compiler message: #5 _RootZone.runUnaryGuarded (dart:async/zone.dart:1316:10)
compiler message: #6 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:336:11)
compiler message: #7 _BufferingStreamSubscription._add (dart:async/stream_impl.dart:263:7)
compiler message: #8 _SinkTransformerStreamSubscription._add (dart:async/stream_transformers.dart:68:11)
compiler message: #9 _EventSinkWrapper.add (dart:async/stream_transformers.dart:15:11)
compiler message: #10 _StringAdapterSink.add (dart:convert/string_conversion.dart:268:11)
compiler message: #11 _LineSplitterSink._addLines (dart:convert/line_splitter.dart:154:13)
compiler message: #12 _LineSplitterSink.addSlice (dart:convert/line_splitter.dart:129:5)
compiler message: #13 StringConversionSinkMixin.add (dart:convert/string_conversion.dart:189:5)
compiler message: #14 _SinkTransformerStreamSubscription._handleData (dart:async/stream_transformers.dart:120:24)
compiler message: #15 _RootZone.runUnaryGuarded (dart:async/zone.dart:1316:10)
compiler message: #16 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:336:11)
compiler message: #17 _BufferingStreamSubscription._add (dart:async/stream_impl.dart:263:7)
compiler message: #18 _SinkTransformerStreamSubscription._add (dart:async/stream_transformers.dart:68:11)
compiler message: #19 _EventSinkWrapper.add (dart:async/stream_transformers.dart:15:11)
compiler message: #20 _StringAdapterSink.add (dart:convert/string_conversion.dart:268:11)
compiler message: #21 _StringAdapterSink.addSlice (dart:convert/string_conversion.dart:273:7)
compiler message: #22 _Utf8ConversionSink.addSlice (dart:convert/string_conversion.dart:348:20)
compiler message: #23 _Utf8ConversionSink.add (dart:convert/string_conversion.dart:341:5)
compiler message: #24 _ConverterStreamEventSink.add (dart:convert/chunked_conversion.dart:86:18)
compiler message: #25 _SinkTransformerStreamSubscription._handleData (dart:async/stream_transformers.dart:120:24)
compiler message: #26 _RootZone.runUnaryGuarded (dart:async/zone.dart:1316:10)
compiler message: #27 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:336:11)
compiler message: #28 _BufferingStreamSubscription._add (dart:async/stream_impl.dart:263:7)
compiler message: #29 _SyncStreamController._sendData (dart:async/stream_controller.dart:763:19)
compiler message: #30 _StreamController._add (dart:async/stream_controller.dart:639:7)
compiler message: #31 _StreamController.add (dart:async/stream_controller.dart:585:5)
compiler message: #32 _Socket._onData (dart:io/runtime/binsocket_patch.dart:1714:41)
compiler message: #33 _RootZone.runUnaryGuarded (dart:async/zone.dart:1316:10)
compiler message: #34 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:336:11)
compiler message: #35 _BufferingStreamSubscription._add (dart:async/stream_impl.dart:263:7)
compiler message: #36 _SyncStreamController._sendData (dart:async/stream_controller.dart:763:19)
compiler message: #37 _StreamController._add (dart:async/stream_controller.dart:639:7)
compiler message: #38 _StreamController.add (dart:async/stream_controller.dart:585:5)
compiler message: #39 new _RawSocket.<anonymous closure> (dart:io/runtime/binsocket_patch.dart:1276:33)
compiler message: #40 _NativeSocket.issueReadEvent.issue (dart:io/runtime/binsocket_patch.dart:819:14)
compiler message: #41 _microtaskLoop (dart:async/schedule_microtask.dart:41:21)
compiler message: #42 _startMicrotaskLoop (dart:async/schedule_microtask.dart:50:5)
compiler message: #43 _runPendingImmediateCallback (dart:isolate/runtime/libisolate_patch.dart:113:13)
compiler message: #44 _RawReceivePortImpl._handleMessage (dart:isolate/runtime/libisolate_patch.dart:166:5)
Unhandled exception:
SocketException: Write failed (OS Error: Broken pipe, errno = 32), port = 0
#0 _rootHandleUncaughtError.<anonymous closure> (dart:async/zone.dart:1114:29)
#1 _microtaskLoop (dart:async/schedule_microtask.dart:41:21)
#2 _startMicrotaskLoop (dart:async/schedule_microtask.dart:50:5)
#3 _runPendingImmediateCallback (dart:isolate/runtime/libisolate_patch.dart:113:13)
#4 _RawReceivePortImpl._handleMessage (dart:isolate/runtime/libisolate_patch.dart:166:5)
Exited (255)
</code></pre></div> | 0 |
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have searched the <a href="https://github.com/apache/incubator-dubbo/issues">issues</a> of this repository and believe that this is not a duplicate.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have checked the <a href="https://github.com/apache/incubator-dubbo/blob/master/FAQ.md">FAQ</a> of this repository and believe that this is not a duplicate.</li>
</ul>
<h3 dir="auto">Environment</h3>
<ul dir="auto">
<li>Dubbo version: 2.7.2-SNAPSHOT</li>
<li>Operating System version: windows1</li>
<li>Java version: 1.8</li>
</ul>
<h3 dir="auto">Steps to reproduce this issue</h3>
<div class="highlight highlight-source-java notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="public class RedisMetadataReport extends AbstractMetadataReport {
private final static Logger logger = LoggerFactory.getLogger(RedisMetadataReport.class);
final JedisPool pool;
public RedisMetadataReport(URL url) {
super(url);
pool = new JedisPool(new JedisPoolConfig(), url.getHost(), url.getPort());
}
}"><pre class="notranslate"><span class="pl-k">public</span> <span class="pl-k">class</span> <span class="pl-smi">RedisMetadataReport</span> <span class="pl-k">extends</span> <span class="pl-smi">AbstractMetadataReport</span> {
<span class="pl-k">private</span> <span class="pl-k">final</span> <span class="pl-k">static</span> <span class="pl-smi">Logger</span> <span class="pl-s1">logger</span> = <span class="pl-smi">LoggerFactory</span>.<span class="pl-en">getLogger</span>(<span class="pl-smi">RedisMetadataReport</span>.<span class="pl-k">class</span>);
<span class="pl-k">final</span> <span class="pl-smi">JedisPool</span> <span class="pl-s1">pool</span>;
<span class="pl-k">public</span> <span class="pl-smi">RedisMetadataReport</span>(<span class="pl-smi">URL</span> <span class="pl-s1">url</span>) {
<span class="pl-en">super</span>(<span class="pl-s1">url</span>);
<span class="pl-s1">pool</span> = <span class="pl-k">new</span> <span class="pl-smi">JedisPool</span>(<span class="pl-k">new</span> <span class="pl-smi">JedisPoolConfig</span>(), <span class="pl-s1">url</span>.<span class="pl-en">getHost</span>(), <span class="pl-s1">url</span>.<span class="pl-en">getPort</span>());
}
}</pre></div>
<p dir="auto">I see the construct method used <code class="notranslate">JedisPool</code>,<br>
<strong>if cluster ,how should do?</strong></p> | <ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have searched the <a href="https://github.com/apache/dubbo/issues">issues</a> of this repository and believe that this is not a duplicate.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have checked the <a href="https://github.com/apache/dubbo/blob/master/FAQ.md">FAQ</a> of this repository and believe that this is not a duplicate.</li>
</ul>
<h3 dir="auto">Environment</h3>
<ul dir="auto">
<li>Dubbo version: 2.7.3</li>
<li>Operating System version:win7</li>
<li>Java version: jdk 8</li>
</ul>
<h3 dir="auto">Steps to reproduce this issue</h3>
<ol dir="auto">
<li>Create a ReferenceConfig , and do not set MetadataReportConfig</li>
<li>Use ReferenceConfigCache to cache referenceConfig</li>
<li>Get referenceConfig from ReferenceConfigCache and use it to get reference instance for call.</li>
<li>do referenceConfig.get() frequently and invoke service .</li>
</ol>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" ReferenceConfig<HelloBOMService> referenceConfig = new ReferenceConfig();
ApplicationConfig application = new ApplicationConfig("application");
referenceConfig.setApplication(application);
RegistryConfig registryConfig = new RegistryConfig("zookeeper://localhost:21170");
referenceConfig.setInterface(HelloBOMService.class.getName());
referenceConfig.setRegistry(registryConfig);
//referenceConfig.setMetadataReportConfig();
for (;;) {
ReferenceConfigCache cache = ReferenceConfigCache.getCache();
HelloBOMService service = cache.get(referenceConfig);
SomeResponse response = service.get(new SomeRequest());
Thread.sleep(10);
}"><pre class="notranslate"><code class="notranslate"> ReferenceConfig<HelloBOMService> referenceConfig = new ReferenceConfig();
ApplicationConfig application = new ApplicationConfig("application");
referenceConfig.setApplication(application);
RegistryConfig registryConfig = new RegistryConfig("zookeeper://localhost:21170");
referenceConfig.setInterface(HelloBOMService.class.getName());
referenceConfig.setRegistry(registryConfig);
//referenceConfig.setMetadataReportConfig();
for (;;) {
ReferenceConfigCache cache = ReferenceConfigCache.getCache();
HelloBOMService service = cache.get(referenceConfig);
SomeResponse response = service.get(new SomeRequest());
Thread.sleep(10);
}
</code></pre></div>
<h3 dir="auto">Expected Result</h3>
<p dir="auto">When the referenceConfig is first initialization successufully,<br>
the client will not do any operations which affects performance.</p>
<h3 dir="auto">Actual Result</h3>
<p dir="auto">a log of log message loged by dubbo as we call ReferenceCofnig.get() ,whiche affects the health of application.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" [DUBBO] There's no valid metadata config found, if you are using the simplified mode of registry url, please make sure you have a metadata address configured properly., dubbo version: 2.7.3, current host:
[DUBBO] There's no valid metadata config found, if you are using the simplified mode of registry url, please make sure you have a metadata address configured properly., dubbo version: 2.7.3, current host: "><pre class="notranslate"><code class="notranslate"> [DUBBO] There's no valid metadata config found, if you are using the simplified mode of registry url, please make sure you have a metadata address configured properly., dubbo version: 2.7.3, current host:
[DUBBO] There's no valid metadata config found, if you are using the simplified mode of registry url, please make sure you have a metadata address configured properly., dubbo version: 2.7.3, current host:
</code></pre></div> | 0 |
<h2 dir="auto">Describe the bug</h2>
<p dir="auto">Trying Next with layout pattern:</p>
<p dir="auto"><a href="https://github.com/zeit/next.js/tree/canary/examples/layout-component">https://github.com/zeit/next.js/tree/canary/examples/layout-component</a></p>
<p dir="auto">And the problem is that Layout component get remounted on every page change. I need to use layout component as a Container so it'll fetch data from server on every mount. How can I prevent layout to get re-mounted? Or am I missing something there?</p>
<h2 dir="auto">To Reproduce</h2>
<ol dir="auto">
<li>Download <a href="https://github.com/zeit/next.js/tree/canary/examples/layout-component">https://github.com/zeit/next.js/tree/canary/examples/layout-component</a></li>
<li>Add following code to Layout component:</li>
</ol>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="React.useEffect(() => {
console.log("layount mounted " + new Date());
}, []);
"><pre class="notranslate"><code class="notranslate">React.useEffect(() => {
console.log("layount mounted " + new Date());
}, []);
</code></pre></div>
<ol start="3" dir="auto">
<li>See how Layout get remounted on every page, even though it's not supposed to.</li>
</ol>
<h2 dir="auto">System information</h2>
<p dir="auto">MacOS<br>
Chrome<br>
Next.js latest</p>
<h2 dir="auto">Additional context</h2>
<p dir="auto">I've found a workaround in this article:<br>
<a href="https://adamwathan.me/2019/10/17/persistent-layout-patterns-in-nextjs/" rel="nofollow">https://adamwathan.me/2019/10/17/persistent-layout-patterns-in-nextjs/</a></p>
<p dir="auto">So maybe it's a feature request partly.</p> | <p dir="auto">I'm seeing that the contents of Head <code class="notranslate">(next/head)</code> are doubling when I use apollo, it doesn't seem to have any negative effects but I wanted to let you know.</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://cloud.githubusercontent.com/assets/4278345/23579834/bec8da8c-00c3-11e7-8b35-ca7be982117c.png"><img src="https://cloud.githubusercontent.com/assets/4278345/23579834/bec8da8c-00c3-11e7-8b35-ca7be982117c.png" alt="issue" style="max-width: 100%;"></a></p>
<p dir="auto"><a href="https://github.com/Goluis/next-with-apollo-repeated-head">link to the repo</a></p>
<p dir="auto">the head is duplicated because of this:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="if (!process.browser) {
const app = (
<ApolloProvider client={client} store={store}>
<Component {...props} />
</ApolloProvider>
)
await getDataFromTree(app)
}"><pre class="notranslate"><span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-c1">!</span><span class="pl-s1">process</span><span class="pl-kos">.</span><span class="pl-c1">browser</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-k">const</span> <span class="pl-s1">app</span> <span class="pl-c1">=</span> <span class="pl-kos">(</span>
<span class="pl-c1"><</span><span class="pl-ent">ApolloProvider</span> <span class="pl-c1">client</span><span class="pl-c1">=</span><span class="pl-kos">{</span><span class="pl-s1">client</span><span class="pl-kos">}</span> <span class="pl-c1">store</span><span class="pl-c1">=</span><span class="pl-kos">{</span><span class="pl-s1">store</span><span class="pl-kos">}</span><span class="pl-c1">></span>
<span class="pl-c1"><</span><span class="pl-ent">Component</span> <span class="pl-kos">{</span>...<span class="pl-s1">props</span><span class="pl-kos">}</span> <span class="pl-c1">/</span><span class="pl-c1">></span>
<span class="pl-c1"><</span><span class="pl-c1">/</span><span class="pl-ent">ApolloProvider</span><span class="pl-c1">></span>
<span class="pl-kos">)</span>
<span class="pl-k">await</span> <span class="pl-en">getDataFromTree</span><span class="pl-kos">(</span><span class="pl-s1">app</span><span class="pl-kos">)</span>
<span class="pl-kos">}</span></pre></div>
<p dir="auto">btw if I use <code class="notranslate">Head</code> multiple times, there should be no problem right ? (in the repo I'm using it only once)</p> | 0 |
<h3 dir="auto">System info</h3>
<ul dir="auto">
<li>Playwright Version: v1.31.2</li>
<li>Operating System: macOS 13.2.1</li>
<li>Browser: All</li>
<li>Other info:</li>
</ul>
<h3 dir="auto">Source code</h3>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I provided exact source code that allows reproducing the issue locally.</li>
</ul>
<p dir="auto"><strong>Link to the GitHub repository with the repro</strong></p>
<p dir="auto"><a href="https://github.com/chris13524/sentry-nextjs-playwright-broken">https://github.com/chris13524/sentry-nextjs-playwright-broken</a></p>
<p dir="auto"><strong>Steps</strong></p>
<ul dir="auto">
<li>run <code class="notranslate">npm run test-ct</code> to reproduce error</li>
<li>edit <code class="notranslate">pages/index.tsx</code> and comment out the call to <code class="notranslate">addBreadcrumb()</code></li>
<li>run <code class="notranslate">npm run test-ct</code> to reproduce no error</li>
</ul>
<p dir="auto"><strong>Expected</strong></p>
<p dir="auto">I should be able to use the <a href="https://www.npmjs.com/package/@sentry/nextjs" rel="nofollow">@sentry/nextjs</a> library in my component and in the helper files that my component calls.</p>
<p dir="auto"><strong>Actual</strong></p>
<p dir="auto">Test times out while mounting the component.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="chris13524@host sentry-nextjs-playwright-broken % npm run test-ct
> sentry-nextjs-playwright-broken@0.1.0 test-ct
> playwright test -c playwright-ct.config.ts
Running 3 tests using 3 workers
1) [webkit] › pages/index.spec.tsx:6:5 › should work ─────────────────────────────────────────────
Test timeout of 10000ms exceeded.
Target closed
5 |
6 | test('should work', async ({ mount }) => {
> 7 | const component = await mount(<Home />);
| ^
8 | await expect(component).toContainText('Get started');
9 | });
10 |
at /Users/chris13524/git/github.com/chris13524/sentry-nextjs-playwright-broken/pages/index.spec.tsx:7:27
2) [chromium] › pages/index.spec.tsx:6:5 › should work ───────────────────────────────────────────
Test timeout of 10000ms exceeded.
Target closed
5 |
6 | test('should work', async ({ mount }) => {
> 7 | const component = await mount(<Home />);
| ^
8 | await expect(component).toContainText('Get started');
9 | });
10 |
at /Users/chris13524/git/github.com/chris13524/sentry-nextjs-playwright-broken/pages/index.spec.tsx:7:27
3) [firefox] › pages/index.spec.tsx:6:5 › should work ────────────────────────────────────────────
Test timeout of 10000ms exceeded.
Target closed
5 |
6 | test('should work', async ({ mount }) => {
> 7 | const component = await mount(<Home />);
| ^
8 | await expect(component).toContainText('Get started');
9 | });
10 |
at /Users/chris13524/git/github.com/chris13524/sentry-nextjs-playwright-broken/pages/index.spec.tsx:7:27
3 failed
[chromium] › pages/index.spec.tsx:6:5 › should work ────────────────────────────────────────────
[firefox] › pages/index.spec.tsx:6:5 › should work ─────────────────────────────────────────────
[webkit] › pages/index.spec.tsx:6:5 › should work ──────────────────────────────────────────────
Serving HTML report at http://localhost:9323. Press Ctrl+C to quit.
"><pre class="notranslate"><code class="notranslate">chris13524@host sentry-nextjs-playwright-broken % npm run test-ct
> sentry-nextjs-playwright-broken@0.1.0 test-ct
> playwright test -c playwright-ct.config.ts
Running 3 tests using 3 workers
1) [webkit] › pages/index.spec.tsx:6:5 › should work ─────────────────────────────────────────────
Test timeout of 10000ms exceeded.
Target closed
5 |
6 | test('should work', async ({ mount }) => {
> 7 | const component = await mount(<Home />);
| ^
8 | await expect(component).toContainText('Get started');
9 | });
10 |
at /Users/chris13524/git/github.com/chris13524/sentry-nextjs-playwright-broken/pages/index.spec.tsx:7:27
2) [chromium] › pages/index.spec.tsx:6:5 › should work ───────────────────────────────────────────
Test timeout of 10000ms exceeded.
Target closed
5 |
6 | test('should work', async ({ mount }) => {
> 7 | const component = await mount(<Home />);
| ^
8 | await expect(component).toContainText('Get started');
9 | });
10 |
at /Users/chris13524/git/github.com/chris13524/sentry-nextjs-playwright-broken/pages/index.spec.tsx:7:27
3) [firefox] › pages/index.spec.tsx:6:5 › should work ────────────────────────────────────────────
Test timeout of 10000ms exceeded.
Target closed
5 |
6 | test('should work', async ({ mount }) => {
> 7 | const component = await mount(<Home />);
| ^
8 | await expect(component).toContainText('Get started');
9 | });
10 |
at /Users/chris13524/git/github.com/chris13524/sentry-nextjs-playwright-broken/pages/index.spec.tsx:7:27
3 failed
[chromium] › pages/index.spec.tsx:6:5 › should work ────────────────────────────────────────────
[firefox] › pages/index.spec.tsx:6:5 › should work ─────────────────────────────────────────────
[webkit] › pages/index.spec.tsx:6:5 › should work ──────────────────────────────────────────────
Serving HTML report at http://localhost:9323. Press Ctrl+C to quit.
</code></pre></div> | <h2 dir="auto">Context</h2>
<p dir="auto">Playwright Version: 1.33.0<br>
Operating System: OS X<br>
Node.js version: 16.20.0<br>
MSW version: 1.2.1</p>
<p dir="auto">We are currently migrating the E2E test suite of a <strong>React Native app</strong> from Cypress to Playwright. Both Playwright and msw work perfectly for us. We use MSW also in combination with our Jest test suite, as well as for local manual testing. We would like to intercept and mock network requests that are performed by browsers during Playwright tests. In Cypress we managed to achieve it like this:</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content=" cy.window().then((window) => {
const {worker, rest} = window.msw;
worker.use(
rest.post(`*${api.customName}`, (_, res, ctx) => {
const response = cloneDeep(responses.customName);
response.days = 5;
return res(ctx.status(200), ctx.json(response));
}),
);
});"><pre class="notranslate"> <span class="pl-s1">cy</span><span class="pl-kos">.</span><span class="pl-en">window</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">then</span><span class="pl-kos">(</span><span class="pl-kos">(</span><span class="pl-s1">window</span><span class="pl-kos">)</span> <span class="pl-c1">=></span> <span class="pl-kos">{</span>
<span class="pl-k">const</span> <span class="pl-kos">{</span>worker<span class="pl-kos">,</span> rest<span class="pl-kos">}</span> <span class="pl-c1">=</span> <span class="pl-smi">window</span><span class="pl-kos">.</span><span class="pl-c1">msw</span><span class="pl-kos">;</span>
<span class="pl-s1">worker</span><span class="pl-kos">.</span><span class="pl-en">use</span><span class="pl-kos">(</span>
<span class="pl-s1">rest</span><span class="pl-kos">.</span><span class="pl-en">post</span><span class="pl-kos">(</span><span class="pl-s">`*<span class="pl-s1"><span class="pl-kos">${</span><span class="pl-s1">api</span><span class="pl-kos">.</span><span class="pl-c1">customName</span><span class="pl-kos">}</span></span>`</span><span class="pl-kos">,</span> <span class="pl-kos">(</span><span class="pl-s1">_</span><span class="pl-kos">,</span> <span class="pl-s1">res</span><span class="pl-kos">,</span> <span class="pl-s1">ctx</span><span class="pl-kos">)</span> <span class="pl-c1">=></span> <span class="pl-kos">{</span>
<span class="pl-k">const</span> <span class="pl-s1">response</span> <span class="pl-c1">=</span> <span class="pl-en">cloneDeep</span><span class="pl-kos">(</span><span class="pl-s1">responses</span><span class="pl-kos">.</span><span class="pl-c1">customName</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-s1">response</span><span class="pl-kos">.</span><span class="pl-c1">days</span> <span class="pl-c1">=</span> <span class="pl-c1">5</span><span class="pl-kos">;</span>
<span class="pl-k">return</span> <span class="pl-en">res</span><span class="pl-kos">(</span><span class="pl-s1">ctx</span><span class="pl-kos">.</span><span class="pl-en">status</span><span class="pl-kos">(</span><span class="pl-c1">200</span><span class="pl-kos">)</span><span class="pl-kos">,</span> <span class="pl-s1">ctx</span><span class="pl-kos">.</span><span class="pl-en">json</span><span class="pl-kos">(</span><span class="pl-s1">response</span><span class="pl-kos">)</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">,</span>
<span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<h2 dir="auto">Problem</h2>
<p dir="auto">We tried to achieve the same behavior in Playwright tests, but have not been successful yet.</p>
<h2 dir="auto">What we tried</h2>
<ol dir="auto">
<li>Use build-in modification of API responses (then realized that this build-in feature might not work for msw)</li>
</ol>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content=" await page.route(`*/api/${api.statistics}`, async (route) => {
const response = await route.fetch();
const json = await response.json();
json.days = 5;
await route.fulfill({response, json});
});"><pre class="notranslate"> <span class="pl-k">await</span> <span class="pl-s1">page</span><span class="pl-kos">.</span><span class="pl-en">route</span><span class="pl-kos">(</span><span class="pl-s">`*/api/<span class="pl-s1"><span class="pl-kos">${</span><span class="pl-s1">api</span><span class="pl-kos">.</span><span class="pl-c1">statistics</span><span class="pl-kos">}</span></span>`</span><span class="pl-kos">,</span> <span class="pl-k">async</span> <span class="pl-kos">(</span><span class="pl-s1">route</span><span class="pl-kos">)</span> <span class="pl-c1">=></span> <span class="pl-kos">{</span>
<span class="pl-k">const</span> <span class="pl-s1">response</span> <span class="pl-c1">=</span> <span class="pl-k">await</span> <span class="pl-s1">route</span><span class="pl-kos">.</span><span class="pl-en">fetch</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-k">const</span> <span class="pl-s1">json</span> <span class="pl-c1">=</span> <span class="pl-k">await</span> <span class="pl-s1">response</span><span class="pl-kos">.</span><span class="pl-en">json</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-s1">json</span><span class="pl-kos">.</span><span class="pl-c1">days</span> <span class="pl-c1">=</span> <span class="pl-c1">5</span><span class="pl-kos">;</span>
<span class="pl-k">await</span> <span class="pl-s1">route</span><span class="pl-kos">.</span><span class="pl-en">fulfill</span><span class="pl-kos">(</span><span class="pl-kos">{</span>response<span class="pl-kos">,</span> json<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<ol start="2" dir="auto">
<li>Add option <code class="notranslate">serviceWorkers: allow</code> in config</li>
<li>Try using <a href="https://github.com/microsoft/playwright/issues/15684" data-hovercard-type="issue" data-hovercard-url="/microsoft/playwright/issues/15684/hovercard">Experimental Service Worker Network Events</a> (unsuccessful)</li>
<li>Try <a href="https://www.npmjs.com/package/playwright-msw" rel="nofollow">msw-playwright package</a>, but the requests do not seem to get intercepted. The browser returns the original response that is defined in our msw environment (<code class="notranslate">handlers.ts</code>).</li>
</ol>
<p dir="auto">What could be the cause of the problem? What's the best way to intercept API requests in Playwright tests using MSW? Thanks in advance for your help!</p> | 0 |
<p dir="auto">I used <code class="notranslate">setup.py install</code> today to install matplotlib in a venv. I got some rather hard to tackle tracebacks, as they were filled with exec's (meaning one can not see what the actual code is that fails).</p>
<p dir="auto">Ultimately this was caused by pyparsing calling <code class="notranslate">.filename</code> and <code class="notranslate">.lineno</code> on a tuple (it obviously expected some kind of different object). But the tuple did contain a filename and a lineno as the first two elements, and some other stuff (the tuple seemed to be coming from the backtrace package). This code was wrapped in something like <code class="notranslate">if PY3: ...</code></p>
<p dir="auto">As a random guess I decided to downgrade pyparsing from 2.1.2 to 2.1.1, and this solved the problem. Unfortunately, I am not able to reproduce this anymore, even when upgrading pyparsing to 2.1.2. Still I though a heads-up might be in place, if someone seems <code class="notranslate">AttributeError: 'tuple' object has no attribute 'filename'</code> with a traceback that is more of less useless.</p> | <p dir="auto">Every day we have a bunch of EC2 machines that start and install themselves.</p>
<p dir="auto">This morning, the <code class="notranslate">pip install matplotlib</code> returned this :</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" Complete output from command /usr/bin/python3.4 -c "import setuptools, tokenize;__file__='/tmp/pip-build-y7e201wb/matplotlib/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-1h1al542-record/install-record.txt --single-version-externally-managed --compile:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-y7e201wb/matplotlib/setup.py", line 167, in <module>
result = package.check()
File "/tmp/pip-build-y7e201wb/matplotlib/setupext.py", line 1246, in check
import pyparsing
File "/usr/local/lib/python3.4/site-packages/pyparsing.py", line 3478, in <module>
_escapedPunc = Word( _bslash, r"\[]-*.$+^?()~ ", exact=2 ).setParseAction(lambda s,l,t:t[0][1])
File "/usr/local/lib/python3.4/site-packages/pyparsing.py", line 948, in setParseAction
self.parseAction = list(map(_trim_arity, list(fns)))
File "/usr/local/lib/python3.4/site-packages/pyparsing.py", line 808, in _trim_arity
this_line = extract_stack()[-1]
File "/usr/local/lib/python3.4/site-packages/pyparsing.py", line 793, in extract_stack
return [(frame_summary.filename, frame_summary.lineno)]
AttributeError: 'tuple' object has no attribute 'filename'
============================================================================
Edit setup.cfg to change the build options
BUILDING MATPLOTLIB
matplotlib: yes [1.5.1]
python: yes [3.4.3 (default, Apr 1 2015, 18:10:40) [GCC
4.8.2 20140120 (Red Hat 4.8.2-16)]]
platform: yes [linux]
REQUIRED DEPENDENCIES AND EXTENSIONS
numpy: yes [version 1.11.0]
dateutil: yes [using dateutil version 2.5.3]
pytz: yes [using pytz version 2016.4]
cycler: yes [using cycler version 0.10.0]
tornado: yes [using tornado version 4.3]
"><pre class="notranslate"><code class="notranslate"> Complete output from command /usr/bin/python3.4 -c "import setuptools, tokenize;__file__='/tmp/pip-build-y7e201wb/matplotlib/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-1h1al542-record/install-record.txt --single-version-externally-managed --compile:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-y7e201wb/matplotlib/setup.py", line 167, in <module>
result = package.check()
File "/tmp/pip-build-y7e201wb/matplotlib/setupext.py", line 1246, in check
import pyparsing
File "/usr/local/lib/python3.4/site-packages/pyparsing.py", line 3478, in <module>
_escapedPunc = Word( _bslash, r"\[]-*.$+^?()~ ", exact=2 ).setParseAction(lambda s,l,t:t[0][1])
File "/usr/local/lib/python3.4/site-packages/pyparsing.py", line 948, in setParseAction
self.parseAction = list(map(_trim_arity, list(fns)))
File "/usr/local/lib/python3.4/site-packages/pyparsing.py", line 808, in _trim_arity
this_line = extract_stack()[-1]
File "/usr/local/lib/python3.4/site-packages/pyparsing.py", line 793, in extract_stack
return [(frame_summary.filename, frame_summary.lineno)]
AttributeError: 'tuple' object has no attribute 'filename'
============================================================================
Edit setup.cfg to change the build options
BUILDING MATPLOTLIB
matplotlib: yes [1.5.1]
python: yes [3.4.3 (default, Apr 1 2015, 18:10:40) [GCC
4.8.2 20140120 (Red Hat 4.8.2-16)]]
platform: yes [linux]
REQUIRED DEPENDENCIES AND EXTENSIONS
numpy: yes [version 1.11.0]
dateutil: yes [using dateutil version 2.5.3]
pytz: yes [using pytz version 2016.4]
cycler: yes [using cycler version 0.10.0]
tornado: yes [using tornado version 4.3]
</code></pre></div>
<p dir="auto">What happens ?</p>
<p dir="auto">Our stack</p>
<ul dir="auto">
<li>python 3.4, amazon linux</li>
</ul> | 1 |
<p dir="auto">This works:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=">>> pd.to_datetime(1, unit='D')
Timestamp('1970-01-02 00:00:00')"><pre class="notranslate"><code class="notranslate">>>> pd.to_datetime(1, unit='D')
Timestamp('1970-01-02 00:00:00')
</code></pre></div>
<p dir="auto">However, the following gives incorrect output:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=">>> pd.to_datetime(1, unit='D', errors='coerce')
NaT"><pre class="notranslate"><code class="notranslate">>>> pd.to_datetime(1, unit='D', errors='coerce')
NaT
</code></pre></div>
<h4 dir="auto">Details of Configuration:</h4>
<p dir="auto">python: 2.7.11.final.0<br>
python-bits: 64<br>
OS: Windows<br>
OS-release: 10<br>
machine: AMD64<br>
processor: Intel64 Family 6 Model 61 Stepping 4, GenuineIntel<br>
byteorder: little<br>
LC_ALL: None<br>
LANG: None</p>
<p dir="auto">pandas: 0.18.0<br>
nose: 1.3.7<br>
pip: 8.1.1<br>
setuptools: 20.3<br>
Cython: 0.23.4<br>
numpy: 1.10.4<br>
scipy: 0.17.0<br>
statsmodels: 0.6.1<br>
xarray: None<br>
IPython: 4.1.2<br>
sphinx: 1.3.5<br>
patsy: 0.4.0<br>
dateutil: 2.5.1<br>
pytz: 2016.2<br>
blosc: None<br>
bottleneck: 1.0.0<br>
tables: 3.2.2<br>
numexpr: 2.5<br>
matplotlib: 1.5.1<br>
openpyxl: 2.3.2<br>
xlrd: 0.9.4<br>
xlwt: 1.0.0<br>
xlsxwriter: 0.8.4<br>
lxml: 3.6.0<br>
bs4: 4.4.1<br>
html5lib: None<br>
httplib2: None<br>
apiclient: None<br>
sqlalchemy: 1.0.12<br>
pymysql: None<br>
psycopg2: None<br>
jinja2: 2.8<br>
boto: 2.39.0</p> | <p dir="auto">xref <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="120416618" data-permission-text="Title is private" data-url="https://github.com/pandas-dev/pandas/issues/11760" data-hovercard-type="issue" data-hovercard-url="/pandas-dev/pandas/issues/11760/hovercard" href="https://github.com/pandas-dev/pandas/issues/11760">#11760</a></p>
<p dir="auto">Parsing unix epoch timestamps give NaT with <code class="notranslate">errors='coerce'</code> while they can be parsed correctly without it:</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content=">>> pd.to_datetime(1420043460, errors='coerce', unit='s')
NaT
>>> pd.to_datetime(1420043460, unit='s')
Timestamp('2014-12-31 16:31:00')"><pre class="notranslate"><span class="pl-c1">>></span><span class="pl-c1">></span> <span class="pl-s1">pd</span>.<span class="pl-en">to_datetime</span>(<span class="pl-c1">1420043460</span>, <span class="pl-s1">errors</span><span class="pl-c1">=</span><span class="pl-s">'coerce'</span>, <span class="pl-s1">unit</span><span class="pl-c1">=</span><span class="pl-s">'s'</span>)
<span class="pl-v">NaT</span>
<span class="pl-c1">>></span><span class="pl-c1">></span> <span class="pl-s1">pd</span>.<span class="pl-en">to_datetime</span>(<span class="pl-c1">1420043460</span>, <span class="pl-s1">unit</span><span class="pl-c1">=</span><span class="pl-s">'s'</span>)
<span class="pl-v">Timestamp</span>(<span class="pl-s">'2014-12-31 16:31:00'</span>)</pre></div>
<p dir="auto">pandas: 0.17.1<br>
numpy: 1.10.1<br>
Python 2.7.7</p> | 1 |
<p dir="auto">I grew tired of having to convert my units just for the sake of specifying the figure size. I'd like to specify the figure size directly in a metric unit, nominally centimeters (or millimeters, no difference). In most EU countries metric is the norm. I only have to deal with inches when looking at monitor sizes, printing, and matplotlib :(</p>
<p dir="auto">I've found at least two issues about this: <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="7539084" data-permission-text="Title is private" data-url="https://github.com/matplotlib/matplotlib/issues/1369" data-hovercard-type="issue" data-hovercard-url="/matplotlib/matplotlib/issues/1369/hovercard" href="https://github.com/matplotlib/matplotlib/issues/1369">#1369</a> and the more generic <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="260354239" data-permission-text="Title is private" data-url="https://github.com/matplotlib/matplotlib/issues/9226" data-hovercard-type="issue" data-hovercard-url="/matplotlib/matplotlib/issues/9226/hovercard" href="https://github.com/matplotlib/matplotlib/issues/9226">#9226</a>.</p>
<p dir="auto">Of course, having support for generic unit specifiers would be nice, but I'm not entirely satisfied by the extra complexity of <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="260354239" data-permission-text="Title is private" data-url="https://github.com/matplotlib/matplotlib/issues/9226" data-hovercard-type="issue" data-hovercard-url="/matplotlib/matplotlib/issues/9226/hovercard" href="https://github.com/matplotlib/matplotlib/issues/9226">#9226</a>. I'm also thorn about (size, unit) tuples, because I don't ever think I'm going to specify the figure size in AU, or picometers. Cm is regularly used for anything that fits paper.</p>
<p dir="auto">I see two cases where inches are specified in the rc:</p>
<ul dir="auto">
<li>figure.figsize</li>
<li>savefig.pad_inches</li>
</ul>
<p dir="auto">In the api, there is the figsize kwarg, I guess a pad_inches kwarg, and the set_size_inches method.</p>
<p dir="auto">What abound the KISS approach: add a figsize_cm kwarg, pad_cm, and the set_size_cm method, and the two respective rcParams? Fully backward compatible, and allows metric countries to get by easily.</p>
<p dir="auto">I could easily contribute such a patch.</p> | <h3 dir="auto">Problem</h3>
<p dir="auto">I've noticed that matplotlib currently doesn't support saving images in webp format, which I later confirmed by looking into supported file formats in <a href="https://github.com/matplotlib/matplotlib/blob/master/lib/matplotlib/backend_bases.py">backend_bases.py</a> file.</p>
<p dir="auto">Saving images in webp would definitely be useful for users who want to upload the graphs they generate in matplotlib to the web. Compression to webp helps significantly reduce the image size, without losing quality. More information about webp can be found <a href="https://developers.google.com/speed/webp" rel="nofollow">here</a>.</p>
<h3 dir="auto">Proposed solution</h3>
<p dir="auto">Would it be possible to add webp as a supported image saving format? It seems that <code class="notranslate">Pillow</code> package is automatically installed as a dependency when installing <code class="notranslate">matplotlib</code>. <code class="notranslate">Pillow</code> makes it relatively easy to convert an image to webp using the <code class="notranslate">save()</code> method. More detailed information can be found in the <a href="https://pillow.readthedocs.io/en/stable/handbook/image-file-formats.html?highlight=webp#webp" rel="nofollow">documentation</a></p>
<h3 dir="auto">Additional context and prior art</h3>
<p dir="auto"><em>No response</em></p> | 0 |
<h1 dir="auto">Checklist</h1>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have verified that the issue exists against the <code class="notranslate">master</code> branch of Celery.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> This has already been asked to the <a href="https://github.com/celery/celery/discussions">discussions forum</a> first.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have read the relevant section in the<br>
<a href="http://docs.celeryproject.org/en/latest/contributing.html#other-bugs" rel="nofollow">contribution guide</a><br>
on reporting bugs.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have checked the <a href="https://github.com/celery/celery/issues?q=is%3Aissue+label%3A%22Issue+Type%3A+Bug+Report%22+-label%3A%22Category%3A+Documentation%22">issues list</a><br>
for similar or identical bug reports.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have checked the <a href="https://github.com/celery/celery/pulls?q=is%3Apr+label%3A%22PR+Type%3A+Bugfix%22+-label%3A%22Category%3A+Documentation%22">pull requests list</a><br>
for existing proposed fixes.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have checked the <a href="https://github.com/celery/celery/commits/master">commit log</a><br>
to find out if the bug was already fixed in the master branch.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have included all related issues and possible duplicate issues<br>
in this issue (If there are none, check this box anyway).</li>
</ul>
<h2 dir="auto">Mandatory Debugging Information</h2>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have included the output of <code class="notranslate">celery -A proj report</code> in the issue.<br>
(if you are not able to do this, then at least specify the Celery<br>
version affected).</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have verified that the issue exists against the <code class="notranslate">master</code> branch of Celery.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have included the contents of <code class="notranslate">pip freeze</code> in the issue.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have included all the versions of all the external dependencies required<br>
to reproduce this bug.</li>
</ul>
<h2 dir="auto">Optional Debugging Information</h2>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have tried reproducing the issue on more than one Python version<br>
and/or implementation.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have tried reproducing the issue on more than one message broker and/or<br>
result backend.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have tried reproducing the issue on more than one version of the message<br>
broker and/or result backend.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have tried reproducing the issue on more than one operating system.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have tried reproducing the issue on more than one workers pool.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have tried reproducing the issue with autoscaling, retries,<br>
ETA/Countdown & rate limits disabled.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have tried reproducing the issue after downgrading<br>
and/or upgrading Celery and its dependencies.</li>
</ul>
<h2 dir="auto">Related Issues and Possible Duplicates</h2>
<h4 dir="auto">Related Issues</h4>
<ul dir="auto">
<li>None</li>
</ul>
<h4 dir="auto">Possible Duplicates</h4>
<ul dir="auto">
<li>None</li>
</ul>
<h2 dir="auto">Environment & Settings</h2>
<p dir="auto"><strong>5.1.2 (sun-harmonics)</strong>:</p>
<details>
<summary><b><code class="notranslate">celery report</code> Output:</b></summary>
<p dir="auto">
</p><div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="pi@raspberrypi:~/restart/headunit $ /usr/bin/python3.7 -m celery -A pylibs.sidecars.metrics.app.celery report
/home/pi/restart/headunit/pylibs/sidecars
import name: pylibs.sidecars.metrics.metrics
software -> celery:5.1.2 (sun-harmonics) kombu:5.2.1 py:3.7.3
billiard:3.6.4.0 py-amqp:5.0.6
platform -> system:Linux arch:32bit, ELF
kernel version:5.10.60-v7l+ imp:CPython
loader -> celery.loaders.app.AppLoader
settings -> transport:pyamqp results:rpc:///
broker_url: 'amqp://guest:********@localhost:5672//'
result_backend: 'rpc:///'
deprecated_settings: None
ENV: 'production'
DEBUG: False
TESTING: False
PROPAGATE_EXCEPTIONS: None
PRESERVE_CONTEXT_ON_EXCEPTION: None
SECRET_KEY: '********'
PERMANENT_SESSION_LIFETIME: datetime.timedelta(days=31)
USE_X_SENDFILE: False
SERVER_NAME: None
APPLICATION_ROOT: '/'
SESSION_COOKIE_NAME: 'session'
SESSION_COOKIE_DOMAIN: None
SESSION_COOKIE_PATH: None
SESSION_COOKIE_HTTPONLY: True
SESSION_COOKIE_SECURE: False
SESSION_COOKIE_SAMESITE: None
SESSION_REFRESH_EACH_REQUEST: True
MAX_CONTENT_LENGTH: None
SEND_FILE_MAX_AGE_DEFAULT: None
TRAP_BAD_REQUEST_ERRORS: None
TRAP_HTTP_EXCEPTIONS: False
EXPLAIN_TEMPLATE_LOADING: False
PREFERRED_URL_SCHEME: 'http'
JSON_AS_ASCII: True
JSON_SORT_KEYS: '********'
JSONIFY_PRETTYPRINT_REGULAR: False
JSONIFY_MIMETYPE: 'application/json'
TEMPLATES_AUTO_RELOAD: None
MAX_COOKIE_SIZE: 4093
MONGODB_SETTINGS: {
'db': 'static',
'host': 'mongodb://root:toor@mongo.darkphotonworks-labs.io:27017/static'}
task_create_missing_queues: False
task_queues:
(<unbound Queue default -> [default->default]>,
<unbound Queue metrics.system -> [metrics->metrics.system]>,
<unbound Queue metrics.system.vmem -> [metrics->metrics.system.vmem]>,
<unbound Queue metrics.system.swap -> [metrics->metrics.system.swap]>,
<unbound Queue metrics.system.cputime -> [metrics->metrics.system.cputime]>,
<unbound Queue metrics.system.cpustats -> [metrics->metrics.system.cpustats]>,
<unbound Queue metrics.system.temps -> [metrics->metrics.system.temps]>,
<unbound Queue metrics.system.diskusage -> [metrics->metrics.system.diskusage]>,
<unbound Queue metrics.system.netio -> [metrics->metrics.system.netio]>)
default_queue: 'metrics.system'
task_default_queue: 'metrics.system'
task_default_exchange: 'metrics'
task_default_exchange_type: 'direct'
task_default_routing_key: '********'
task_routes: {
'pylibs.sidecars.metrics.app.publish_vmem': { 'queue': 'metrics.system.vmem',
'routing_key': '********'}}
beat_schedule: {
'publish-cpustats-60s': { 'options': { 'exchange_type': 'direct',
'priority': 1,
'queue': 'metrics.system.cpustats',
'routing_key': '********'},
'schedule': 60.0,
'task': 'pylibs.sidecars.metrics.app.publish_cpustats'},
'publish-cputime-60s': { 'options': { 'exchange_type': 'direct',
'priority': 1,
'queue': 'metrics.system.cputime',
'routing_key': '********'},
'schedule': 60.0,
'task': 'pylibs.sidecars.metrics.app.publish_cputime'},
'publish-disk-usage-60s': { 'options': { 'exchange_type': 'direct',
'priority': 1,
'queue': 'metrics.system.diskusage',
'routing_key': '********'},
'schedule': 60.0,
'task': 'pylibs.sidecars.metrics.app.publish_diskusage'},
'publish-netio-60s': { 'options': { 'exchange_type': 'direct',
'priority': 1,
'queue': 'metrics.system.netio',
'routing_key': '********'},
'schedule': 60.0,
'task': 'pylibs.sidecars.metrics.app.publish_netio'},
'publish-swap-60s': { 'options': { 'exchange_type': 'direct',
'priority': 1,
'queue': 'metrics.system.swap',
'routing_key': '********'},
'schedule': 60.0,
'task': 'pylibs.sidecars.metrics.app.publish_swap'},
'publish-temperature-60s': { 'options': { 'exchange_type': 'direct',
'priority': 1,
'queue': 'metrics.system.temps',
'routing_key': '********'},
'schedule': 60.0,
'task': 'pylibs.sidecars.metrics.app.publish_temps'},
'publish-vmem-60s': { 'options': { 'exchange_type': 'direct',
'priority': 1,
'queue': 'metrics.system.vmem',
'routing_key': '********'},
'schedule': 60.0,
'task': 'pylibs.sidecars.metrics.app.publish_vmem'}}
timezone: 'UTC'"><pre class="notranslate"><code class="notranslate">pi@raspberrypi:~/restart/headunit $ /usr/bin/python3.7 -m celery -A pylibs.sidecars.metrics.app.celery report
/home/pi/restart/headunit/pylibs/sidecars
import name: pylibs.sidecars.metrics.metrics
software -> celery:5.1.2 (sun-harmonics) kombu:5.2.1 py:3.7.3
billiard:3.6.4.0 py-amqp:5.0.6
platform -> system:Linux arch:32bit, ELF
kernel version:5.10.60-v7l+ imp:CPython
loader -> celery.loaders.app.AppLoader
settings -> transport:pyamqp results:rpc:///
broker_url: 'amqp://guest:********@localhost:5672//'
result_backend: 'rpc:///'
deprecated_settings: None
ENV: 'production'
DEBUG: False
TESTING: False
PROPAGATE_EXCEPTIONS: None
PRESERVE_CONTEXT_ON_EXCEPTION: None
SECRET_KEY: '********'
PERMANENT_SESSION_LIFETIME: datetime.timedelta(days=31)
USE_X_SENDFILE: False
SERVER_NAME: None
APPLICATION_ROOT: '/'
SESSION_COOKIE_NAME: 'session'
SESSION_COOKIE_DOMAIN: None
SESSION_COOKIE_PATH: None
SESSION_COOKIE_HTTPONLY: True
SESSION_COOKIE_SECURE: False
SESSION_COOKIE_SAMESITE: None
SESSION_REFRESH_EACH_REQUEST: True
MAX_CONTENT_LENGTH: None
SEND_FILE_MAX_AGE_DEFAULT: None
TRAP_BAD_REQUEST_ERRORS: None
TRAP_HTTP_EXCEPTIONS: False
EXPLAIN_TEMPLATE_LOADING: False
PREFERRED_URL_SCHEME: 'http'
JSON_AS_ASCII: True
JSON_SORT_KEYS: '********'
JSONIFY_PRETTYPRINT_REGULAR: False
JSONIFY_MIMETYPE: 'application/json'
TEMPLATES_AUTO_RELOAD: None
MAX_COOKIE_SIZE: 4093
MONGODB_SETTINGS: {
'db': 'static',
'host': 'mongodb://root:toor@mongo.darkphotonworks-labs.io:27017/static'}
task_create_missing_queues: False
task_queues:
(<unbound Queue default -> [default->default]>,
<unbound Queue metrics.system -> [metrics->metrics.system]>,
<unbound Queue metrics.system.vmem -> [metrics->metrics.system.vmem]>,
<unbound Queue metrics.system.swap -> [metrics->metrics.system.swap]>,
<unbound Queue metrics.system.cputime -> [metrics->metrics.system.cputime]>,
<unbound Queue metrics.system.cpustats -> [metrics->metrics.system.cpustats]>,
<unbound Queue metrics.system.temps -> [metrics->metrics.system.temps]>,
<unbound Queue metrics.system.diskusage -> [metrics->metrics.system.diskusage]>,
<unbound Queue metrics.system.netio -> [metrics->metrics.system.netio]>)
default_queue: 'metrics.system'
task_default_queue: 'metrics.system'
task_default_exchange: 'metrics'
task_default_exchange_type: 'direct'
task_default_routing_key: '********'
task_routes: {
'pylibs.sidecars.metrics.app.publish_vmem': { 'queue': 'metrics.system.vmem',
'routing_key': '********'}}
beat_schedule: {
'publish-cpustats-60s': { 'options': { 'exchange_type': 'direct',
'priority': 1,
'queue': 'metrics.system.cpustats',
'routing_key': '********'},
'schedule': 60.0,
'task': 'pylibs.sidecars.metrics.app.publish_cpustats'},
'publish-cputime-60s': { 'options': { 'exchange_type': 'direct',
'priority': 1,
'queue': 'metrics.system.cputime',
'routing_key': '********'},
'schedule': 60.0,
'task': 'pylibs.sidecars.metrics.app.publish_cputime'},
'publish-disk-usage-60s': { 'options': { 'exchange_type': 'direct',
'priority': 1,
'queue': 'metrics.system.diskusage',
'routing_key': '********'},
'schedule': 60.0,
'task': 'pylibs.sidecars.metrics.app.publish_diskusage'},
'publish-netio-60s': { 'options': { 'exchange_type': 'direct',
'priority': 1,
'queue': 'metrics.system.netio',
'routing_key': '********'},
'schedule': 60.0,
'task': 'pylibs.sidecars.metrics.app.publish_netio'},
'publish-swap-60s': { 'options': { 'exchange_type': 'direct',
'priority': 1,
'queue': 'metrics.system.swap',
'routing_key': '********'},
'schedule': 60.0,
'task': 'pylibs.sidecars.metrics.app.publish_swap'},
'publish-temperature-60s': { 'options': { 'exchange_type': 'direct',
'priority': 1,
'queue': 'metrics.system.temps',
'routing_key': '********'},
'schedule': 60.0,
'task': 'pylibs.sidecars.metrics.app.publish_temps'},
'publish-vmem-60s': { 'options': { 'exchange_type': 'direct',
'priority': 1,
'queue': 'metrics.system.vmem',
'routing_key': '********'},
'schedule': 60.0,
'task': 'pylibs.sidecars.metrics.app.publish_vmem'}}
timezone: 'UTC'
</code></pre></div>
<p dir="auto"></p>
</details>
<h1 dir="auto">Steps to Reproduce</h1>
<h2 dir="auto">Required Dependencies</h2>
<ul dir="auto">
<li><strong>Minimal Python Version</strong>: 3.7</li>
<li><strong>Minimal Celery Version</strong>: 5.1.2</li>
<li><strong>Minimal Kombu Version</strong>: 5.2.0</li>
<li><strong>Minimal Broker Version</strong>: rabbit mq 3.x</li>
<li><strong>Minimal Result Backend Version</strong>: N/A or Unknown</li>
<li><strong>Minimal OS and/or Kernel Version</strong>: Raspbian 10</li>
<li><strong>Minimal Broker Client Version</strong>: N/A or Unknown</li>
<li><strong>Minimal Result Backend Client Version</strong>: N/A or Unknown</li>
</ul>
<h3 dir="auto">Python Packages</h3>
<details>
<summary><b><code class="notranslate">pip freeze</code> Output:</b></summary>
<p dir="auto">
</p><div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="pi@raspberrypi:~/restart/headunit $ pip3 freeze
aiofiles==0.7.0
ajsonrpc==1.2.0
alabaster==0.7.12
amqp==5.0.6
aniso8601==7.0.0
anyio==3.3.2
arduino-sketch==0.2
asgiref==3.4.1
asn1crypto==0.24.0
astroid==2.8.0
asttokens==1.1.13
attrs==21.2.0
automationhat==0.2.0
Babel==2.9.1
backcall==0.2.0
backports.entry-points-selectable==1.1.0
beautifulsoup4==4.7.1
billiard==3.6.4.0
black==21.9b0
blinker==1.4
blinkt==0.1.2
bottle==0.12.19
buttonshim==0.0.2
cached-property==1.5.1
Cap1xxx==0.1.3
celery==5.1.2
certifi==2018.8.24
cfgv==3.3.1
chardet==3.0.4
click==7.1.2
click-didyoumean==0.3.0
click-plugins==1.1.1
click-repl==0.2.0
colorama==0.3.7
colorzero==1.1
cookies==2.2.1
coverage==6.0.2
cryptography==2.6.1
cupshelpers==1.0
decorator==5.1.0
distlib==0.3.2
dnspython==1.16.0
docker==3.4.1
docker-compose==1.21.0
docker-pycreds==0.3.0
dockerpty==0.4.1
docopt==0.6.2
docutils==0.14
drumhat==0.1.0
email-validator==1.1.3
entrypoints==0.3
envirophat==1.0.0
ExplorerHAT==0.4.2
filelock==3.0.12
flake8==3.9.2
Flask==2.0.1
Flask-GraphQL==2.0.1
Flask-MongoAlchemy==0.7.2
flask-mongoengine==1.0.0
Flask-WTF==0.15.1
fourletterphat==0.1.0
gpiozero==1.6.2
graphene==2.1.9
graphene-mongo==0.2.13
graphql-core==2.3.2
graphql-relay==2.0.1
graphql-server-core==1.2.0
h11==0.12.0
html5lib==1.0.1
identify==2.2.15
idna==3.2
ifaddr==0.1.7
imagesize==1.2.0
importlib-metadata==4.8.1
iniconfig==1.1.1
ipython==7.28.0
iso8601==0.1.16
isort==5.9.3
itsdangerous==2.0.1
jedi==0.18.0
Jinja2==3.0.1
jsonschema==2.6.0
keyring==17.1.1
keyrings.alt==3.1.1
kombu==5.2.1
lazy-object-proxy==1.6.0
librabbitmq==2.0.0
logilab-common==1.4.2
lxml==4.3.2
MarkupSafe==2.0.1
marshmallow==3.13.0
matplotlib-inline==0.1.3
mccabe==0.6.1
microdotphat==0.2.1
MongoAlchemy==0.19
mongoengine==0.23.1
mote==0.0.4
motephat==0.0.3
mypy==0.670
mypy-extensions==0.4.3
nodeenv==1.6.0
numpy==1.16.2
oauthlib==2.1.0
olefile==0.46
packaging==21.0
pantilthat==0.0.7
parso==0.8.2
pathspec==0.9.0
pexpect==4.6.0
pgzero==1.2
phatbeat==0.1.1
pianohat==0.1.0
picamera==1.13
pickleshare==0.7.5
piglow==1.2.5
pigpio==1.78
pika==1.2.0
Pillow==5.4.1
platformdirs==2.3.0
platformio==5.2.0
pluggy==1.0.0
pre-commit==2.15.0
promise==2.3
prompt-toolkit==3.0.20
psutil==5.5.1
py==1.10.0
pycairo==1.16.2
pycodestyle==2.7.0
pycrypto==2.6.1
pycups==1.9.73
pyelftools==0.27
pyFirmata==1.1.0
pyflakes==2.3.1
pygame==1.9.4.post1
Pygments==2.3.1
PyGObject==3.30.4
pyinotify==0.9.6
PyJWT==1.7.0
pylint==2.11.1
pymata4==1.11
pymongo==3.12.0
pyOpenSSL==19.0.0
pyparsing==2.4.7
pyserial==3.5
pysmbc==1.0.15.6
pytest==6.2.5
pytest-cov==3.0.0
pytest-mock-resources==2.1.3
python-apt==1.8.4.3
python-dotenv==0.19.0
python-settings==0.2.2
pytz==2021.3
pyudev==0.22.0
pyxdg==0.25
PyYAML==5.4.1
rainbowhat==0.1.0
regex==2021.9.30
reportlab==3.5.13
requests==2.21.0
requests-oauthlib==1.0.0
responses==0.9.0
roman==2.0.0
RPi.GPIO==0.7.0
RTIMULib==7.2.1
Rx==1.6.1
SCons==4.2.0
scrollphat==0.0.7
scrollphathd==1.2.1
SecretStorage==2.3.1
semantic-version==2.8.5
Send2Trash==1.5.0
sense-hat==2.2.0
simplejson==3.16.0
singledispatch==3.7.0
six==1.12.0
skywriter==0.0.7
sn3218==1.2.7
sniffio==1.2.0
snowballstemmer==2.1.0
soupsieve==1.8
Sphinx==4.2.0
sphinxcontrib-applehelp==1.0.2
sphinxcontrib-devhelp==1.0.2
sphinxcontrib-htmlhelp==2.0.0
sphinxcontrib-jsmath==1.0.1
sphinxcontrib-qthelp==1.0.3
sphinxcontrib-serializinghtml==1.1.5
spidev==3.5
SQLAlchemy==1.4.25
ssh-import-id==5.7
starlette==0.16.0
tabulate==0.8.9
texttable==1.6.0
thonny==3.3.10
toml==0.10.2
tomli==1.2.1
touchphat==0.0.1
traitlets==5.1.0
twython==3.7.0
typed-ast==1.4.3
typing-extensions==3.10.0.2
unicornhathd==0.0.4
urllib3==1.24.1
uvicorn==0.15.0
vine==5.0.0
virtualenv==20.8.0
wcwidth==0.2.5
webencodings==0.5.1
websocket-client==0.53.0
Werkzeug==2.0.1
wrapt==1.12.1
wsproto==1.0.0
WTForms==2.3.3
yapf==0.31.0
zeroconf==0.36.7
zipp==3.5.0"><pre class="notranslate"><code class="notranslate">pi@raspberrypi:~/restart/headunit $ pip3 freeze
aiofiles==0.7.0
ajsonrpc==1.2.0
alabaster==0.7.12
amqp==5.0.6
aniso8601==7.0.0
anyio==3.3.2
arduino-sketch==0.2
asgiref==3.4.1
asn1crypto==0.24.0
astroid==2.8.0
asttokens==1.1.13
attrs==21.2.0
automationhat==0.2.0
Babel==2.9.1
backcall==0.2.0
backports.entry-points-selectable==1.1.0
beautifulsoup4==4.7.1
billiard==3.6.4.0
black==21.9b0
blinker==1.4
blinkt==0.1.2
bottle==0.12.19
buttonshim==0.0.2
cached-property==1.5.1
Cap1xxx==0.1.3
celery==5.1.2
certifi==2018.8.24
cfgv==3.3.1
chardet==3.0.4
click==7.1.2
click-didyoumean==0.3.0
click-plugins==1.1.1
click-repl==0.2.0
colorama==0.3.7
colorzero==1.1
cookies==2.2.1
coverage==6.0.2
cryptography==2.6.1
cupshelpers==1.0
decorator==5.1.0
distlib==0.3.2
dnspython==1.16.0
docker==3.4.1
docker-compose==1.21.0
docker-pycreds==0.3.0
dockerpty==0.4.1
docopt==0.6.2
docutils==0.14
drumhat==0.1.0
email-validator==1.1.3
entrypoints==0.3
envirophat==1.0.0
ExplorerHAT==0.4.2
filelock==3.0.12
flake8==3.9.2
Flask==2.0.1
Flask-GraphQL==2.0.1
Flask-MongoAlchemy==0.7.2
flask-mongoengine==1.0.0
Flask-WTF==0.15.1
fourletterphat==0.1.0
gpiozero==1.6.2
graphene==2.1.9
graphene-mongo==0.2.13
graphql-core==2.3.2
graphql-relay==2.0.1
graphql-server-core==1.2.0
h11==0.12.0
html5lib==1.0.1
identify==2.2.15
idna==3.2
ifaddr==0.1.7
imagesize==1.2.0
importlib-metadata==4.8.1
iniconfig==1.1.1
ipython==7.28.0
iso8601==0.1.16
isort==5.9.3
itsdangerous==2.0.1
jedi==0.18.0
Jinja2==3.0.1
jsonschema==2.6.0
keyring==17.1.1
keyrings.alt==3.1.1
kombu==5.2.1
lazy-object-proxy==1.6.0
librabbitmq==2.0.0
logilab-common==1.4.2
lxml==4.3.2
MarkupSafe==2.0.1
marshmallow==3.13.0
matplotlib-inline==0.1.3
mccabe==0.6.1
microdotphat==0.2.1
MongoAlchemy==0.19
mongoengine==0.23.1
mote==0.0.4
motephat==0.0.3
mypy==0.670
mypy-extensions==0.4.3
nodeenv==1.6.0
numpy==1.16.2
oauthlib==2.1.0
olefile==0.46
packaging==21.0
pantilthat==0.0.7
parso==0.8.2
pathspec==0.9.0
pexpect==4.6.0
pgzero==1.2
phatbeat==0.1.1
pianohat==0.1.0
picamera==1.13
pickleshare==0.7.5
piglow==1.2.5
pigpio==1.78
pika==1.2.0
Pillow==5.4.1
platformdirs==2.3.0
platformio==5.2.0
pluggy==1.0.0
pre-commit==2.15.0
promise==2.3
prompt-toolkit==3.0.20
psutil==5.5.1
py==1.10.0
pycairo==1.16.2
pycodestyle==2.7.0
pycrypto==2.6.1
pycups==1.9.73
pyelftools==0.27
pyFirmata==1.1.0
pyflakes==2.3.1
pygame==1.9.4.post1
Pygments==2.3.1
PyGObject==3.30.4
pyinotify==0.9.6
PyJWT==1.7.0
pylint==2.11.1
pymata4==1.11
pymongo==3.12.0
pyOpenSSL==19.0.0
pyparsing==2.4.7
pyserial==3.5
pysmbc==1.0.15.6
pytest==6.2.5
pytest-cov==3.0.0
pytest-mock-resources==2.1.3
python-apt==1.8.4.3
python-dotenv==0.19.0
python-settings==0.2.2
pytz==2021.3
pyudev==0.22.0
pyxdg==0.25
PyYAML==5.4.1
rainbowhat==0.1.0
regex==2021.9.30
reportlab==3.5.13
requests==2.21.0
requests-oauthlib==1.0.0
responses==0.9.0
roman==2.0.0
RPi.GPIO==0.7.0
RTIMULib==7.2.1
Rx==1.6.1
SCons==4.2.0
scrollphat==0.0.7
scrollphathd==1.2.1
SecretStorage==2.3.1
semantic-version==2.8.5
Send2Trash==1.5.0
sense-hat==2.2.0
simplejson==3.16.0
singledispatch==3.7.0
six==1.12.0
skywriter==0.0.7
sn3218==1.2.7
sniffio==1.2.0
snowballstemmer==2.1.0
soupsieve==1.8
Sphinx==4.2.0
sphinxcontrib-applehelp==1.0.2
sphinxcontrib-devhelp==1.0.2
sphinxcontrib-htmlhelp==2.0.0
sphinxcontrib-jsmath==1.0.1
sphinxcontrib-qthelp==1.0.3
sphinxcontrib-serializinghtml==1.1.5
spidev==3.5
SQLAlchemy==1.4.25
ssh-import-id==5.7
starlette==0.16.0
tabulate==0.8.9
texttable==1.6.0
thonny==3.3.10
toml==0.10.2
tomli==1.2.1
touchphat==0.0.1
traitlets==5.1.0
twython==3.7.0
typed-ast==1.4.3
typing-extensions==3.10.0.2
unicornhathd==0.0.4
urllib3==1.24.1
uvicorn==0.15.0
vine==5.0.0
virtualenv==20.8.0
wcwidth==0.2.5
webencodings==0.5.1
websocket-client==0.53.0
Werkzeug==2.0.1
wrapt==1.12.1
wsproto==1.0.0
WTForms==2.3.3
yapf==0.31.0
zeroconf==0.36.7
zipp==3.5.0
</code></pre></div>
<p dir="auto"></p>
</details>
<h3 dir="auto">Other Dependencies</h3>
<details>
<p dir="auto">
N/A
</p>
</details>
<h2 dir="auto">Minimally Reproducible Test Case</h2>
<details>
<p dir="auto">
</p><div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content=""><pre class="notranslate"></pre></div>
<p dir="auto"></p>
</details>
<h1 dir="auto">Expected Behavior</h1>
<ul dir="auto">
<li>Background tasks are defined in a Flask application namespace using Celery and the <code class="notranslate">@app.task()</code> decorator</li>
<li>The results of each task is routed to a different queue on the broker</li>
</ul>
<p dir="auto">Celery is loaded</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="app = create_app()
celery = middleware(
app=app
)
def middleware(
app: Flask = None,
mq_host: str = None,
mq_port: int = None,
mq_user: str = None,
mq_password: str = None,
) -> Celery:
mq_host = "127.0.0.1" if mq_host is None else mq_host
mq_port = 5726 if mq_port is None else mq_port
# print(f"import name: {app.import_name}")
celery = Celery(
app.import_name,
backend='rpc://',
broker=broker_connection_string()
)
#celery.conf.task_default_queue = "metrics.system"
celery.conf.update(app.config)
class ContextTask(celery.Task):
def __call__(self, *args, **kwargs):
with app.app_context():
return self.run(*args, **kwargs)
celery.Task = ContextTask
return celery
"><pre class="notranslate"><span class="pl-s1">app</span> <span class="pl-c1">=</span> <span class="pl-en">create_app</span>()
<span class="pl-s1">celery</span> <span class="pl-c1">=</span> <span class="pl-en">middleware</span>(
<span class="pl-s1">app</span><span class="pl-c1">=</span><span class="pl-s1">app</span>
)
<span class="pl-k">def</span> <span class="pl-en">middleware</span>(
<span class="pl-s1">app</span>: <span class="pl-v">Flask</span> <span class="pl-c1">=</span> <span class="pl-c1">None</span>,
<span class="pl-s1">mq_host</span>: <span class="pl-s1">str</span> <span class="pl-c1">=</span> <span class="pl-c1">None</span>,
<span class="pl-s1">mq_port</span>: <span class="pl-s1">int</span> <span class="pl-c1">=</span> <span class="pl-c1">None</span>,
<span class="pl-s1">mq_user</span>: <span class="pl-s1">str</span> <span class="pl-c1">=</span> <span class="pl-c1">None</span>,
<span class="pl-s1">mq_password</span>: <span class="pl-s1">str</span> <span class="pl-c1">=</span> <span class="pl-c1">None</span>,
) <span class="pl-c1">-></span> <span class="pl-v">Celery</span>:
<span class="pl-s1">mq_host</span> <span class="pl-c1">=</span> <span class="pl-s">"127.0.0.1"</span> <span class="pl-k">if</span> <span class="pl-s1">mq_host</span> <span class="pl-c1">is</span> <span class="pl-c1">None</span> <span class="pl-k">else</span> <span class="pl-s1">mq_host</span>
<span class="pl-s1">mq_port</span> <span class="pl-c1">=</span> <span class="pl-c1">5726</span> <span class="pl-k">if</span> <span class="pl-s1">mq_port</span> <span class="pl-c1">is</span> <span class="pl-c1">None</span> <span class="pl-k">else</span> <span class="pl-s1">mq_port</span>
<span class="pl-c"># print(f"import name: {app.import_name}")</span>
<span class="pl-s1">celery</span> <span class="pl-c1">=</span> <span class="pl-v">Celery</span>(
<span class="pl-s1">app</span>.<span class="pl-s1">import_name</span>,
<span class="pl-s1">backend</span><span class="pl-c1">=</span><span class="pl-s">'rpc://'</span>,
<span class="pl-s1">broker</span><span class="pl-c1">=</span><span class="pl-en">broker_connection_string</span>()
)
<span class="pl-c">#celery.conf.task_default_queue = "metrics.system"</span>
<span class="pl-s1">celery</span>.<span class="pl-s1">conf</span>.<span class="pl-en">update</span>(<span class="pl-s1">app</span>.<span class="pl-s1">config</span>)
<span class="pl-k">class</span> <span class="pl-v">ContextTask</span>(<span class="pl-s1">celery</span>.<span class="pl-v">Task</span>):
<span class="pl-k">def</span> <span class="pl-en">__call__</span>(<span class="pl-s1">self</span>, <span class="pl-c1">*</span><span class="pl-s1">args</span>, <span class="pl-c1">**</span><span class="pl-s1">kwargs</span>):
<span class="pl-k">with</span> <span class="pl-s1">app</span>.<span class="pl-en">app_context</span>():
<span class="pl-k">return</span> <span class="pl-s1">self</span>.<span class="pl-en">run</span>(<span class="pl-c1">*</span><span class="pl-s1">args</span>, <span class="pl-c1">**</span><span class="pl-s1">kwargs</span>)
<span class="pl-s1">celery</span>.<span class="pl-v">Task</span> <span class="pl-c1">=</span> <span class="pl-v">ContextTask</span>
<span class="pl-k">return</span> <span class="pl-s1">celery</span></pre></div>
<p dir="auto">source is located <a href="https://github.com/apsamuel/workshop-ctrl-system/tree/main/pylibs/sidecars/metrics">here</a></p>
<p dir="auto">tasks are defined in the <code class="notranslate">app.py</code> file</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="@celery.task(
bind=True,
queue='metrics.system.vmem',
reply_to='metrics.system.vmem',
name='pylibs.sidecars.metrics.app.publish_vmem'
)
def publish_vmem(self):
metrics = SystemMetrics(interval=30)
mem = metrics.vmem()
return dumps(mem)
@celery.task(
bind=True,
queue='metrics.system.swap',
name='pylibs.sidecars.metrics.app.publish_swap'
)
def publish_swap(self):
metrics = SystemMetrics(interval=30)
swap = metrics.swap()
return dumps(swap)
#..."><pre class="notranslate"><span class="pl-en">@<span class="pl-s1">celery</span>.<span class="pl-en">task</span>(</span>
<span class="pl-en"> <span class="pl-s1">bind</span><span class="pl-c1">=</span><span class="pl-c1">True</span>, </span>
<span class="pl-en"> <span class="pl-s1">queue</span><span class="pl-c1">=</span><span class="pl-s">'metrics.system.vmem'</span>, </span>
<span class="pl-en"> <span class="pl-s1">reply_to</span><span class="pl-c1">=</span><span class="pl-s">'metrics.system.vmem'</span>,</span>
<span class="pl-en"> <span class="pl-s1">name</span><span class="pl-c1">=</span><span class="pl-s">'pylibs.sidecars.metrics.app.publish_vmem'</span> </span>
<span class="pl-en">)</span>
<span class="pl-k">def</span> <span class="pl-en">publish_vmem</span>(<span class="pl-s1">self</span>):
<span class="pl-s1">metrics</span> <span class="pl-c1">=</span> <span class="pl-v">SystemMetrics</span>(<span class="pl-s1">interval</span><span class="pl-c1">=</span><span class="pl-c1">30</span>)
<span class="pl-s1">mem</span> <span class="pl-c1">=</span> <span class="pl-s1">metrics</span>.<span class="pl-en">vmem</span>()
<span class="pl-k">return</span> <span class="pl-en">dumps</span>(<span class="pl-s1">mem</span>)
<span class="pl-en">@<span class="pl-s1">celery</span>.<span class="pl-en">task</span>(</span>
<span class="pl-en"> <span class="pl-s1">bind</span><span class="pl-c1">=</span><span class="pl-c1">True</span>, </span>
<span class="pl-en"> <span class="pl-s1">queue</span><span class="pl-c1">=</span><span class="pl-s">'metrics.system.swap'</span>, </span>
<span class="pl-en"> <span class="pl-s1">name</span><span class="pl-c1">=</span><span class="pl-s">'pylibs.sidecars.metrics.app.publish_swap'</span></span>
<span class="pl-en">)</span>
<span class="pl-k">def</span> <span class="pl-en">publish_swap</span>(<span class="pl-s1">self</span>):
<span class="pl-s1">metrics</span> <span class="pl-c1">=</span> <span class="pl-v">SystemMetrics</span>(<span class="pl-s1">interval</span><span class="pl-c1">=</span><span class="pl-c1">30</span>)
<span class="pl-s1">swap</span> <span class="pl-c1">=</span> <span class="pl-s1">metrics</span>.<span class="pl-en">swap</span>()
<span class="pl-k">return</span> <span class="pl-en">dumps</span>(<span class="pl-s1">swap</span>)
<span class="pl-c">#...</span></pre></div>
<p dir="auto">Example:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="In [84]: pylibs.sidecars.metrics.app.celery
Out[84]: <Celery pylibs.sidecars.metrics.metrics at 0xaff9d690>
In [91]: pylibs.sidecars.metrics.app.celery.amqp.queues
Out[91]:
{'default': <unbound Queue default -> [default->default]>,
'metrics.system': <unbound Queue metrics.system -> [metrics->metrics.system]>,
'metrics.system.vmem': <unbound Queue metrics.system.vmem -> [metrics->metrics.system.vmem]>,
'metrics.system.swap': <unbound Queue metrics.system.swap -> [metrics->metrics.system.swap]>,
'metrics.system.cputime': <unbound Queue metrics.system.cputime -> [metrics->metrics.system.cputime]>,
'metrics.system.cpustats': <unbound Queue metrics.system.cpustats -> [metrics->metrics.system.cpustats]>,
'metrics.system.temps': <unbound Queue metrics.system.temps -> [metrics->metrics.system.temps]>,
'metrics.system.diskusage': <unbound Queue metrics.system.diskusage -> [metrics->metrics.system.diskusage]>,
'metrics.system.netio': <unbound Queue metrics.system.netio -> [metrics->metrics.system.netio]>}
In [93]: pylibs.sidecars.metrics.app.celery.conf.task_queues
Out[93]:
(<unbound Queue default -> [default->default]>,
<unbound Queue metrics.system -> [metrics->metrics.system]>,
<unbound Queue metrics.system.vmem -> [metrics->metrics.system.vmem]>,
<unbound Queue metrics.system.swap -> [metrics->metrics.system.swap]>,
<unbound Queue metrics.system.cputime -> [metrics->metrics.system.cputime]>,
<unbound Queue metrics.system.cpustats -> [metrics->metrics.system.cpustats]>,
<unbound Queue metrics.system.temps -> [metrics->metrics.system.temps]>,
<unbound Queue metrics.system.diskusage -> [metrics->metrics.system.diskusage]>,
<unbound Queue metrics.system.netio -> [metrics->metrics.system.netio]>)"><pre lang="ipython" class="notranslate"><code class="notranslate">In [84]: pylibs.sidecars.metrics.app.celery
Out[84]: <Celery pylibs.sidecars.metrics.metrics at 0xaff9d690>
In [91]: pylibs.sidecars.metrics.app.celery.amqp.queues
Out[91]:
{'default': <unbound Queue default -> [default->default]>,
'metrics.system': <unbound Queue metrics.system -> [metrics->metrics.system]>,
'metrics.system.vmem': <unbound Queue metrics.system.vmem -> [metrics->metrics.system.vmem]>,
'metrics.system.swap': <unbound Queue metrics.system.swap -> [metrics->metrics.system.swap]>,
'metrics.system.cputime': <unbound Queue metrics.system.cputime -> [metrics->metrics.system.cputime]>,
'metrics.system.cpustats': <unbound Queue metrics.system.cpustats -> [metrics->metrics.system.cpustats]>,
'metrics.system.temps': <unbound Queue metrics.system.temps -> [metrics->metrics.system.temps]>,
'metrics.system.diskusage': <unbound Queue metrics.system.diskusage -> [metrics->metrics.system.diskusage]>,
'metrics.system.netio': <unbound Queue metrics.system.netio -> [metrics->metrics.system.netio]>}
In [93]: pylibs.sidecars.metrics.app.celery.conf.task_queues
Out[93]:
(<unbound Queue default -> [default->default]>,
<unbound Queue metrics.system -> [metrics->metrics.system]>,
<unbound Queue metrics.system.vmem -> [metrics->metrics.system.vmem]>,
<unbound Queue metrics.system.swap -> [metrics->metrics.system.swap]>,
<unbound Queue metrics.system.cputime -> [metrics->metrics.system.cputime]>,
<unbound Queue metrics.system.cpustats -> [metrics->metrics.system.cpustats]>,
<unbound Queue metrics.system.temps -> [metrics->metrics.system.temps]>,
<unbound Queue metrics.system.diskusage -> [metrics->metrics.system.diskusage]>,
<unbound Queue metrics.system.netio -> [metrics->metrics.system.netio]>)
</code></pre></div>
<p dir="auto">I have defined a beat schedule a follows, these tasks execute with no problem, however they are not routed to the queues defined in beat schedules.</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="celery.conf.update(beat_schedule = {
'publish-vmem-60s': {
'task': 'pylibs.sidecars.metrics.app.publish_vmem',
'schedule': 60.0,
'options': {
'queue': 'metrics.system.vmem',
'routing_key': 'metrics.system.vmem',
# 'exchange': 'metrics',
'exchange_type': 'direct',
'priority': 1,
},
},
'publish-swap-60s': {
'task': 'pylibs.sidecars.metrics.app.publish_swap',
'schedule': 60.0,
'options': {
'queue': 'metrics.system.swap',
'routing_key': 'metrics.system.swap',
# 'exchange': 'metrics',
'exchange_type': 'direct',
'priority': 1,
},
},
'publish-cputime-60s': {
'task': 'pylibs.sidecars.metrics.app.publish_cputime',
'schedule': 60.0,
'options': {
'queue': 'metrics.system.cputime',
'routing_key': 'metrics.system.cputime',
# 'exchange': 'metrics',
'exchange_type': 'direct',
'priority': 1,
},
},
'publish-cpustats-60s': {
'task': 'pylibs.sidecars.metrics.app.publish_cpustats',
'schedule': 60.0,
'options': {
'queue': 'metrics.system.cpustats',
'routing_key': 'metrics.system.cpustats',
#'exchange': 'metrics',
'exchange_type': 'direct',
'priority': 1,
},
},
'publish-temperature-60s': {
'task': 'pylibs.sidecars.metrics.app.publish_temps',
'schedule': 60.0,
'options': {
'queue': 'metrics.system.temps',
'routing_key': 'metrics.system.temps',
# 'exchange': 'metrics',
'exchange_type': 'direct',
'priority': 1,
},
},
'publish-disk-usage-60s': {
'task': 'pylibs.sidecars.metrics.app.publish_diskusage',
'schedule': 60.0,
'options': {
'queue': 'metrics.system.diskusage',
'routing_key': 'metrics.system.diskusage',
# 'exchange': 'metrics',
'exchange_type': 'direct',
'priority': 1,
},
},
'publish-netio-60s': {
'task': 'pylibs.sidecars.metrics.app.publish_netio',
'schedule': 60.0,
'options': {
'queue': 'metrics.system.netio',
'routing_key': 'metrics.system.netio',
# 'exchange': 'metrics',
'exchange_type': 'direct',
'priority': 1,
},
},
})"><pre class="notranslate"><span class="pl-s1">celery</span>.<span class="pl-s1">conf</span>.<span class="pl-en">update</span>(<span class="pl-s1">beat_schedule</span> <span class="pl-c1">=</span> {
<span class="pl-s">'publish-vmem-60s'</span>: {
<span class="pl-s">'task'</span>: <span class="pl-s">'pylibs.sidecars.metrics.app.publish_vmem'</span>,
<span class="pl-s">'schedule'</span>: <span class="pl-c1">60.0</span>,
<span class="pl-s">'options'</span>: {
<span class="pl-s">'queue'</span>: <span class="pl-s">'metrics.system.vmem'</span>,
<span class="pl-s">'routing_key'</span>: <span class="pl-s">'metrics.system.vmem'</span>,
<span class="pl-c"># 'exchange': 'metrics', </span>
<span class="pl-s">'exchange_type'</span>: <span class="pl-s">'direct'</span>,
<span class="pl-s">'priority'</span>: <span class="pl-c1">1</span>,
},
},
<span class="pl-s">'publish-swap-60s'</span>: {
<span class="pl-s">'task'</span>: <span class="pl-s">'pylibs.sidecars.metrics.app.publish_swap'</span>,
<span class="pl-s">'schedule'</span>: <span class="pl-c1">60.0</span>,
<span class="pl-s">'options'</span>: {
<span class="pl-s">'queue'</span>: <span class="pl-s">'metrics.system.swap'</span>,
<span class="pl-s">'routing_key'</span>: <span class="pl-s">'metrics.system.swap'</span>,
<span class="pl-c"># 'exchange': 'metrics', </span>
<span class="pl-s">'exchange_type'</span>: <span class="pl-s">'direct'</span>,
<span class="pl-s">'priority'</span>: <span class="pl-c1">1</span>,
},
},
<span class="pl-s">'publish-cputime-60s'</span>: {
<span class="pl-s">'task'</span>: <span class="pl-s">'pylibs.sidecars.metrics.app.publish_cputime'</span>,
<span class="pl-s">'schedule'</span>: <span class="pl-c1">60.0</span>,
<span class="pl-s">'options'</span>: {
<span class="pl-s">'queue'</span>: <span class="pl-s">'metrics.system.cputime'</span>,
<span class="pl-s">'routing_key'</span>: <span class="pl-s">'metrics.system.cputime'</span>,
<span class="pl-c"># 'exchange': 'metrics', </span>
<span class="pl-s">'exchange_type'</span>: <span class="pl-s">'direct'</span>,
<span class="pl-s">'priority'</span>: <span class="pl-c1">1</span>,
},
},
<span class="pl-s">'publish-cpustats-60s'</span>: {
<span class="pl-s">'task'</span>: <span class="pl-s">'pylibs.sidecars.metrics.app.publish_cpustats'</span>,
<span class="pl-s">'schedule'</span>: <span class="pl-c1">60.0</span>,
<span class="pl-s">'options'</span>: {
<span class="pl-s">'queue'</span>: <span class="pl-s">'metrics.system.cpustats'</span>,
<span class="pl-s">'routing_key'</span>: <span class="pl-s">'metrics.system.cpustats'</span>,
<span class="pl-c">#'exchange': 'metrics', </span>
<span class="pl-s">'exchange_type'</span>: <span class="pl-s">'direct'</span>,
<span class="pl-s">'priority'</span>: <span class="pl-c1">1</span>,
},
},
<span class="pl-s">'publish-temperature-60s'</span>: {
<span class="pl-s">'task'</span>: <span class="pl-s">'pylibs.sidecars.metrics.app.publish_temps'</span>,
<span class="pl-s">'schedule'</span>: <span class="pl-c1">60.0</span>,
<span class="pl-s">'options'</span>: {
<span class="pl-s">'queue'</span>: <span class="pl-s">'metrics.system.temps'</span>,
<span class="pl-s">'routing_key'</span>: <span class="pl-s">'metrics.system.temps'</span>,
<span class="pl-c"># 'exchange': 'metrics', </span>
<span class="pl-s">'exchange_type'</span>: <span class="pl-s">'direct'</span>,
<span class="pl-s">'priority'</span>: <span class="pl-c1">1</span>,
},
},
<span class="pl-s">'publish-disk-usage-60s'</span>: {
<span class="pl-s">'task'</span>: <span class="pl-s">'pylibs.sidecars.metrics.app.publish_diskusage'</span>,
<span class="pl-s">'schedule'</span>: <span class="pl-c1">60.0</span>,
<span class="pl-s">'options'</span>: {
<span class="pl-s">'queue'</span>: <span class="pl-s">'metrics.system.diskusage'</span>,
<span class="pl-s">'routing_key'</span>: <span class="pl-s">'metrics.system.diskusage'</span>,
<span class="pl-c"># 'exchange': 'metrics', </span>
<span class="pl-s">'exchange_type'</span>: <span class="pl-s">'direct'</span>,
<span class="pl-s">'priority'</span>: <span class="pl-c1">1</span>,
},
},
<span class="pl-s">'publish-netio-60s'</span>: {
<span class="pl-s">'task'</span>: <span class="pl-s">'pylibs.sidecars.metrics.app.publish_netio'</span>,
<span class="pl-s">'schedule'</span>: <span class="pl-c1">60.0</span>,
<span class="pl-s">'options'</span>: {
<span class="pl-s">'queue'</span>: <span class="pl-s">'metrics.system.netio'</span>,
<span class="pl-s">'routing_key'</span>: <span class="pl-s">'metrics.system.netio'</span>,
<span class="pl-c"># 'exchange': 'metrics', </span>
<span class="pl-s">'exchange_type'</span>: <span class="pl-s">'direct'</span>,
<span class="pl-s">'priority'</span>: <span class="pl-c1">1</span>,
},
},
})</pre></div>
<h1 dir="auto">Actual Behavior</h1>
<p dir="auto">tasks don't get routed to the queues defined in the beat schedule but instead are routed to the auto-generated task queue for celery (or hardcoded in <code class="notranslate">@app.task(queue=<queue>)</code></p>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="pi@raspberrypi:~/restart/headunit $ ./dev/rabbitmqadmin list queues
+-----------------------------------------------+----------+
| name | messages |
+-----------------------------------------------+----------+
| 2aa4c2ac-4f30-348f-9eec-44103f41a86f | 535 | <-- wrong queue
| celery@raspberrypi.celery.pidbox | 0 |
| celeryev.4ccf8ffd-cfa4-4143-a0b2-3fc51576d695 | 0 |
| celeryev.7e381597-0755-4c91-84aa-88faee6d8f7c | 0 |
| default | 0 |
| metrics.system | 0 |
| metrics.system.cpustats | 0 |
| metrics.system.cputime | 0 |
| metrics.system.diskusage | 0 |
| metrics.system.netio | 0 |
| metrics.system.swap | 0 |
| metrics.system.temps | 0 |
| metrics.system.vmem | 0 |
+-----------------------------------------------+----------+"><pre class="notranslate">pi@raspberrypi:<span class="pl-k">~</span>/restart/headunit $ ./dev/rabbitmqadmin list queues
+-----------------------------------------------+----------+
<span class="pl-k">|</span> name <span class="pl-k">|</span> messages <span class="pl-k">|</span>
+-----------------------------------------------+----------+
<span class="pl-k">|</span> 2aa4c2ac-4f30-348f-9eec-44103f41a86f <span class="pl-k">|</span> 535 <span class="pl-k">|</span> <span class="pl-k"><</span>-- wrong queue
<span class="pl-k">|</span> celery@raspberrypi.celery.pidbox <span class="pl-k">|</span> 0 <span class="pl-k">|</span>
<span class="pl-k">|</span> celeryev.4ccf8ffd-cfa4-4143-a0b2-3fc51576d695 <span class="pl-k">|</span> 0 <span class="pl-k">|</span>
<span class="pl-k">|</span> celeryev.7e381597-0755-4c91-84aa-88faee6d8f7c <span class="pl-k">|</span> 0 <span class="pl-k">|</span>
<span class="pl-k">|</span> default <span class="pl-k">|</span> 0 <span class="pl-k">|</span>
<span class="pl-k">|</span> metrics.system <span class="pl-k">|</span> 0 <span class="pl-k">|</span>
<span class="pl-k">|</span> metrics.system.cpustats <span class="pl-k">|</span> 0 <span class="pl-k">|</span>
<span class="pl-k">|</span> metrics.system.cputime <span class="pl-k">|</span> 0 <span class="pl-k">|</span>
<span class="pl-k">|</span> metrics.system.diskusage <span class="pl-k">|</span> 0 <span class="pl-k">|</span>
<span class="pl-k">|</span> metrics.system.netio <span class="pl-k">|</span> 0 <span class="pl-k">|</span>
<span class="pl-k">|</span> metrics.system.swap <span class="pl-k">|</span> 0 <span class="pl-k">|</span>
<span class="pl-k">|</span> metrics.system.temps <span class="pl-k">|</span> 0 <span class="pl-k">|</span>
<span class="pl-k">|</span> metrics.system.vmem <span class="pl-k">|</span> 0 <span class="pl-k">|</span>
+-----------------------------------------------+----------+</pre></div> | <p dir="auto">This doesn't happen on 4.4.3, only on 4.4.4.</p>
<p dir="auto">Here is a traceback:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="celery_default_1 | [2020-06-04 19:51:47,723: ERROR/MainProcess] Pool callback raised exception: TypeError('set() takes 3 positional arguments but 4 were given',)
celery_default_1 | Traceback (most recent call last):
celery_default_1 | File "/usr/share/dashboard/venv/lib/python3.6/site-packages/billiard/pool.py", line 1796, in safe_apply_callback
celery_default_1 | fun(*args, **kwargs)
celery_default_1 | File "/usr/share/dashboard/venv/lib/python3.6/site-packages/celery/worker/request.py", line 528, in on_failure
celery_default_1 | store_result=self.store_errors,
celery_default_1 | File "/usr/share/dashboard/venv/lib/python3.6/site-packages/celery/backends/base.py", line 169, in mark_as_failure
celery_default_1 | traceback=traceback, request=request)
celery_default_1 | File "/usr/share/dashboard/venv/lib/python3.6/site-packages/celery/backends/base.py", line 443, in store_result
celery_default_1 | request=request, **kwargs)
celery_default_1 | File "/usr/share/dashboard/venv/lib/python3.6/site-packages/celery/backends/base.py", line 858, in _store_result
celery_default_1 | self.set(self.get_key_for_task(task_id), self.encode(meta), state)
celery_default_1 | TypeError: set() takes 3 positional arguments but 4 were given"><pre class="notranslate"><code class="notranslate">celery_default_1 | [2020-06-04 19:51:47,723: ERROR/MainProcess] Pool callback raised exception: TypeError('set() takes 3 positional arguments but 4 were given',)
celery_default_1 | Traceback (most recent call last):
celery_default_1 | File "/usr/share/dashboard/venv/lib/python3.6/site-packages/billiard/pool.py", line 1796, in safe_apply_callback
celery_default_1 | fun(*args, **kwargs)
celery_default_1 | File "/usr/share/dashboard/venv/lib/python3.6/site-packages/celery/worker/request.py", line 528, in on_failure
celery_default_1 | store_result=self.store_errors,
celery_default_1 | File "/usr/share/dashboard/venv/lib/python3.6/site-packages/celery/backends/base.py", line 169, in mark_as_failure
celery_default_1 | traceback=traceback, request=request)
celery_default_1 | File "/usr/share/dashboard/venv/lib/python3.6/site-packages/celery/backends/base.py", line 443, in store_result
celery_default_1 | request=request, **kwargs)
celery_default_1 | File "/usr/share/dashboard/venv/lib/python3.6/site-packages/celery/backends/base.py", line 858, in _store_result
celery_default_1 | self.set(self.get_key_for_task(task_id), self.encode(meta), state)
celery_default_1 | TypeError: set() takes 3 positional arguments but 4 were given
</code></pre></div>
<p dir="auto">I am running on Python 3.6 on Bionic.</p>
<p dir="auto">For now I've stuck to 4.4.3 as 4.4.4 keeps throwing this exception.</p>
<h1 dir="auto">Checklist</h1>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have verified that the issue exists against the <code class="notranslate">master</code> branch of Celery.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> This has already been asked to the <a href="https://groups.google.com/forum/#!forum/celery-users" rel="nofollow">discussion group</a> first.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have read the relevant section in the<br>
<a href="http://docs.celeryproject.org/en/latest/contributing.html#other-bugs" rel="nofollow">contribution guide</a><br>
on reporting bugs.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have checked the <a href="https://github.com/celery/celery/issues?q=is%3Aissue+label%3A%22Issue+Type%3A+Bug+Report%22+-label%3A%22Category%3A+Documentation%22">issues list</a><br>
for similar or identical bug reports.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have checked the <a href="https://github.com/celery/celery/pulls?q=is%3Apr+label%3A%22PR+Type%3A+Bugfix%22+-label%3A%22Category%3A+Documentation%22">pull requests list</a><br>
for existing proposed fixes.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have checked the <a href="https://github.com/celery/celery/commits/master">commit log</a><br>
to find out if the bug was already fixed in the master branch.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have included all related issues and possible duplicate issues<br>
in this issue (If there are none, check this box anyway).</li>
</ul>
<h2 dir="auto">Mandatory Debugging Information</h2>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have included the output of <code class="notranslate">celery -A proj report</code> in the issue.<br>
(if you are not able to do this, then at least specify the Celery<br>
version affected).</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have verified that the issue exists against the <code class="notranslate">master</code> branch of Celery.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have included the contents of <code class="notranslate">pip freeze</code> in the issue.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have included all the versions of all the external dependencies required<br>
to reproduce this bug.</li>
</ul>
<h2 dir="auto">Optional Debugging Information</h2>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have tried reproducing the issue on more than one Python version<br>
and/or implementation.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have tried reproducing the issue on more than one message broker and/or<br>
result backend.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have tried reproducing the issue on more than one version of the message<br>
broker and/or result backend.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have tried reproducing the issue on more than one operating system.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have tried reproducing the issue on more than one workers pool.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have tried reproducing the issue with autoscaling, retries,<br>
ETA/Countdown & rate limits disabled.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have tried reproducing the issue after downgrading<br>
and/or upgrading Celery and its dependencies.</li>
</ul>
<h2 dir="auto">Related Issues and Possible Duplicates</h2>
<h4 dir="auto">Related Issues</h4>
<ul dir="auto">
<li>None</li>
</ul>
<h4 dir="auto">Possible Duplicates</h4>
<ul dir="auto">
<li>None</li>
</ul>
<h2 dir="auto">Environment & Settings</h2>
<p dir="auto">4.4.4</p>
<details>
<summary><b><code class="notranslate">celery report</code> Output:</b></summary>
<p dir="auto">
</p><div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="software -> celery:4.4.4 (cliffs) kombu:4.6.10 py:3.6.10
billiard:3.6.3.0 py-amqp:2.6.0
platform -> system:Linux arch:64bit, ELF
kernel version:5.3.0-51-generic imp:CPython
loader -> celery.loaders.default.Loader
settings -> transport:amqp results:disabled"><pre class="notranslate"><code class="notranslate">software -> celery:4.4.4 (cliffs) kombu:4.6.10 py:3.6.10
billiard:3.6.3.0 py-amqp:2.6.0
platform -> system:Linux arch:64bit, ELF
kernel version:5.3.0-51-generic imp:CPython
loader -> celery.loaders.default.Loader
settings -> transport:amqp results:disabled
</code></pre></div>
<p dir="auto"></p>
</details>
<h1 dir="auto">Steps to Reproduce</h1>
<h2 dir="auto">Required Dependencies</h2>
<ul dir="auto">
<li><strong>Minimal Python Version</strong>: 3.6.10</li>
<li><strong>Minimal Celery Version</strong>: 4.4.4</li>
<li><strong>Minimal Kombu Version</strong>: 4.6.10</li>
<li><strong>Minimal Broker Version</strong>: N/A or Unknown</li>
<li><strong>Minimal Result Backend Version</strong>: N/A or Unknown</li>
<li><strong>Minimal OS and/or Kernel Version</strong>: Ubuntu 18.04 + 5.3 kernel</li>
<li><strong>Minimal Broker Client Version</strong>: N/A or Unknown</li>
<li><strong>Minimal Result Backend Client Version</strong>: N/A or Unknown</li>
</ul>
<h3 dir="auto">Python Packages</h3>
<details>
<summary><b><code class="notranslate">pip freeze</code> Output:</b></summary>
<p dir="auto">
</p><div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="amqp==2.6.0
argh==0.26.2
asgiref==3.2.7
Babel==2.8.0
backcall==0.1.0
billiard==3.6.3.0
celery==4.4.4
certifi==2020.4.5.1
chardet==3.0.4
click==7.1.2
coverage==5.1
decorator==4.4.2
defusedxml==0.5.0
Django==2.2.13
django-celery-beat==2.0.0
django-celery-results==1.2.1
django-crispy-forms==1.9.1
django-csp==3.6
django-extensions==2.2.9
django-nose==1.4.6
django-redis==4.12.1
django-timezone-field==4.0
djangorestframework==3.11.0
flower==0.9.3
ftputil==3.4
future==0.18.2
gunicorn==20.0.4
hiredis==1.0.1
icalendar==4.0.6
idna==2.9
importlib-metadata==1.6.0
ipdb==0.13.2
ipdbplugin==1.5.0
ipython==7.15.0
ipython-genutils==0.2.0
isort==4.3.21
jedi==0.17.0
jsonfield==2.0.2
kombu==4.6.10
lxml==4.3.5
nose==1.3.7
parso==0.7.0
pathtools==0.1.2
pexpect==4.8.0
pickleshare==0.7.5
Pillow==5.4.1
prompt-toolkit==3.0.5
psycopg2==2.8.5
ptyprocess==0.6.0
pycodestyle==2.6.0
pyflakes==2.2.0
Pygments==2.6.1
python-crontab==2.5.1
python-dateutil==2.8.1
pytz==2020.1
PyYAML==5.2
raven==6.10.0
redis==3.5.3
requests==2.23.0
single-beat==0.4.1
six==1.15.0
sqlparse==0.3.1
suds-jurko==0.6
tornadis==0.8.1
tornado==5.1.1
traitlets==4.3.3
urllib3==1.25.9
vine==1.3.0
watchdog==0.9.0
wcwidth==0.2.3
whitenoise==5.1.0
zipp==3.1.0"><pre class="notranslate"><code class="notranslate">amqp==2.6.0
argh==0.26.2
asgiref==3.2.7
Babel==2.8.0
backcall==0.1.0
billiard==3.6.3.0
celery==4.4.4
certifi==2020.4.5.1
chardet==3.0.4
click==7.1.2
coverage==5.1
decorator==4.4.2
defusedxml==0.5.0
Django==2.2.13
django-celery-beat==2.0.0
django-celery-results==1.2.1
django-crispy-forms==1.9.1
django-csp==3.6
django-extensions==2.2.9
django-nose==1.4.6
django-redis==4.12.1
django-timezone-field==4.0
djangorestframework==3.11.0
flower==0.9.3
ftputil==3.4
future==0.18.2
gunicorn==20.0.4
hiredis==1.0.1
icalendar==4.0.6
idna==2.9
importlib-metadata==1.6.0
ipdb==0.13.2
ipdbplugin==1.5.0
ipython==7.15.0
ipython-genutils==0.2.0
isort==4.3.21
jedi==0.17.0
jsonfield==2.0.2
kombu==4.6.10
lxml==4.3.5
nose==1.3.7
parso==0.7.0
pathtools==0.1.2
pexpect==4.8.0
pickleshare==0.7.5
Pillow==5.4.1
prompt-toolkit==3.0.5
psycopg2==2.8.5
ptyprocess==0.6.0
pycodestyle==2.6.0
pyflakes==2.2.0
Pygments==2.6.1
python-crontab==2.5.1
python-dateutil==2.8.1
pytz==2020.1
PyYAML==5.2
raven==6.10.0
redis==3.5.3
requests==2.23.0
single-beat==0.4.1
six==1.15.0
sqlparse==0.3.1
suds-jurko==0.6
tornadis==0.8.1
tornado==5.1.1
traitlets==4.3.3
urllib3==1.25.9
vine==1.3.0
watchdog==0.9.0
wcwidth==0.2.3
whitenoise==5.1.0
zipp==3.1.0
</code></pre></div>
<p dir="auto"></p>
</details>
<h3 dir="auto">Other Dependencies</h3>
<details>
<p dir="auto">
</p><div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Ubuntu 18.04
Redis
Postgres 10"><pre class="notranslate"><code class="notranslate">Ubuntu 18.04
Redis
Postgres 10
</code></pre></div>
<p dir="auto"></p>
</details>
<h2 dir="auto">Minimally Reproducible Test Case</h2>
<details>
<p dir="auto">
</p><div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content=""><pre class="notranslate"></pre></div>
<p dir="auto"></p>
</details>
<h1 dir="auto">Expected Behavior</h1>
<h1 dir="auto">Actual Behavior</h1> | 0 |
<p dir="auto">TypeScript should support emitting minified JavaScript.</p>
<p dir="auto">There are several different things we could support:</p>
<ol dir="auto">
<li>Just remove whitespace</li>
<li>Minify unobservable identifiers</li>
<li>Remove provably dead code</li>
<li>Whole-program minification (i.e. closure compiler)</li>
<li>(Others?)</li>
</ol> | <p dir="auto">For completeness's sake, this is a list of breaking changes from the 1.0 compiler that we believe very few users will encounter.</p>
<p dir="auto">These are errors that should have been reported and represent very likely errors in user code:</p>
<ul dir="auto">
<li>Comparison operators (<, >) more correctly check their operands for compatibility</li>
<li><code class="notranslate">typeof undefined</code> is now <code class="notranslate">undefined</code>, not <code class="notranslate">any</code></li>
</ul>
<p dir="auto">These mainly cover how certain TypeScript language constructs are emitted in the presence of serious errors in the code:</p>
<ul dir="auto">
<li>Classes with constructor overloads lacking an implementation, or with multiple implementations: emit has changed</li>
<li>Duplicate <code class="notranslate">export =</code> assignments emit has changed</li>
<li>Uses of <code class="notranslate">this</code> in fat arrow function expressions in static initializers no longer capture <code class="notranslate">this</code></li>
<li>Nonsense circular external module declarations are now an error</li>
<li>Some constructs which are early errors in JavaScript are now considered as parse errors</li>
<li>Invalid uses of <code class="notranslate">super</code> in fat arrow function expressions emit has changed</li>
</ul>
<p dir="auto">Emit in some cases has changed to semantically-equivalent, but better, code:</p>
<ul dir="auto">
<li>Array copy code for unused rest parameters is no longer emitted</li>
<li>Exact emit for certain boilerplate constructs (rest args, default parameter values) has changed</li>
</ul> | 0 |
<h1 dir="auto">Checklist</h1>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have verified that the issue exists against the <code class="notranslate">master</code> branch of Celery.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> This has already been asked to the <a href="https://groups.google.com/forum/#!forum/celery-users" rel="nofollow">discussion group</a> first.<br>
-- <a href="https://groups.google.com/g/celery-users/c/uqCUtMUu8XY" rel="nofollow">https://groups.google.com/g/celery-users/c/uqCUtMUu8XY</a></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have read the relevant section in the<br>
<a href="http://docs.celeryproject.org/en/latest/contributing.html#other-bugs" rel="nofollow">contribution guide</a><br>
on reporting bugs.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have checked the <a href="https://github.com/celery/celery/issues?q=is%3Aissue+label%3A%22Issue+Type%3A+Bug+Report%22+-label%3A%22Category%3A+Documentation%22">issues list</a><br>
for similar or identical bug reports.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have checked the <a href="https://github.com/celery/celery/pulls?q=is%3Apr+label%3A%22PR+Type%3A+Bugfix%22+-label%3A%22Category%3A+Documentation%22">pull requests list</a><br>
for existing proposed fixes.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have checked the <a href="https://github.com/celery/celery/commits/master">commit log</a><br>
to find out if the bug was already fixed in the master branch.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have included all related issues and possible duplicate issues<br>
in this issue (If there are none, check this box anyway).</li>
</ul>
<h2 dir="auto">Mandatory Debugging Information</h2>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have included the output of <code class="notranslate">celery -A proj report</code> in the issue.<br>
(if you are not able to do this, then at least specify the Celery<br>
version affected).</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have verified that the issue exists against the <code class="notranslate">master</code> branch of Celery.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have included the contents of <code class="notranslate">pip freeze</code> in the issue.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have included all the versions of all the external dependencies required<br>
to reproduce this bug.</li>
</ul>
<h2 dir="auto">Optional Debugging Information</h2>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have tried reproducing the issue on more than one Python version<br>
and/or implementation.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have tried reproducing the issue on more than one message broker and/or<br>
result backend.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have tried reproducing the issue on more than one version of the message<br>
broker and/or result backend.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have tried reproducing the issue on more than one operating system.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have tried reproducing the issue on more than one workers pool.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have tried reproducing the issue with autoscaling, retries,<br>
ETA/Countdown & rate limits disabled.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have tried reproducing the issue after downgrading<br>
and/or upgrading Celery and its dependencies.</li>
</ul>
<h2 dir="auto">Related Issues and Possible Duplicates</h2>
<h4 dir="auto">Related Issues</h4>
<ul dir="auto">
<li>None</li>
</ul>
<h4 dir="auto">Possible Duplicates</h4>
<ul dir="auto">
<li>None</li>
</ul>
<h2 dir="auto">Environment & Settings</h2>
<p dir="auto"><strong>Celery version</strong>: 5.0.5 (singularity)</p>
<details>
<summary><b><code class="notranslate">celery report</code> Output:</b></summary>
<p dir="auto">
</p><div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="software -> celery:5.0.5 (singularity) kombu:5.0.2 py:3.7.6
billiard:3.6.3.0 redis:3.5.3
platform -> system:Darwin arch:64bit
kernel version:17.7.0 imp:CPython
loader -> celery.loaders.app.AppLoader
settings -> transport:redis results:redis://localhost:6379/0
broker_url: 'redis://localhost:6379/0'
result_backend: 'redis://lo"><pre class="notranslate"><code class="notranslate">software -> celery:5.0.5 (singularity) kombu:5.0.2 py:3.7.6
billiard:3.6.3.0 redis:3.5.3
platform -> system:Darwin arch:64bit
kernel version:17.7.0 imp:CPython
loader -> celery.loaders.app.AppLoader
settings -> transport:redis results:redis://localhost:6379/0
broker_url: 'redis://localhost:6379/0'
result_backend: 'redis://lo
</code></pre></div>
<p dir="auto"></p>
</details>
<h1 dir="auto">Steps to Reproduce</h1>
<h2 dir="auto">Required Dependencies</h2>
<ul dir="auto">
<li><strong>Minimal Python Version</strong>: N/A or Unknown</li>
<li><strong>Minimal Celery Version</strong>: 5.0.0</li>
<li><strong>Minimal Kombu Version</strong>: N/A or Unknown</li>
<li><strong>Minimal Broker Version</strong>: N/A or Unknown</li>
<li><strong>Minimal Result Backend Version</strong>: N/A or Unknown</li>
<li><strong>Minimal OS and/or Kernel Version</strong>: N/A or Unknown</li>
<li><strong>Minimal Broker Client Version</strong>: N/A or Unknown</li>
<li><strong>Minimal Result Backend Client Version</strong>: N/A or Unknown</li>
</ul>
<h3 dir="auto">Python Packages</h3>
<details>
<summary><b><code class="notranslate">pip freeze</code> Output:</b></summary>
<p dir="auto">
</p><div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="amqp==5.0.2
billiard==3.6.3.0
celery @ git+https://github.com/celery/celery.git@491054f2724141cbff20731753379459af033bfd
click==7.1.2
click-didyoumean==0.0.3
click-plugins==1.1.1
click-repl==0.1.6
importlib-metadata==3.3.0
kombu==5.0.2
prompt-toolkit==3.0.8
pytz==2020.4
redis==3.5.3
six==1.15.0
typing-extensions==3.7.4.3
vine==5.0.0
wcwidth==0.2.5
zipp==3.4.0"><pre class="notranslate"><code class="notranslate">amqp==5.0.2
billiard==3.6.3.0
celery @ git+https://github.com/celery/celery.git@491054f2724141cbff20731753379459af033bfd
click==7.1.2
click-didyoumean==0.0.3
click-plugins==1.1.1
click-repl==0.1.6
importlib-metadata==3.3.0
kombu==5.0.2
prompt-toolkit==3.0.8
pytz==2020.4
redis==3.5.3
six==1.15.0
typing-extensions==3.7.4.3
vine==5.0.0
wcwidth==0.2.5
zipp==3.4.0
</code></pre></div>
<p dir="auto"></p>
</details>
<h3 dir="auto">Other Dependencies</h3>
<details>
<p dir="auto">
N/A
</p>
</details>
<h2 dir="auto">Minimally Reproducible Test Case</h2>
<details>
<p dir="auto">
</p><p dir="auto">app.py</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="from celery import Celery
app = Celery(broker='redis://localhost:6379/0', backend='redis://localhost:6379/0')
@app.task(bind=True)
def worker_name(self):
return self.request.hostname"><pre class="notranslate"><code class="notranslate">from celery import Celery
app = Celery(broker='redis://localhost:6379/0', backend='redis://localhost:6379/0')
@app.task(bind=True)
def worker_name(self):
return self.request.hostname
</code></pre></div>
<p dir="auto">main.py</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="from app import worker_name
res = worker_name.delay()
print(res.get())"><pre class="notranslate"><code class="notranslate">from app import worker_name
res = worker_name.delay()
print(res.get())
</code></pre></div>
<p dir="auto"></p>
</details>
<h1 dir="auto">Expected Behavior</h1>
<p dir="auto">As described in the documentation <code class="notranslate">task.request.hostname</code> should be the node name of the worker instance executing the task. See <a href="https://docs.celeryproject.org/en/latest/userguide/tasks.html#task-request-info" rel="nofollow">https://docs.celeryproject.org/en/latest/userguide/tasks.html#task-request-info</a></p>
<h1 dir="auto">Actual Behavior</h1>
<p dir="auto"><code class="notranslate">task.request.hostname</code> no longer contains the node name of the worker. Only the hostname of the worker. For example if the worker is started with <code class="notranslate">-n whoopsie@%h</code> only the <code class="notranslate">%h</code> bit is included in <code class="notranslate">task.request.hostname</code>. In fact if the worker is started <code class="notranslate">-n whoopsie@computer</code> it will still only report the hostname of the worker machine and not what has been put into the node name.</p>
<p dir="auto">This issue appeared between v4.4.7 and v5.0.0 and is present in current master. It is really useful for debugging purposes to know what exact worker instance a task is executed in if there are multiple workers on the same host.</p>
<p dir="auto">It appears that the worker is at least aware of its worker name based on the worker logs:</p>
<details>
<summary><b><code class="notranslate">celery -A app.app worker -n whoopsie@computer --loglevel=DEBUG</code></b></summary>
<p dir="auto">
</p><div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="[2020-12-22 10:40:06,971: DEBUG/MainProcess] | Worker: Preparing bootsteps.
[2020-12-22 10:40:06,973: DEBUG/MainProcess] | Worker: Building graph...
[2020-12-22 10:40:06,974: DEBUG/MainProcess] | Worker: New boot order: {Timer, Hub, Pool, Autoscaler, StateDB, Beat, Consumer}
[2020-12-22 10:40:06,986: DEBUG/MainProcess] | Consumer: Preparing bootsteps.
[2020-12-22 10:40:06,987: DEBUG/MainProcess] | Consumer: Building graph...
[2020-12-22 10:40:07,014: DEBUG/MainProcess] | Consumer: New boot order: {Connection, Events, Heart, Mingle, Tasks, Control, Agent, Gossip, event loop}
-------------- whoopsie@computer v5.0.5 (singularity)
--- ***** -----
-- ******* ---- Darwin-17.7.0-x86_64-i386-64bit 2020-12-22 10:40:07
- *** --- * ---
- ** ---------- [config]
- ** ---------- .> app: __main__:0x10f0db990
- ** ---------- .> transport: redis://localhost:6379/0
- ** ---------- .> results: redis://localhost:6379/0
- *** --- * --- .> concurrency: 4 (prefork)
-- ******* ---- .> task events: OFF (enable -E to monitor tasks in this worker)
--- ***** -----
-------------- [queues]
.> celery exchange=celery(direct) key=celery
[tasks]
. app.worker_name
. celery.accumulate
. celery.backend_cleanup
. celery.chain
. celery.chord
. celery.chord_unlock
. celery.chunks
. celery.group
. celery.map
. celery.starmap
[2020-12-22 10:40:07,041: DEBUG/MainProcess] | Worker: Starting Hub
[2020-12-22 10:40:07,041: DEBUG/MainProcess] ^-- substep ok
[2020-12-22 10:40:07,042: DEBUG/MainProcess] | Worker: Starting Pool
[2020-12-22 10:40:07,237: DEBUG/MainProcess] ^-- substep ok
[2020-12-22 10:40:07,238: DEBUG/MainProcess] | Worker: Starting Consumer
[2020-12-22 10:40:07,239: DEBUG/MainProcess] | Consumer: Starting Connection
[2020-12-22 10:40:07,286: INFO/MainProcess] Connected to redis://localhost:6379/0
[2020-12-22 10:40:07,287: DEBUG/MainProcess] ^-- substep ok
[2020-12-22 10:40:07,287: DEBUG/MainProcess] | Consumer: Starting Events
[2020-12-22 10:40:07,310: DEBUG/MainProcess] ^-- substep ok
[2020-12-22 10:40:07,311: DEBUG/MainProcess] | Consumer: Starting Heart
[2020-12-22 10:40:07,317: DEBUG/MainProcess] ^-- substep ok
[2020-12-22 10:40:07,317: DEBUG/MainProcess] | Consumer: Starting Mingle
[2020-12-22 10:40:07,317: INFO/MainProcess] mingle: searching for neighbors
[2020-12-22 10:40:08,397: INFO/MainProcess] mingle: all alone
[2020-12-22 10:40:08,397: DEBUG/MainProcess] ^-- substep ok
[2020-12-22 10:40:08,397: DEBUG/MainProcess] | Consumer: Starting Tasks
[2020-12-22 10:40:08,405: DEBUG/MainProcess] ^-- substep ok
[2020-12-22 10:40:08,405: DEBUG/MainProcess] | Consumer: Starting Control
[2020-12-22 10:40:08,422: DEBUG/MainProcess] ^-- substep ok
[2020-12-22 10:40:08,423: DEBUG/MainProcess] | Consumer: Starting Gossip
[2020-12-22 10:40:08,446: DEBUG/MainProcess] ^-- substep ok
[2020-12-22 10:40:08,446: DEBUG/MainProcess] | Consumer: Starting event loop
[2020-12-22 10:40:08,446: DEBUG/MainProcess] | Worker: Hub.register Pool...
[2020-12-22 10:40:08,447: INFO/MainProcess] whoopsie@computer ready.
[2020-12-22 10:40:08,448: DEBUG/MainProcess] basic.qos: prefetch_count->16
[2020-12-22 10:40:16,492: INFO/MainProcess] Received task: app.worker_name[d5f96484-0a00-4726-ac54-222765aa0901]
[2020-12-22 10:40:16,493: DEBUG/MainProcess] TaskPool: Apply <function _trace_task_ret at 0x10f05b3b0> (args:('app.worker_name', 'd5f96484-0a00-4726-ac54-222765aa0901', {'lang': 'py', 'task': 'app.worker_name', 'id': 'd5f96484-0a00-4726-ac54-222765aa0901', 'shadow': None, 'eta': None, 'expires': None, 'group': None, 'group_index': None, 'retries': 0, 'timelimit': [None, None], 'root_id': 'd5f96484-0a00-4726-ac54-222765aa0901', 'parent_id': None, 'argsrepr': '()', 'kwargsrepr': '{}', 'origin': 'gen3304@Fredriks-MacBook-Pro.local', 'reply_to': 'a0afc794-880a-3e05-970f-5013e0b0ed61', 'correlation_id': 'd5f96484-0a00-4726-ac54-222765aa0901', 'hostname': 'whoopsie@computer', 'delivery_info': {'exchange': '', 'routing_key': 'celery', 'priority': 0, 'redelivered': None}, 'args': [], 'kwargs': {}}, b'[[], {}, {"callbacks": null, "errbacks": null, "chain": null, "chord": null}]', 'application/json', 'utf-8') kwargs:{})
[2020-12-22 10:40:16,495: DEBUG/MainProcess] Task accepted: app.worker_name[d5f96484-0a00-4726-ac54-222765aa0901] pid:3300
[2020-12-22 10:40:16,513: INFO/ForkPoolWorker-2] Task app.worker_name[d5f96484-0a00-4726-ac54-222765aa0901] succeeded in 0.016767310000000535s: 'Fredriks-MacBook-Pro.local'"><pre class="notranslate"><code class="notranslate">[2020-12-22 10:40:06,971: DEBUG/MainProcess] | Worker: Preparing bootsteps.
[2020-12-22 10:40:06,973: DEBUG/MainProcess] | Worker: Building graph...
[2020-12-22 10:40:06,974: DEBUG/MainProcess] | Worker: New boot order: {Timer, Hub, Pool, Autoscaler, StateDB, Beat, Consumer}
[2020-12-22 10:40:06,986: DEBUG/MainProcess] | Consumer: Preparing bootsteps.
[2020-12-22 10:40:06,987: DEBUG/MainProcess] | Consumer: Building graph...
[2020-12-22 10:40:07,014: DEBUG/MainProcess] | Consumer: New boot order: {Connection, Events, Heart, Mingle, Tasks, Control, Agent, Gossip, event loop}
-------------- whoopsie@computer v5.0.5 (singularity)
--- ***** -----
-- ******* ---- Darwin-17.7.0-x86_64-i386-64bit 2020-12-22 10:40:07
- *** --- * ---
- ** ---------- [config]
- ** ---------- .> app: __main__:0x10f0db990
- ** ---------- .> transport: redis://localhost:6379/0
- ** ---------- .> results: redis://localhost:6379/0
- *** --- * --- .> concurrency: 4 (prefork)
-- ******* ---- .> task events: OFF (enable -E to monitor tasks in this worker)
--- ***** -----
-------------- [queues]
.> celery exchange=celery(direct) key=celery
[tasks]
. app.worker_name
. celery.accumulate
. celery.backend_cleanup
. celery.chain
. celery.chord
. celery.chord_unlock
. celery.chunks
. celery.group
. celery.map
. celery.starmap
[2020-12-22 10:40:07,041: DEBUG/MainProcess] | Worker: Starting Hub
[2020-12-22 10:40:07,041: DEBUG/MainProcess] ^-- substep ok
[2020-12-22 10:40:07,042: DEBUG/MainProcess] | Worker: Starting Pool
[2020-12-22 10:40:07,237: DEBUG/MainProcess] ^-- substep ok
[2020-12-22 10:40:07,238: DEBUG/MainProcess] | Worker: Starting Consumer
[2020-12-22 10:40:07,239: DEBUG/MainProcess] | Consumer: Starting Connection
[2020-12-22 10:40:07,286: INFO/MainProcess] Connected to redis://localhost:6379/0
[2020-12-22 10:40:07,287: DEBUG/MainProcess] ^-- substep ok
[2020-12-22 10:40:07,287: DEBUG/MainProcess] | Consumer: Starting Events
[2020-12-22 10:40:07,310: DEBUG/MainProcess] ^-- substep ok
[2020-12-22 10:40:07,311: DEBUG/MainProcess] | Consumer: Starting Heart
[2020-12-22 10:40:07,317: DEBUG/MainProcess] ^-- substep ok
[2020-12-22 10:40:07,317: DEBUG/MainProcess] | Consumer: Starting Mingle
[2020-12-22 10:40:07,317: INFO/MainProcess] mingle: searching for neighbors
[2020-12-22 10:40:08,397: INFO/MainProcess] mingle: all alone
[2020-12-22 10:40:08,397: DEBUG/MainProcess] ^-- substep ok
[2020-12-22 10:40:08,397: DEBUG/MainProcess] | Consumer: Starting Tasks
[2020-12-22 10:40:08,405: DEBUG/MainProcess] ^-- substep ok
[2020-12-22 10:40:08,405: DEBUG/MainProcess] | Consumer: Starting Control
[2020-12-22 10:40:08,422: DEBUG/MainProcess] ^-- substep ok
[2020-12-22 10:40:08,423: DEBUG/MainProcess] | Consumer: Starting Gossip
[2020-12-22 10:40:08,446: DEBUG/MainProcess] ^-- substep ok
[2020-12-22 10:40:08,446: DEBUG/MainProcess] | Consumer: Starting event loop
[2020-12-22 10:40:08,446: DEBUG/MainProcess] | Worker: Hub.register Pool...
[2020-12-22 10:40:08,447: INFO/MainProcess] whoopsie@computer ready.
[2020-12-22 10:40:08,448: DEBUG/MainProcess] basic.qos: prefetch_count->16
[2020-12-22 10:40:16,492: INFO/MainProcess] Received task: app.worker_name[d5f96484-0a00-4726-ac54-222765aa0901]
[2020-12-22 10:40:16,493: DEBUG/MainProcess] TaskPool: Apply <function _trace_task_ret at 0x10f05b3b0> (args:('app.worker_name', 'd5f96484-0a00-4726-ac54-222765aa0901', {'lang': 'py', 'task': 'app.worker_name', 'id': 'd5f96484-0a00-4726-ac54-222765aa0901', 'shadow': None, 'eta': None, 'expires': None, 'group': None, 'group_index': None, 'retries': 0, 'timelimit': [None, None], 'root_id': 'd5f96484-0a00-4726-ac54-222765aa0901', 'parent_id': None, 'argsrepr': '()', 'kwargsrepr': '{}', 'origin': 'gen3304@Fredriks-MacBook-Pro.local', 'reply_to': 'a0afc794-880a-3e05-970f-5013e0b0ed61', 'correlation_id': 'd5f96484-0a00-4726-ac54-222765aa0901', 'hostname': 'whoopsie@computer', 'delivery_info': {'exchange': '', 'routing_key': 'celery', 'priority': 0, 'redelivered': None}, 'args': [], 'kwargs': {}}, b'[[], {}, {"callbacks": null, "errbacks": null, "chain": null, "chord": null}]', 'application/json', 'utf-8') kwargs:{})
[2020-12-22 10:40:16,495: DEBUG/MainProcess] Task accepted: app.worker_name[d5f96484-0a00-4726-ac54-222765aa0901] pid:3300
[2020-12-22 10:40:16,513: INFO/ForkPoolWorker-2] Task app.worker_name[d5f96484-0a00-4726-ac54-222765aa0901] succeeded in 0.016767310000000535s: 'Fredriks-MacBook-Pro.local'
</code></pre></div>
<p dir="auto"></p>
</details> | <p dir="auto">If for some reason the private key used as <code class="notranslate">broker_use_ssl.keyfile</code> is not an RSA private key, Celery will crash without telling the root cause, leading to difficult debugging. This affects current celery master branch.</p>
<p dir="auto">This is due to celery.security.key.PrivateKey <code class="notranslate">__init__</code> method not checking the returned key type from <code class="notranslate">load_pem_private_key</code> (from <code class="notranslate">cryptography.hazmat</code>). If the returned key is, for example, <a href="https://cryptography.io/en/latest/hazmat/primitives/asymmetric/ec/#cryptography.hazmat.primitives.asymmetric.ec.EllipticCurvePrivateKey" rel="nofollow">EllipticCurvePrivateKey</a>, the <code class="notranslate">sign</code> method of PrivateKey later will crash with <code class="notranslate">TypeError: sign() takes 3 positional arguments but 4 were given</code> as it expects that <code class="notranslate">self._key</code> is instance of <code class="notranslate">RSAPrivateKey</code>. Furthermore, this (opaque) exception is followed by many more exceptions of type "TypeError: catching classes that do not inherit from BaseException is not allowed". See reproduction for a complete crash log.</p>
<p dir="auto"><code class="notranslate">cryptography</code> library load_pem_private_key <a href="https://cryptography.io/en/latest/hazmat/primitives/asymmetric/serialization/" rel="nofollow">documentation</a> explicitly states that "Many serialization formats support multiple different types of asymmetric keys and will return an instance of the appropriate type. You should check that the returned key matches the type your application expects when using these methods."</p>
<p dir="auto">I propose that the type of the returned key should be checked and appropriate errors raised if the key type is not supported. This would inform the user that the problem they are facing is not a bug in celery or their implementation, but rather that their certificates are not supported by celery.</p>
<h1 dir="auto">Checklist</h1>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have verified that the issue exists against the <code class="notranslate">master</code> branch of Celery.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> This has already been asked to the <a href="https://github.com/celery/celery/discussions">discussions forum</a> first.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have read the relevant section in the<br>
<a href="https://docs.celeryq.dev/en/master/contributing.html#other-bugs" rel="nofollow">contribution guide</a><br>
on reporting bugs.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have checked the <a href="https://github.com/celery/celery/issues?q=is%3Aissue+label%3A%22Issue+Type%3A+Bug+Report%22+-label%3A%22Category%3A+Documentation%22">issues list</a><br>
for similar or identical bug reports.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have checked the <a href="https://github.com/celery/celery/pulls?q=is%3Apr+label%3A%22PR+Type%3A+Bugfix%22+-label%3A%22Category%3A+Documentation%22">pull requests list</a><br>
for existing proposed fixes.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have checked the <a href="https://github.com/celery/celery/commits/master">commit log</a><br>
to find out if the bug was already fixed in the master branch.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have included all related issues and possible duplicate issues<br>
in this issue (If there are none, check this box anyway).</li>
</ul>
<h2 dir="auto">Mandatory Debugging Information</h2>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have included the output of <code class="notranslate">celery -A proj report</code> in the issue.<br>
(if you are not able to do this, then at least specify the Celery<br>
version affected).</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have verified that the issue exists against the <code class="notranslate">master</code> branch of Celery.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have included the contents of <code class="notranslate">pip freeze</code> in the issue.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have included all the versions of all the external dependencies required<br>
to reproduce this bug.</li>
</ul>
<h4 dir="auto">Related Issues</h4>
<ul dir="auto">
<li>None that I could find</li>
</ul>
<h4 dir="auto">Possible Duplicates</h4>
<ul dir="auto">
<li>None that I could find</li>
</ul>
<h2 dir="auto">Environment & Settings</h2>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$ celery --version
5.0.5 (singularity)"><pre class="notranslate"><code class="notranslate">$ celery --version
5.0.5 (singularity)
</code></pre></div>
<p dir="auto"><code class="notranslate">cryptography==37.0.4</code></p>
<h1 dir="auto">Steps to Reproduce</h1>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="app = Celery('test', include=[])
broker_use_ssl = {
'keyfile': 'broker_client.key', # private key is ECDSA signed
'certfile': 'broker_client.crt',
'ca_certs': 'root.pem',
'cert_reqs': ssl.CERT_REQUIRED
}
app.conf.update(
broker_use_ssl=broker_use_ssl,
security_key='private.key',
security_certificate='public.crt',
security_cert_store='security_store/*.pem
)
app.setup_security()
app.start()"><pre class="notranslate"><code class="notranslate">app = Celery('test', include=[])
broker_use_ssl = {
'keyfile': 'broker_client.key', # private key is ECDSA signed
'certfile': 'broker_client.crt',
'ca_certs': 'root.pem',
'cert_reqs': ssl.CERT_REQUIRED
}
app.conf.update(
broker_use_ssl=broker_use_ssl,
security_key='private.key',
security_certificate='public.crt',
security_cert_store='security_store/*.pem
)
app.setup_security()
app.start()
</code></pre></div>
<p dir="auto">This should result in traceback</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" [2022-07-22 14:16:20,309: CRITICAL/MainProcess] Unrecoverable error: EncodeError(SecurityError("Unable to serialize: TypeError('catching classes that do not inherit from BaseException is not allowed')"))
Traceback (most recent call last):
File "/venv/lib/python3.8/site-packages/celery/security/utils.py", line 24, in reraise_errors
yield
File "/venv/lib/python3.8/site-packages/celery/security/key.py", line 32, in sign
return self._key.sign(ensure_bytes(data), padd, digest)
TypeError: sign() takes 3 positional arguments but 4 were given
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/venv/lib/python3.8/site-packages/celery/security/utils.py", line 24, in reraise_errors
yield
File "/venv/lib/python3.8/site-packages/celery/security/serialization.py", line 39, in serialize
signature=self._key.sign(body, self._digest),
File "/venv/lib/python3.8/site-packages/celery/security/key.py", line 32, in sign
return self._key.sign(ensure_bytes(data), padd, digest)
File "/usr/lib/python3.8/contextlib.py", line 131, in __exit__
self.gen.throw(type, value, traceback)
File "/venv/lib/python3.8/site-packages/celery/security/utils.py", line 25, in reraise_errors
except errors as exc:
TypeError: catching classes that do not inherit from BaseException is not allowed
... Above type error repeated many times ..."><pre class="notranslate"><code class="notranslate"> [2022-07-22 14:16:20,309: CRITICAL/MainProcess] Unrecoverable error: EncodeError(SecurityError("Unable to serialize: TypeError('catching classes that do not inherit from BaseException is not allowed')"))
Traceback (most recent call last):
File "/venv/lib/python3.8/site-packages/celery/security/utils.py", line 24, in reraise_errors
yield
File "/venv/lib/python3.8/site-packages/celery/security/key.py", line 32, in sign
return self._key.sign(ensure_bytes(data), padd, digest)
TypeError: sign() takes 3 positional arguments but 4 were given
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/venv/lib/python3.8/site-packages/celery/security/utils.py", line 24, in reraise_errors
yield
File "/venv/lib/python3.8/site-packages/celery/security/serialization.py", line 39, in serialize
signature=self._key.sign(body, self._digest),
File "/venv/lib/python3.8/site-packages/celery/security/key.py", line 32, in sign
return self._key.sign(ensure_bytes(data), padd, digest)
File "/usr/lib/python3.8/contextlib.py", line 131, in __exit__
self.gen.throw(type, value, traceback)
File "/venv/lib/python3.8/site-packages/celery/security/utils.py", line 25, in reraise_errors
except errors as exc:
TypeError: catching classes that do not inherit from BaseException is not allowed
... Above type error repeated many times ...
</code></pre></div> | 0 |
<p dir="auto">There are many examples in the docs that require some adjustments to get to compile, e.g. the following requires a <code class="notranslate">main</code> function:</p>
<div class="highlight highlight-source-rust notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="let a = [0];
let b = [1];
let mut it = a.iter().chain(b.iter());
assert_eq!(it.next().get(), &0);
assert_eq!(it.next().get(), &1);
assert!(it.next().is_none());"><pre class="notranslate"><span class="pl-k">let</span> a = <span class="pl-kos">[</span><span class="pl-c1">0</span><span class="pl-kos">]</span><span class="pl-kos">;</span>
<span class="pl-k">let</span> b = <span class="pl-kos">[</span><span class="pl-c1">1</span><span class="pl-kos">]</span><span class="pl-kos">;</span>
<span class="pl-k">let</span> <span class="pl-k">mut</span> it = a<span class="pl-kos">.</span><span class="pl-en">iter</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">chain</span><span class="pl-kos">(</span>b<span class="pl-kos">.</span><span class="pl-en">iter</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-en">assert_eq</span><span class="pl-en">!</span><span class="pl-kos">(</span>it.next<span class="pl-kos">(</span><span class="pl-kos">)</span>.get<span class="pl-kos">(</span><span class="pl-kos">)</span>, &<span class="pl-c1">0</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-en">assert_eq</span><span class="pl-en">!</span><span class="pl-kos">(</span>it.next<span class="pl-kos">(</span><span class="pl-kos">)</span>.get<span class="pl-kos">(</span><span class="pl-kos">)</span>, &<span class="pl-c1">1</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-en">assert</span><span class="pl-en">!</span><span class="pl-kos">(</span>it.next<span class="pl-kos">(</span><span class="pl-kos">)</span>.is_none<span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<p dir="auto">(<code class="notranslate">Iterator.chain</code> at the time of filing.)</p>
<p dir="auto">And others that are entirely self-contained, and can just be copy-pasted to be run.</p>
<div class="highlight highlight-source-rust notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="use std::rand;
fn main () {
let tuple_ptr = rand::random::<~(f64, char)>();
printfln!(tuple_ptr)
}"><pre class="notranslate"><span class="pl-k">use</span> std<span class="pl-kos">::</span>rand<span class="pl-kos">;</span>
<span class="pl-k">fn</span> <span class="pl-en">main</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-k">let</span> tuple_ptr = rand<span class="pl-kos">::</span><span class="pl-en">random</span><span class="pl-kos">::</span><span class="pl-kos"><</span>~<span class="pl-kos">(</span><span class="pl-smi">f64</span><span class="pl-kos">,</span> <span class="pl-smi">char</span><span class="pl-kos">)</span><span class="pl-kos">></span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-en">printfln</span><span class="pl-en">!</span><span class="pl-kos">(</span>tuple_ptr<span class="pl-kos">)</span>
<span class="pl-kos">}</span></pre></div>
<p dir="auto">(One of the examples at the top of <code class="notranslate">std::rand</code>.)</p>
<p dir="auto">It seems like it would be good to be consistent about this. I prefer the latter, and it would make automatically running the tests much easier (<a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="5625118" data-permission-text="Title is private" data-url="https://github.com/rust-lang/rust/issues/2925" data-hovercard-type="issue" data-hovercard-url="/rust-lang/rust/issues/2925/hovercard" href="https://github.com/rust-lang/rust/issues/2925">#2925</a>).</p> | <p dir="auto">Hello All,</p>
<p dir="auto">Just stumbled upon</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="...
compile_and_link: x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd.so
error: unknown debug flag: no-debug-borrows
error: internal compiler error: unexpected failure
This message reflects a bug in the Rust compiler.
We would appreciate a bug report: http://static.rust-lang.org/doc/master/complement-bugreport.html
note: the compiler hit an unexpected failure path. this is a bug
task 'rustc' failed at 'explicit failure', /mnt/disk2/opt/pkgs/rust/src/librustc/driver/driver.rs:1137"><pre class="notranslate"><code class="notranslate">...
compile_and_link: x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd.so
error: unknown debug flag: no-debug-borrows
error: internal compiler error: unexpected failure
This message reflects a bug in the Rust compiler.
We would appreciate a bug report: http://static.rust-lang.org/doc/master/complement-bugreport.html
note: the compiler hit an unexpected failure path. this is a bug
task 'rustc' failed at 'explicit failure', /mnt/disk2/opt/pkgs/rust/src/librustc/driver/driver.rs:1137
</code></pre></div>
<p dir="auto">Additional information:</p>
<p dir="auto">Top of tree:<br>
latest<br>
commit <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/rust-lang/rust/commit/f8477c9da5ed784f5981611b6c12623cd2b44806/hovercard" href="https://github.com/rust-lang/rust/commit/f8477c9da5ed784f5981611b6c12623cd2b44806"><tt>f8477c9</tt></a></p>
<p dir="auto">duplicates the bug<br>
<a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="26042147" data-permission-text="Title is private" data-url="https://github.com/rust-lang/rust/issues/11707" data-hovercard-type="issue" data-hovercard-url="/rust-lang/rust/issues/11707/hovercard" href="https://github.com/rust-lang/rust/issues/11707">#11707</a></p>
<p dir="auto">Thanks</p> | 0 |
<p dir="auto">Hello everyone,</p>
<p dir="auto">I am having a problem with joblib.load("filename.pkl") returning the error:<br>
ValueError: "Did not recognize loaded array layout"</p>
<p dir="auto">I've looked for information on this error but have found non. Could someone assist?</p>
<p dir="auto">Further information<br>
I've installed sklearn through pythonxy, on a windows 7 machine, version 15.2 of sklearn. I've trained a large over a large amount of data, about 30 thousand samples, using the random forest classifier. I dump my classifier using joblib.dump then try to reloaded it using joblib and receive the error message above.</p>
<p dir="auto">I've tried the same code on my mac(this was not through pythonxy) and do not receive an error. I then uninstalled my pythonxy to install the newest version but I receive the same error.</p>
<p dir="auto">Full error:<br>
Traceback (most recent call last):<br>
File "", line 1, in <br>
File "C:\Python27\lib\site-packages\sklearn\externals\joblib\numpy_pickle.py", line 425, in load<br>
obj = unpickler.load()<br>
File "C:\Python27\lib\pickle.py", line 858, in load<br>
dispatch<a href="self">key</a><br>
File "C:\Python27\lib\site-packages\sklearn\externals\joblib\numpy_pickle.py", line 285, in load_build<br>
Unpickler.load_build(self)<br>
File "C:\Python27\lib\pickle.py", line 1217, in load_build<br>
setstate(state)<br>
File "_tree.pyx", line 2280, in sklearn.tree._tree.Tree.<strong>setstate</strong> (sklearn\tree_tree.c:18350)<br>
ValueError: Did not recognise loaded array layout</p> | <p dir="auto">Hello,</p>
<p dir="auto">I want to save a randomForest model to predict a class on new data. I use joblib to save and load data but I get this error when I use joblib.load. ValueError: "Did not recognize loaded array layout"<br>
More information :<br>
platform: Windows-7-6.1.7601-SP1<br>
system: 'Python', '2.7.10 |Anaconda 2.3.0 (32-bit)| (default, May 28 2015, 17:02:00) [MSC v.1500 32 bit (Intel)]'<br>
numpy version 1.9.2<br>
sklearn version 0.16.1<br>
scipy version 0.15.1</p>
<p dir="auto">code reproducing the error:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="from sklearn.externals import joblib
import numpy as np
from sklearn.ensemble import RandomForestClassifier
X = np.random.randn(1500,8)
l = np.random.randint(6, size = 1500)
clf_forest = RandomForestClassifier(n_estimators = 10)
clf_forest.fit(X,l)
joblib.dump(clf_forest,'clf_forest.pkl')
X_test = joblib.load('clf_forest.pkl')"><pre class="notranslate"><code class="notranslate">from sklearn.externals import joblib
import numpy as np
from sklearn.ensemble import RandomForestClassifier
X = np.random.randn(1500,8)
l = np.random.randint(6, size = 1500)
clf_forest = RandomForestClassifier(n_estimators = 10)
clf_forest.fit(X,l)
joblib.dump(clf_forest,'clf_forest.pkl')
X_test = joblib.load('clf_forest.pkl')
</code></pre></div>
<p dir="auto">Full error:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" File "<ipython-input-4-fbcdf8eeb9d7>", line 1, in <module>
X_test = joblib.load('clf_forest.pkl')
File "C:\Users\P\AppData\Local\Continuum\Anaconda\lib\site-packages\sklearn\externals\joblib\numpy_pickle.py", line 425, in load
obj = unpickler.load()
File "C:\Users\P\AppData\Local\Continuum\Anaconda\lib\pickle.py", line 858, in load
dispatch[key](self)
File "C:\Users\P\AppData\Local\Continuum\Anaconda\lib\site-packages\sklearn\externals\joblib\numpy_pickle.py", line 285, in load_build
Unpickler.load_build(self)
File "C:\Users\P\AppData\Local\Continuum\Anaconda\lib\pickle.py", line 1217, in load_build
setstate(state)
File "sklearn/tree/_tree.pyx", line 3113, in sklearn.tree._tree.Tree.__setstate__ (sklearn\tree\_tree.c:23599)
ValueError: Did not recognise loaded array layout"><pre class="notranslate"><code class="notranslate"> File "<ipython-input-4-fbcdf8eeb9d7>", line 1, in <module>
X_test = joblib.load('clf_forest.pkl')
File "C:\Users\P\AppData\Local\Continuum\Anaconda\lib\site-packages\sklearn\externals\joblib\numpy_pickle.py", line 425, in load
obj = unpickler.load()
File "C:\Users\P\AppData\Local\Continuum\Anaconda\lib\pickle.py", line 858, in load
dispatch[key](self)
File "C:\Users\P\AppData\Local\Continuum\Anaconda\lib\site-packages\sklearn\externals\joblib\numpy_pickle.py", line 285, in load_build
Unpickler.load_build(self)
File "C:\Users\P\AppData\Local\Continuum\Anaconda\lib\pickle.py", line 1217, in load_build
setstate(state)
File "sklearn/tree/_tree.pyx", line 3113, in sklearn.tree._tree.Tree.__setstate__ (sklearn\tree\_tree.c:23599)
ValueError: Did not recognise loaded array layout
</code></pre></div>
<p dir="auto">Thanks for the help</p> | 1 |
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="#With this code:
#-----------------------------
from datetime import datetime
import pytz
from pandas import DataFrame
original_date = datetime(2016, 9, 2, 0, 0, 0, 0, pytz.timezone('America/Manaus'))
dataframe = DataFrame(columns = ['stored_date'])
dataframe.loc['A'] = [original_date]
print("I expect it shows '2016-09-02T00:00:00-04:00', but it shows '2016-09-02 04:00:00'...")
print("original_date: " + original_date.isoformat())
print("stored_date in dataframe: " + str(dataframe.loc['A', 'stored_date']))
#-----------------------------"><pre class="notranslate"><code class="notranslate">#With this code:
#-----------------------------
from datetime import datetime
import pytz
from pandas import DataFrame
original_date = datetime(2016, 9, 2, 0, 0, 0, 0, pytz.timezone('America/Manaus'))
dataframe = DataFrame(columns = ['stored_date'])
dataframe.loc['A'] = [original_date]
print("I expect it shows '2016-09-02T00:00:00-04:00', but it shows '2016-09-02 04:00:00'...")
print("original_date: " + original_date.isoformat())
print("stored_date in dataframe: " + str(dataframe.loc['A', 'stored_date']))
#-----------------------------
</code></pre></div>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="#I get this output:
#-----------------------------
I expect it shows '2016-09-02T00:00:00-04:00', but it shows '2016-09-02 04:00:00'...
original_date: 2016-09-02T00:00:00-04:00
stored_date in dataframe: 2016-09-02 04:00:00
#-----------------------------"><pre class="notranslate"><code class="notranslate">#I get this output:
#-----------------------------
I expect it shows '2016-09-02T00:00:00-04:00', but it shows '2016-09-02 04:00:00'...
original_date: 2016-09-02T00:00:00-04:00
stored_date in dataframe: 2016-09-02 04:00:00
#-----------------------------
</code></pre></div>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="#Output from pd.show_versions()
commit: None
python: 3.5.2.final.0
python-bits: 64
OS: Linux
OS-release: 4.7.1-1-ARCH
machine: x86_64
processor:
byteorder: little
LC_ALL: None
LANG: pt_BR.utf8
pandas: 0.18.1
nose: None
pip: 8.1.2
setuptools: 26.0.0
Cython: 0.24.1
numpy: 1.11.1
scipy: 0.18.0
statsmodels: None
xarray: None
IPython: None
sphinx: None
patsy: None
dateutil: 2.5.3
pytz: 2016.6.1
blosc: None
bottleneck: 1.1.0
tables: 3.2.3.1
numexpr: 2.6.1
matplotlib: 1.5.2
openpyxl: None
xlrd: None
xlwt: None
xlsxwriter: None
lxml: None
bs4: None
html5lib: None
httplib2: None
apiclient: None
sqlalchemy: 1.0.14
pymysql: None
psycopg2: None
jinja2: 2.8
boto: None
pandas_datareader: 0.2.1
"><pre class="notranslate"><code class="notranslate">#Output from pd.show_versions()
commit: None
python: 3.5.2.final.0
python-bits: 64
OS: Linux
OS-release: 4.7.1-1-ARCH
machine: x86_64
processor:
byteorder: little
LC_ALL: None
LANG: pt_BR.utf8
pandas: 0.18.1
nose: None
pip: 8.1.2
setuptools: 26.0.0
Cython: 0.24.1
numpy: 1.11.1
scipy: 0.18.0
statsmodels: None
xarray: None
IPython: None
sphinx: None
patsy: None
dateutil: 2.5.3
pytz: 2016.6.1
blosc: None
bottleneck: 1.1.0
tables: 3.2.3.1
numexpr: 2.6.1
matplotlib: 1.5.2
openpyxl: None
xlrd: None
xlwt: None
xlsxwriter: None
lxml: None
bs4: None
html5lib: None
httplib2: None
apiclient: None
sqlalchemy: 1.0.14
pymysql: None
psycopg2: None
jinja2: 2.8
boto: None
pandas_datareader: 0.2.1
</code></pre></div> | <p dir="auto">xref <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="137559417" data-permission-text="Title is private" data-url="https://github.com/pandas-dev/pandas/issues/12502" data-hovercard-type="issue" data-hovercard-url="/pandas-dev/pandas/issues/12502/hovercard" href="https://github.com/pandas-dev/pandas/issues/12502">#12502</a> (example there as well)<br>
xref <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="174956962" data-permission-text="Title is private" data-url="https://github.com/pandas-dev/pandas/issues/14148" data-hovercard-type="issue" data-hovercard-url="/pandas-dev/pandas/issues/14148/hovercard" href="https://github.com/pandas-dev/pandas/issues/14148">#14148</a></p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="In [3]: idx = pd.date_range('20130101',periods=3,tz='US/Eastern')
In [4]: df = DataFrame({'A' : [1,2,3]})
In [5]: df['B'] = idx
In [6]: df.dtypes
Out[6]:
A int64
B datetime64[ns, US/Eastern]
dtype: object
In [7]: df.loc[[True,False,True],'C'] = idx
In [8]: df
Out[8]:
A B C
0 1 2013-01-01 00:00:00-05:00 2013-01-01 05:00:00
1 2 2013-01-02 00:00:00-05:00 NaT
2 3 2013-01-03 00:00:00-05:00 2013-01-02 05:00:00
# C should be the same time zone
In [9]: df.dtypes
Out[9]:
A int64
B datetime64[ns, US/Eastern]
C datetime64[ns]
dtype: object"><pre class="notranslate"><code class="notranslate">In [3]: idx = pd.date_range('20130101',periods=3,tz='US/Eastern')
In [4]: df = DataFrame({'A' : [1,2,3]})
In [5]: df['B'] = idx
In [6]: df.dtypes
Out[6]:
A int64
B datetime64[ns, US/Eastern]
dtype: object
In [7]: df.loc[[True,False,True],'C'] = idx
In [8]: df
Out[8]:
A B C
0 1 2013-01-01 00:00:00-05:00 2013-01-01 05:00:00
1 2 2013-01-02 00:00:00-05:00 NaT
2 3 2013-01-03 00:00:00-05:00 2013-01-02 05:00:00
# C should be the same time zone
In [9]: df.dtypes
Out[9]:
A int64
B datetime64[ns, US/Eastern]
C datetime64[ns]
dtype: object
</code></pre></div>
<p dir="auto">this is also realized to <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="111933678" data-permission-text="Title is private" data-url="https://github.com/pandas-dev/pandas/issues/11351" data-hovercard-type="issue" data-hovercard-url="/pandas-dev/pandas/issues/11351/hovercard" href="https://github.com/pandas-dev/pandas/issues/11351">#11351</a> [4]</p> | 1 |
<p dir="auto">Documentation of 1.0.0 (<a href="http://docs.python-requests.org/en/v1.0.0/user/advanced/" rel="nofollow">http://docs.python-requests.org/en/v1.0.0/user/advanced/</a>) says<br>
<code class="notranslate">requests.session(auth=auth, headers=headers)</code> is a legitimate statement.</p>
<p dir="auto">However, reading the code I see that session(), nor Session.<strong>init</strong> do not take any arguments.<br>
<a href="https://github.com/kennethreitz/requests/blob/master/requests/sessions.py">https://github.com/kennethreitz/requests/blob/master/requests/sessions.py</a></p>
<p dir="auto">So if I have not misread anything, the docs should be fixed demonstrating the way to set persistent session-specific headers, auth etc.</p> | <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="requests.session(**kwargs)
Returns a Session for context-management."><pre class="notranslate"><code class="notranslate">requests.session(**kwargs)
Returns a Session for context-management.
</code></pre></div>
<p dir="auto">This not longer works:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="session = requests.Session(verify=not staging)
TypeError: __init__() got an unexpected keyword argument 'verify'"><pre class="notranslate"><code class="notranslate">session = requests.Session(verify=not staging)
TypeError: __init__() got an unexpected keyword argument 'verify'
</code></pre></div> | 1 |
<blockquote>
<p dir="auto">This function is a faster version of the builtin python bisect.bisect_left (side='left') and bisect.bisect_right (side='right') functions</p>
</blockquote>
<p dir="auto">No, it's not faster for basic cases.</p>
<h3 dir="auto">Reproducing code example:</h3>
<p dir="auto">Python bisect is 3x faster than searchsorted:</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="from bisect import bisect_right
from numpy import searchsorted
l = list(range(1024 * 8))
m = int(len(l)/3)
%timeit bisect_right(l, m)
a = np.asarray(l)
%timeit searchsorted(a, m)"><pre class="notranslate"><span class="pl-k">from</span> <span class="pl-s1">bisect</span> <span class="pl-k">import</span> <span class="pl-s1">bisect_right</span>
<span class="pl-k">from</span> <span class="pl-s1">numpy</span> <span class="pl-k">import</span> <span class="pl-s1">searchsorted</span>
<span class="pl-s1">l</span> <span class="pl-c1">=</span> <span class="pl-en">list</span>(<span class="pl-en">range</span>(<span class="pl-c1">1024</span> <span class="pl-c1">*</span> <span class="pl-c1">8</span>))
<span class="pl-s1">m</span> <span class="pl-c1">=</span> <span class="pl-en">int</span>(<span class="pl-en">len</span>(<span class="pl-s1">l</span>)<span class="pl-c1">/</span><span class="pl-c1">3</span>)
<span class="pl-c1">%</span><span class="pl-s1">timeit</span> <span class="pl-en">bisect_right</span>(<span class="pl-s1">l</span>, <span class="pl-s1">m</span>)
<span class="pl-s1">a</span> <span class="pl-c1">=</span> <span class="pl-s1">np</span>.<span class="pl-en">asarray</span>(<span class="pl-s1">l</span>)
<span class="pl-c1">%</span><span class="pl-s1">timeit</span> <span class="pl-en">searchsorted</span>(<span class="pl-s1">a</span>, <span class="pl-s1">m</span>)</pre></div>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="444 ns ± 14.7 ns per loop (mean ± std. dev. of 7 runs, 1000000 loops each)
1.57 µs ± 13.7 ns per loop (mean ± std. dev. of 7 runs, 1000000 loops each)"><pre class="notranslate"><code class="notranslate">444 ns ± 14.7 ns per loop (mean ± std. dev. of 7 runs, 1000000 loops each)
1.57 µs ± 13.7 ns per loop (mean ± std. dev. of 7 runs, 1000000 loops each)
</code></pre></div>
<p dir="auto">For reference, numba's implementation of <code class="notranslate">searchsorted()</code> is a little faster than bisect:</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="from numba import njit
@njit
def searchsorted_jit(_a, _v):
return searchsorted(_a, _v)
searchsorted_jit(a, m)
%timeit searchsorted_jit(a, m)"><pre class="notranslate"><span class="pl-k">from</span> <span class="pl-s1">numba</span> <span class="pl-k">import</span> <span class="pl-s1">njit</span>
<span class="pl-en">@<span class="pl-s1">njit</span></span>
<span class="pl-k">def</span> <span class="pl-en">searchsorted_jit</span>(<span class="pl-s1">_a</span>, <span class="pl-s1">_v</span>):
<span class="pl-k">return</span> <span class="pl-en">searchsorted</span>(<span class="pl-s1">_a</span>, <span class="pl-s1">_v</span>)
<span class="pl-en">searchsorted_jit</span>(<span class="pl-s1">a</span>, <span class="pl-s1">m</span>)
<span class="pl-c1">%</span><span class="pl-s1">timeit</span> <span class="pl-en">searchsorted_jit</span>(<span class="pl-s1">a</span>, <span class="pl-s1">m</span>)</pre></div>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="391 ns ± 2.93 ns per loop (mean ± std. dev. of 7 runs, 1000000 loops each)"><pre class="notranslate"><code class="notranslate">391 ns ± 2.93 ns per loop (mean ± std. dev. of 7 runs, 1000000 loops each)
</code></pre></div>
<h3 dir="auto">Numpy/Python version information:</h3>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="1.16.2 3.7.3 (default, Mar 27 2019, 09:23:39)
[Clang 10.0.0 (clang-1000.11.45.5)]"><pre class="notranslate"><code class="notranslate">1.16.2 3.7.3 (default, Mar 27 2019, 09:23:39)
[Clang 10.0.0 (clang-1000.11.45.5)]
</code></pre></div> | <h3 dir="auto">Reproducing code example:</h3>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import numpy as np
<< your code here >>"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s1">numpy</span> <span class="pl-k">as</span> <span class="pl-s1">np</span>
<span class="pl-c1"><<</span> <span class="pl-s1">your</span> <span class="pl-s1">code</span> <span class="pl-s1">here</span> <span class="pl-c1">>></span></pre></div>
<h3 dir="auto">Error message:</h3>
<h3 dir="auto">Numpy/Python version information:</h3>
<p dir="auto">I tried to run" import numpy as np" but it shows me an error message. I uninstalled and reinstalled 2 times but the problem is still present. I installed anaconda via the site : "<a href="https://www.anaconda.com/distribution/" rel="nofollow">https://www.anaconda.com/distribution/</a>" and I launched the launcher for the installed one.The message is :</p>
<p dir="auto">ImportError:</p>
<p dir="auto">IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!</p>
<p dir="auto">Importing the multiarray numpy extension module failed. Most<br>
likely you are trying to import a failed build of numpy.<br>
Here is how to proceed:</p>
<ul dir="auto">
<li>If you're working with a numpy git repository, try <code class="notranslate">git clean -xdf</code><br>
(removes all files not under version control) and rebuild numpy.</li>
<li>If you are simply trying to use the numpy version that you have installed:<br>
your installation is broken - please reinstall numpy.</li>
<li>If you have already reinstalled and that did not fix the problem, then:
<ol dir="auto">
<li>
<p dir="auto">Check that you are using the Python you expect (you're using C:\Users\harry\Anaconda3\pythonw.exe),<br>
and that you have no directories in your PATH or PYTHONPATH that can<br>
interfere with the Python and numpy versions you're trying to use.</p>
</li>
<li>
<p dir="auto">If (1) looks fine, you can open a new issue at<br>
<a href="https://github.com/numpy/numpy/issues">https://github.com/numpy/numpy/issues</a>. Please include details on:</p>
<ul dir="auto">
<li>how you installed Python</li>
<li>how you installed numpy</li>
<li>your operating system</li>
<li>whether or not you have multiple versions of Python installed</li>
<li>if you built from source, your compiler versions and ideally a build log</li>
</ul>
<p dir="auto">Note: this error has many possible causes, so please don't comment on<br>
an existing issue about this - open a new one instead.</p>
</li>
</ol>
</li>
</ul>
<p dir="auto">Original error was: No module named 'numpy.core._multiarray_umath'</p> | 0 |
<p dir="auto">Currently Julia supports only millisecond resolution through its <code class="notranslate">Datetime</code> type (in the standard <code class="notranslate">Dates</code> package). That is, it can accept date and time in the format</p>
<div class="highlight highlight-source-julia notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="julia> df = DateFormat("Y-m-d H:M:S.s")
dateformat"Y-m-d H:M:S.s""><pre class="notranslate">julia<span class="pl-k">></span> df <span class="pl-k">=</span> <span class="pl-c1">DateFormat</span>(<span class="pl-s"><span class="pl-pds">"</span>Y-m-d H:M:S.s<span class="pl-pds">"</span></span>)
<span class="pl-s"><span class="pl-pds"><span class="pl-c1">dateformat</span>"</span>Y-m-d H:M:S.s<span class="pl-pds">"</span></span></pre></div>
<p dir="auto">where the <code class="notranslate">s</code> after the decimal dot is only allowed to have up to three figures. In order words, there must be an integer number of millisecond.</p>
<p dir="auto">A working example is below</p>
<div class="highlight highlight-source-julia notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="julia> DateTime("2019-12-06 12:01:40.301",df)
2019-12-06T12:01:40.301"><pre class="notranslate">julia<span class="pl-k">></span> <span class="pl-c1">DateTime</span>(<span class="pl-s"><span class="pl-pds">"</span>2019-12-06 12:01:40.301<span class="pl-pds">"</span></span>,df)
<span class="pl-c1">2019</span><span class="pl-k">-</span><span class="pl-c1">12</span><span class="pl-k">-</span><span class="pl-c1">06</span>T12<span class="pl-k">:</span><span class="pl-c1">01</span><span class="pl-k">:</span><span class="pl-c1">40.301</span></pre></div>
<p dir="auto">But another example below does not work</p>
<div class="highlight highlight-source-julia notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="julia> DateTime("2019-12-06 12:01:40.301199",df)
ERROR: InexactError: convert(Dates.Decimal3, 301199)
Stacktrace:
[1] tryparsenext at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.3/Dates/src/io.jl:153 [inlined]
[2] tryparsenext at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.3/Dates/src/io.jl:41 [inlined]
[3] macro expansion at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.3/Dates/src/parse.jl:64 [inlined]
[4] tryparsenext_core(::String, ::Int64, ::Int64, ::DateFormat{Symbol("Y-m-d H:M:S.s"),Tuple{Dates.DatePart{'Y'},Dates.Delim{Char,1},Dates.DatePart{'m'},Dates.Delim{Char,1},Dates.DatePart{'d'},Dates.Delim{Char,1},Dates.DatePart{'H'},Dates.Delim{Char,1},Dates.DatePart{'M'},Dates.Delim{Char,1},Dates.DatePart{'S'},Dates.Delim{Char,1},Dates.DatePart{'s'}}}, ::Bool) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.3/Dates/src/parse.jl:40
[5] macro expansion at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.3/Dates/src/parse.jl:150 [inlined]
[6] tryparsenext_internal at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.3/Dates/src/parse.jl:127 [inlined]
[7] parse(::Type{DateTime}, ::String, ::DateFormat{Symbol("Y-m-d H:M:S.s"),Tuple{Dates.DatePart{'Y'},Dates.Delim{Char,1},Dates.DatePart{'m'},Dates.Delim{Char,1},Dates.DatePart{'d'},Dates.Delim{Char,1},Dates.DatePart{'H'},Dates.Delim{Char,1},Dates.DatePart{'M'},Dates.Delim{Char,1},Dates.DatePart{'S'},Dates.Delim{Char,1},Dates.DatePart{'s'}}}) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.3/Dates/src/parse.jl:282
[8] DateTime(::String, ::DateFormat{Symbol("Y-m-d H:M:S.s"),Tuple{Dates.DatePart{'Y'},Dates.Delim{Char,1},Dates.DatePart{'m'},Dates.Delim{Char,1},Dates.DatePart{'d'},Dates.Delim{Char,1},Dates.DatePart{'H'},Dates.Delim{Char,1},Dates.DatePart{'M'},Dates.Delim{Char,1},Dates.DatePart{'S'},Dates.Delim{Char,1},Dates.DatePart{'s'}}}) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.3/Dates/src/io.jl:482
[9] top-level scope at none:0"><pre class="notranslate">julia<span class="pl-k">></span> <span class="pl-c1">DateTime</span>(<span class="pl-s"><span class="pl-pds">"</span>2019-12-06 12:01:40.301199<span class="pl-pds">"</span></span>,df)
ERROR<span class="pl-k">:</span> InexactError<span class="pl-k">:</span> <span class="pl-c1">convert</span>(Dates<span class="pl-k">.</span>Decimal3, <span class="pl-c1">301199</span>)
Stacktrace<span class="pl-k">:</span>
[<span class="pl-c1">1</span>] tryparsenext at <span class="pl-k">/</span>buildworker<span class="pl-k">/</span>worker<span class="pl-k">/</span>package_linux64<span class="pl-k">/</span>build<span class="pl-k">/</span>usr<span class="pl-k">/</span>share<span class="pl-k">/</span>julia<span class="pl-k">/</span>stdlib<span class="pl-k">/</span>v1.<span class="pl-c1">3</span><span class="pl-k">/</span>Dates<span class="pl-k">/</span>src<span class="pl-k">/</span>io<span class="pl-k">.</span>jl<span class="pl-k">:</span><span class="pl-c1">153</span> [inlined]
[<span class="pl-c1">2</span>] tryparsenext at <span class="pl-k">/</span>buildworker<span class="pl-k">/</span>worker<span class="pl-k">/</span>package_linux64<span class="pl-k">/</span>build<span class="pl-k">/</span>usr<span class="pl-k">/</span>share<span class="pl-k">/</span>julia<span class="pl-k">/</span>stdlib<span class="pl-k">/</span>v1.<span class="pl-c1">3</span><span class="pl-k">/</span>Dates<span class="pl-k">/</span>src<span class="pl-k">/</span>io<span class="pl-k">.</span>jl<span class="pl-k">:</span><span class="pl-c1">41</span> [inlined]
[<span class="pl-c1">3</span>] <span class="pl-k">macro</span> expansion at <span class="pl-k">/</span>buildworker<span class="pl-k">/</span>worker<span class="pl-k">/</span>package_linux64<span class="pl-k">/</span>build<span class="pl-k">/</span>usr<span class="pl-k">/</span>share<span class="pl-k">/</span>julia<span class="pl-k">/</span>stdlib<span class="pl-k">/</span>v1.<span class="pl-c1">3</span><span class="pl-k">/</span>Dates<span class="pl-k">/</span>src<span class="pl-k">/</span>parse<span class="pl-k">.</span>jl<span class="pl-k">:</span><span class="pl-c1">64</span> [inlined]
[<span class="pl-c1">4</span>] <span class="pl-c1">tryparsenext_core</span>(<span class="pl-k">::</span><span class="pl-c1">String</span>, <span class="pl-k">::</span><span class="pl-c1">Int64</span>, <span class="pl-k">::</span><span class="pl-c1">Int64</span>, <span class="pl-k">::</span><span class="pl-c1">DateFormat{Symbol("Y-m-d H:M:S.s"),Tuple{Dates.DatePart{'Y'},Dates.Delim{Char,1},Dates.DatePart{'m'},Dates.Delim{Char,1},Dates.DatePart{'d'},Dates.Delim{Char,1},Dates.DatePart{'H'},Dates.Delim{Char,1},Dates.DatePart{'M'},Dates.Delim{Char,1},Dates.DatePart{'S'},Dates.Delim{Char,1},Dates.DatePart{'s'}}}</span>, <span class="pl-k">::</span><span class="pl-c1">Bool</span>) at <span class="pl-k">/</span>buildworker<span class="pl-k">/</span>worker<span class="pl-k">/</span>package_linux64<span class="pl-k">/</span>build<span class="pl-k">/</span>usr<span class="pl-k">/</span>share<span class="pl-k">/</span>julia<span class="pl-k">/</span>stdlib<span class="pl-k">/</span>v1.<span class="pl-c1">3</span><span class="pl-k">/</span>Dates<span class="pl-k">/</span>src<span class="pl-k">/</span>parse<span class="pl-k">.</span>jl<span class="pl-k">:</span><span class="pl-c1">40</span>
[<span class="pl-c1">5</span>] <span class="pl-k">macro</span> expansion at <span class="pl-k">/</span>buildworker<span class="pl-k">/</span>worker<span class="pl-k">/</span>package_linux64<span class="pl-k">/</span>build<span class="pl-k">/</span>usr<span class="pl-k">/</span>share<span class="pl-k">/</span>julia<span class="pl-k">/</span>stdlib<span class="pl-k">/</span>v1.<span class="pl-c1">3</span><span class="pl-k">/</span>Dates<span class="pl-k">/</span>src<span class="pl-k">/</span>parse<span class="pl-k">.</span>jl<span class="pl-k">:</span><span class="pl-c1">150</span> [inlined]
[<span class="pl-c1">6</span>] tryparsenext_internal at <span class="pl-k">/</span>buildworker<span class="pl-k">/</span>worker<span class="pl-k">/</span>package_linux64<span class="pl-k">/</span>build<span class="pl-k">/</span>usr<span class="pl-k">/</span>share<span class="pl-k">/</span>julia<span class="pl-k">/</span>stdlib<span class="pl-k">/</span>v1.<span class="pl-c1">3</span><span class="pl-k">/</span>Dates<span class="pl-k">/</span>src<span class="pl-k">/</span>parse<span class="pl-k">.</span>jl<span class="pl-k">:</span><span class="pl-c1">127</span> [inlined]
[<span class="pl-c1">7</span>] <span class="pl-c1">parse</span>(<span class="pl-k">::</span><span class="pl-c1">Type{DateTime}</span>, <span class="pl-k">::</span><span class="pl-c1">String</span>, <span class="pl-k">::</span><span class="pl-c1">DateFormat{Symbol("Y-m-d H:M:S.s"),Tuple{Dates.DatePart{'Y'},Dates.Delim{Char,1},Dates.DatePart{'m'},Dates.Delim{Char,1},Dates.DatePart{'d'},Dates.Delim{Char,1},Dates.DatePart{'H'},Dates.Delim{Char,1},Dates.DatePart{'M'},Dates.Delim{Char,1},Dates.DatePart{'S'},Dates.Delim{Char,1},Dates.DatePart{'s'}}}</span>) at <span class="pl-k">/</span>buildworker<span class="pl-k">/</span>worker<span class="pl-k">/</span>package_linux64<span class="pl-k">/</span>build<span class="pl-k">/</span>usr<span class="pl-k">/</span>share<span class="pl-k">/</span>julia<span class="pl-k">/</span>stdlib<span class="pl-k">/</span>v1.<span class="pl-c1">3</span><span class="pl-k">/</span>Dates<span class="pl-k">/</span>src<span class="pl-k">/</span>parse<span class="pl-k">.</span>jl<span class="pl-k">:</span><span class="pl-c1">282</span>
[<span class="pl-c1">8</span>] <span class="pl-c1">DateTime</span>(<span class="pl-k">::</span><span class="pl-c1">String</span>, <span class="pl-k">::</span><span class="pl-c1">DateFormat{Symbol("Y-m-d H:M:S.s"),Tuple{Dates.DatePart{'Y'},Dates.Delim{Char,1},Dates.DatePart{'m'},Dates.Delim{Char,1},Dates.DatePart{'d'},Dates.Delim{Char,1},Dates.DatePart{'H'},Dates.Delim{Char,1},Dates.DatePart{'M'},Dates.Delim{Char,1},Dates.DatePart{'S'},Dates.Delim{Char,1},Dates.DatePart{'s'}}}</span>) at <span class="pl-k">/</span>buildworker<span class="pl-k">/</span>worker<span class="pl-k">/</span>package_linux64<span class="pl-k">/</span>build<span class="pl-k">/</span>usr<span class="pl-k">/</span>share<span class="pl-k">/</span>julia<span class="pl-k">/</span>stdlib<span class="pl-k">/</span>v1.<span class="pl-c1">3</span><span class="pl-k">/</span>Dates<span class="pl-k">/</span>src<span class="pl-k">/</span>io<span class="pl-k">.</span>jl<span class="pl-k">:</span><span class="pl-c1">482</span>
[<span class="pl-c1">9</span>] top<span class="pl-k">-</span>level scope at none<span class="pl-k">:</span><span class="pl-c1">0</span></pre></div>
<p dir="auto">Obviously, microseconds are not allowed in <code class="notranslate">DateTime</code> type.</p>
<p dir="auto">Although the <code class="notranslate">Time</code> type defined in the same built-in <code class="notranslate">Dates</code> package does allow for microseconds and even nanoseconds, constructing <code class="notranslate">Time</code> type variable by <a href="https://docs.julialang.org/en/v1/stdlib/Dates/#Dates.Time-Tuple%7BDateTime%7D" rel="nofollow">calling Time on DateTime</a> is limited in the same way.</p>
<p dir="auto">And yet allowing microseconds might be useful on some occasions (time from a GNSS receiver, for example). Furthermore, in Python their built-in <code class="notranslate">datetime</code> module does allow for microseconds in their <a href="https://docs.python.org/3.8/library/datetime.html#datetime.datetime" rel="nofollow">datetime</a> and <a href="https://docs.python.org/3.8/library/datetime.html#datetime.time" rel="nofollow">time</a> objects; interestingly enough, it only stores the subsecond time in (integer) microseconds.</p>
<p dir="auto">I am willing to prepare a PR, but first I wanted to ask what is the general viewpoint. Is there a chance that such an extension of Julia's <code class="notranslate">DateTime</code> and <code class="notranslate">Time</code> types could be accepted? I think it can be prepared such that it does not break an older code. But I am asking first because maybe there was already some discussion of this and the current state of things is a result of a decision supported by some arguments.</p> | <p dir="auto">While trying to parse our AV logs (<a href="https://ci.appveyor.com/api/projects/JuliaLang/julia/history?recordsNumber=1&startBuildId=20355614" rel="nofollow">https://ci.appveyor.com/api/projects/JuliaLang/julia/history?recordsNumber=1&startBuildId=20355614</a>), I realized that we apparently can't handle times more precise than milliseconds (even though we have Dates.Microsecond):</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="julia> DateTime("2018-11-16T10:26:14.2858074Z", dateformat"YYYY-MM-ddTHH:MM:SS.sZ")
ERROR: InexactError: convert(Dates.Decimal3, 2858074)
Stacktrace:
[1] tryparsenext at /data/vtjnash/julia/usr/share/julia/stdlib/v1.2/Dates/src/io.jl:119 [inlined]
[2] tryparsenext at /data/vtjnash/julia/usr/share/julia/stdlib/v1.2/Dates/src/io.jl:41 [inlined]
[3] macro expansion at /data/vtjnash/julia/usr/share/julia/stdlib/v1.2/Dates/src/parse.jl:64 [inlined]
[4] tryparsenext_core(::String, ::Int64, ::Int64, ::DateFormat{Symbol("YYYY-MM-ddTHH:MM:SS.sZ"),Tuple{Dates.DatePart{'Y'},Dates.Delim{Char,1},Dates.DatePart{'M'},Dates.Delim{Char,1},Date
s.DatePart{'d'},Dates.Delim{Char,1},Dates.DatePart{'H'},Dates.Delim{Char,1},Dates.DatePart{'M'},Dates.Delim{Char,1},Dates.DatePart{'S'},Dates.Delim{Char,1},Dates.DatePart{'s'},Dates.Delim{Char,1}}}, ::Bool) at /data/vtjnash/julia/usr/share/julia/stdlib/v1.2/Dates/src/parse.jl:40
[5] macro expansion at /data/vtjnash/julia/usr/share/julia/stdlib/v1.2/Dates/src/parse.jl:150 [inlined]
[6] tryparsenext_internal at /data/vtjnash/julia/usr/share/julia/stdlib/v1.2/Dates/src/parse.jl:127 [inlined]
[7] parse(::Type{DateTime}, ::String, ::DateFormat{Symbol("YYYY-MM-ddTHH:MM:SS.sZ"),Tuple{Dates.DatePart{'Y'},Dates.Delim{Char,1},Dates.DatePart{'M'},Dates.Delim{Char,1},Dates.DatePart{'d'},Dates.Delim{Char,1},Dates.DatePart{'H'},Dates.Delim{Char,1},Dates.DatePart{'M'},Dates.Delim{Char,1},Dates.DatePart{'S'},Dates.Delim{Char,1},Dates.DatePart{'s'},Dates.Delim{Char,1}}}) at /data/vtjnash/julia/usr/share/julia/stdlib/v1.2/Dates/src/parse.jl:282
[8] DateTime(::String, ::DateFormat{Symbol("YYYY-MM-ddTHH:MM:SS.sZ"),Tuple{Dates.DatePart{'Y'},Dates.Delim{Char,1},Dates.DatePart{'M'},Dates.Delim{Char,1},Dates.DatePart{'d'},Dates.Delim{Char,1},Dates.DatePart{'H'},Dates.Delim{Char,1},Dates.DatePart{'M'},Dates.Delim{Char,1},Dates.DatePart{'S'},Dates.Delim{Char,1},Dates.DatePart{'s'},Dates.Delim{Char,1}}}) at /data/vtjnash/julia/usr/share/julia/stdlib/v1.2/Dates/src/io.jl:432
[9] top-level scope at REPL[87]:1"><pre class="notranslate"><code class="notranslate">julia> DateTime("2018-11-16T10:26:14.2858074Z", dateformat"YYYY-MM-ddTHH:MM:SS.sZ")
ERROR: InexactError: convert(Dates.Decimal3, 2858074)
Stacktrace:
[1] tryparsenext at /data/vtjnash/julia/usr/share/julia/stdlib/v1.2/Dates/src/io.jl:119 [inlined]
[2] tryparsenext at /data/vtjnash/julia/usr/share/julia/stdlib/v1.2/Dates/src/io.jl:41 [inlined]
[3] macro expansion at /data/vtjnash/julia/usr/share/julia/stdlib/v1.2/Dates/src/parse.jl:64 [inlined]
[4] tryparsenext_core(::String, ::Int64, ::Int64, ::DateFormat{Symbol("YYYY-MM-ddTHH:MM:SS.sZ"),Tuple{Dates.DatePart{'Y'},Dates.Delim{Char,1},Dates.DatePart{'M'},Dates.Delim{Char,1},Date
s.DatePart{'d'},Dates.Delim{Char,1},Dates.DatePart{'H'},Dates.Delim{Char,1},Dates.DatePart{'M'},Dates.Delim{Char,1},Dates.DatePart{'S'},Dates.Delim{Char,1},Dates.DatePart{'s'},Dates.Delim{Char,1}}}, ::Bool) at /data/vtjnash/julia/usr/share/julia/stdlib/v1.2/Dates/src/parse.jl:40
[5] macro expansion at /data/vtjnash/julia/usr/share/julia/stdlib/v1.2/Dates/src/parse.jl:150 [inlined]
[6] tryparsenext_internal at /data/vtjnash/julia/usr/share/julia/stdlib/v1.2/Dates/src/parse.jl:127 [inlined]
[7] parse(::Type{DateTime}, ::String, ::DateFormat{Symbol("YYYY-MM-ddTHH:MM:SS.sZ"),Tuple{Dates.DatePart{'Y'},Dates.Delim{Char,1},Dates.DatePart{'M'},Dates.Delim{Char,1},Dates.DatePart{'d'},Dates.Delim{Char,1},Dates.DatePart{'H'},Dates.Delim{Char,1},Dates.DatePart{'M'},Dates.Delim{Char,1},Dates.DatePart{'S'},Dates.Delim{Char,1},Dates.DatePart{'s'},Dates.Delim{Char,1}}}) at /data/vtjnash/julia/usr/share/julia/stdlib/v1.2/Dates/src/parse.jl:282
[8] DateTime(::String, ::DateFormat{Symbol("YYYY-MM-ddTHH:MM:SS.sZ"),Tuple{Dates.DatePart{'Y'},Dates.Delim{Char,1},Dates.DatePart{'M'},Dates.Delim{Char,1},Dates.DatePart{'d'},Dates.Delim{Char,1},Dates.DatePart{'H'},Dates.Delim{Char,1},Dates.DatePart{'M'},Dates.Delim{Char,1},Dates.DatePart{'S'},Dates.Delim{Char,1},Dates.DatePart{'s'},Dates.Delim{Char,1}}}) at /data/vtjnash/julia/usr/share/julia/stdlib/v1.2/Dates/src/io.jl:432
[9] top-level scope at REPL[87]:1
</code></pre></div> | 1 |
<p dir="auto">I tried to compile a simple <code class="notranslate">hello.rs</code> and ran into the following - output below after turning on <code class="notranslate">RUST_BACKTRACE=1</code>:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="error: internal compiler error: unexpected failure
note: the compiler hit an unexpected failure path. this is a bug.
note: we would appreciate a bug report: http://doc.rust-lang.org/complement-bugreport.html
note: run with `RUST_BACKTRACE=1` for a backtrace
task 'rustc' failed at 'needs a temp dir', /home/rustbuild/src/rust-buildbot/slave/dist2-linux/build/src/libcore/option.rs:315
stack backtrace:
1: 0xb6a79d00 - rt::backtrace::imp::write::h71c0311871d92b33BCq
2: 0xb6a7cc80 - <unknown>
3: 0xb6dc6c50 - unwind::begin_unwind_inner::hecb213f6de4ee4abIxd
4: 0xb6dc68b0 - unwind::begin_unwind_fmt::h14c200c16a264a5eavd
5: 0xb6dc6850 - rust_begin_unwind
6: 0xb6e16530 - failure::fail_fmt::h767d9e1ca2333a4biqk
7: 0xb6f63b80 - <unknown>
8: 0xb6f5a2b0 - back::link::link_binary::hf1d7c6859ef3a2c6xBa
9: 0xb782d2f0 - driver::driver::phase_6_link_output::he5609548684fab17h2w
10: 0xb7824590 - driver::driver::compile_input::h665973ab72cfb8bbKww
11: 0xb78a89d0 - <unknown>
12: 0xb78a88a0 - <unknown>
13: 0xb6f8a8f0 - <unknown>
14: 0xb6f8a6e0 - <unknown>
15: 0xb7fc2550 - <unknown>
16: 0xb6dc6660 - <unknown>
17: 0xb6e26110 - <unknown>
18: 0xb6e260d0 - rust_try
19: 0xb6dc4780 - unwind::try::h38aefa52248da233qmd
20: 0xb6dc45f0 - task::Task::run::h52211e2f40072d874Bc
21: 0xb7fc22f0 - <unknown>
22: 0xb6dc5da0 - <unknown>
23: 0x0 - <unknown>"><pre class="notranslate"><code class="notranslate">error: internal compiler error: unexpected failure
note: the compiler hit an unexpected failure path. this is a bug.
note: we would appreciate a bug report: http://doc.rust-lang.org/complement-bugreport.html
note: run with `RUST_BACKTRACE=1` for a backtrace
task 'rustc' failed at 'needs a temp dir', /home/rustbuild/src/rust-buildbot/slave/dist2-linux/build/src/libcore/option.rs:315
stack backtrace:
1: 0xb6a79d00 - rt::backtrace::imp::write::h71c0311871d92b33BCq
2: 0xb6a7cc80 - <unknown>
3: 0xb6dc6c50 - unwind::begin_unwind_inner::hecb213f6de4ee4abIxd
4: 0xb6dc68b0 - unwind::begin_unwind_fmt::h14c200c16a264a5eavd
5: 0xb6dc6850 - rust_begin_unwind
6: 0xb6e16530 - failure::fail_fmt::h767d9e1ca2333a4biqk
7: 0xb6f63b80 - <unknown>
8: 0xb6f5a2b0 - back::link::link_binary::hf1d7c6859ef3a2c6xBa
9: 0xb782d2f0 - driver::driver::phase_6_link_output::he5609548684fab17h2w
10: 0xb7824590 - driver::driver::compile_input::h665973ab72cfb8bbKww
11: 0xb78a89d0 - <unknown>
12: 0xb78a88a0 - <unknown>
13: 0xb6f8a8f0 - <unknown>
14: 0xb6f8a6e0 - <unknown>
15: 0xb7fc2550 - <unknown>
16: 0xb6dc6660 - <unknown>
17: 0xb6e26110 - <unknown>
18: 0xb6e260d0 - rust_try
19: 0xb6dc4780 - unwind::try::h38aefa52248da233qmd
20: 0xb6dc45f0 - task::Task::run::h52211e2f40072d874Bc
21: 0xb7fc22f0 - <unknown>
22: 0xb6dc5da0 - <unknown>
23: 0x0 - <unknown>
</code></pre></div>
<p dir="auto"><code class="notranslate">hello.rs</code> is a simple calculator demo program found on rust-lang.org.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$ rustc --version
rustc 0.12.0 (ba4081a5a 2014-10-07 13:44:41 -0700)"><pre class="notranslate"><code class="notranslate">$ rustc --version
rustc 0.12.0 (ba4081a5a 2014-10-07 13:44:41 -0700)
</code></pre></div>
<p dir="auto">Please let me know if you need more information.</p> | <p dir="auto">When compiling without a valid temp directory (i.e. TMPDIR environment variable) rustc issues the following error:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="error: internal compiler error: unexpected failure
note: the compiler hit an unexpected failure path. this is a bug.
note: we would appreciate a bug report: http://doc.rust-lang.org/complement-bugreport.html
note: run with `RUST_BACKTRACE=1` for a backtrace
task 'rustc' failed at 'needs a temp dir', /path/to/rust/src/libstd/option.rs:167"><pre class="notranslate"><code class="notranslate">error: internal compiler error: unexpected failure
note: the compiler hit an unexpected failure path. this is a bug.
note: we would appreciate a bug report: http://doc.rust-lang.org/complement-bugreport.html
note: run with `RUST_BACKTRACE=1` for a backtrace
task 'rustc' failed at 'needs a temp dir', /path/to/rust/src/libstd/option.rs:167
</code></pre></div> | 1 |
<p dir="auto">I am using the BCELoss for input and target with size of batchsize * channel * height * width, I also want to weight the loss using a weight matrix of the same size, then I get the below error:</p>
<p dir="auto">File "/home/nianliu/anaconda3/lib/python3.6/site-packages/torch/nn/_functions/thnn/loss.py", line 15, in _resize_weight<br>
self.weight = self.weight.view(1, target.size(1)).expand_as(target)<br>
RuntimeError: size '[1 x 1]' is invalid for input of with 320 elements at /py/conda-bld/pytorch_1493680494901/work/torch/lib/TH/THStorage.c:59</p>
<p dir="auto">Apparently, on this line, it's incorrect to reshape the weight matrix to the size of 1*target.size(1), unless only the channel-wise weights are allowed.</p>
<p dir="auto">Since one may want to use sample-wise weights, channel-wise weights, pixel-wise weights, element-wise weights (jusk like my case), or other forms, I think we may remove the expanding operation and let users do it by themselves to ensure the flexibility.</p> | <p dir="auto">How can I save some tensor in python, but load it in libtorch:</p>
<p dir="auto">I save tensor named piror using python, using the code:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="torch.save(prior, 'prior.pth')"><pre class="notranslate"><code class="notranslate">torch.save(prior, 'prior.pth')
</code></pre></div>
<p dir="auto">And I load the tensor in libtorch using C++, by the following code:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="std::vector<torch::Tensor> tensorVec;
torch::load(tensorVec, "/app/model/prior.pth");
torch::Tensor priors = tensorVec[0];"><pre class="notranslate"><code class="notranslate">std::vector<torch::Tensor> tensorVec;
torch::load(tensorVec, "/app/model/prior.pth");
torch::Tensor priors = tensorVec[0];
</code></pre></div>
<p dir="auto">But I got the error:<br>
terminate called after throwing an instance of 'c10::Error'<br>
what(): <code class="notranslate">torch::jit::load()</code> received a file from <code class="notranslate">torch.save()</code>, but <code class="notranslate">torch::jit::load()</code> can only load files produced by <code class="notranslate">torch.jit.save()</code> (load at ../torch/csrc/jit/serialization/import.cpp:285)</p>
<p dir="auto">Why is that? And what should I do to solve the issue? Thanks in advance.</p>
<p dir="auto">cc <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/suo/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/suo">@suo</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/yf225/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/yf225">@yf225</a></p> | 0 |
<p dir="auto">There seems to be a problem when updating ACL when using object field aces. It is fairy simply to reproduce inside a test controller:</p>
<ol dir="auto">
<li>
<p dir="auto">create a simple domain object:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$demoObj = new Demo();
$demoObj->setId(2);
$oid = ObjectIdentity::fromDomainObject($demoObj);
$fieldName = "name";"><pre class="notranslate"><code class="notranslate">$demoObj = new Demo();
$demoObj->setId(2);
$oid = ObjectIdentity::fromDomainObject($demoObj);
$fieldName = "name";
</code></pre></div>
</li>
<li>
<p dir="auto">give the object a simple ROLE based ACL:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$aclProvider = $this->get('security.acl.provider');
$acl = $aclProvider->createAcl($oid);
$roleUser = new RoleSecurityIdentity('ROLE_USER');
$mask = new MaskBuilder(4); // 4 = EDIT
$acl->insertobjectFieldAce($fieldName, $roleUser, $mask->get());
$aclProvider->updateAcl($acl);"><pre class="notranslate"><code class="notranslate">$aclProvider = $this->get('security.acl.provider');
$acl = $aclProvider->createAcl($oid);
$roleUser = new RoleSecurityIdentity('ROLE_USER');
$mask = new MaskBuilder(4); // 4 = EDIT
$acl->insertobjectFieldAce($fieldName, $roleUser, $mask->get());
$aclProvider->updateAcl($acl);
</code></pre></div>
</li>
<li>
<p dir="auto">add another ROLE to the ACL:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$acl = $aclProvider->findAcl($oid);
$roleUser = new RoleSecurityIdentity('ROLE_FOO');
$mask = new MaskBuilder(4); // 4 = EDIT
$acl->insertobjectFieldAce($fieldName, $roleUser, $mask->get());
$aclProvider->updateAcl($acl);"><pre class="notranslate"><code class="notranslate">$acl = $aclProvider->findAcl($oid);
$roleUser = new RoleSecurityIdentity('ROLE_FOO');
$mask = new MaskBuilder(4); // 4 = EDIT
$acl->insertobjectFieldAce($fieldName, $roleUser, $mask->get());
$aclProvider->updateAcl($acl);
</code></pre></div>
</li>
<li>
<p dir="auto">add one more ROLE to the ACL:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$acl = $aclProvider->findAcl($oid);
$roleUser = new RoleSecurityIdentity('ROLE_BAR');
$mask = new MaskBuilder(4); // 4 = EDIT
$acl->insertobjectFieldAce($fieldName, $roleUser, $mask->get());
$aclProvider->updateAcl($acl);"><pre class="notranslate"><code class="notranslate">$acl = $aclProvider->findAcl($oid);
$roleUser = new RoleSecurityIdentity('ROLE_BAR');
$mask = new MaskBuilder(4); // 4 = EDIT
$acl->insertobjectFieldAce($fieldName, $roleUser, $mask->get());
$aclProvider->updateAcl($acl);
</code></pre></div>
</li>
</ol>
<p dir="auto">running step 4 produces the following:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" An exception occurred while executing 'UPDATE acl_entries SET ace_order
= 1 WHERE id = 40':
SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry
'19-22-name-1' for key
'UNIQ_46C8B806EA000B103D9AB4A64DEF17BCE4289BF4'"><pre class="notranslate"><code class="notranslate"> An exception occurred while executing 'UPDATE acl_entries SET ace_order
= 1 WHERE id = 40':
SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry
'19-22-name-1' for key
'UNIQ_46C8B806EA000B103D9AB4A64DEF17BCE4289BF4'
</code></pre></div>
<p dir="auto">If you remove the offending index from the database, the update works perfectly (the ace_order), so the problem seems to be that Symfony is not updating the ACL items in the correct order.</p>
<p dir="auto">The above does not affect class field aces.</p>
<p dir="auto">There is a second issue related to the above where the following throws the same execption:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" $index = 0;
$acl->deleteObjectFieldAce($index, $fieldName);
$acl->insertObjectFieldAce($fieldName, $roleUser, $mask->get());
$aclProvider->updateAcl($acl);"><pre class="notranslate"><code class="notranslate"> $index = 0;
$acl->deleteObjectFieldAce($index, $fieldName);
$acl->insertObjectFieldAce($fieldName, $roleUser, $mask->get());
$aclProvider->updateAcl($acl);
</code></pre></div>
<p dir="auto">there is a workaround by doing:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" $index = 0;
$acl->deleteObjectFieldAce($index, $fieldName);
$aclProvider->updateAcl($acl);
$acl->insertObjectFieldAce($fieldName, $roleUser, $mask->get());
$aclProvider->updateAcl($acl);"><pre class="notranslate"><code class="notranslate"> $index = 0;
$acl->deleteObjectFieldAce($index, $fieldName);
$aclProvider->updateAcl($acl);
$acl->insertObjectFieldAce($fieldName, $roleUser, $mask->get());
$aclProvider->updateAcl($acl);
</code></pre></div>
<p dir="auto">Once again this does not affect class field aces.</p> | <p dir="auto">Problem:</p>
<ol dir="auto">
<li>Session cookie <strong>is not</strong> present (deleted, expired, invalid, etc)</li>
<li>RememberMe cookie <strong>is</strong> present</li>
<li>User is logging out</li>
<li>RememberMe cookie is not deleted</li>
</ol>
<p dir="auto">Alternatively:</p>
<ol dir="auto">
<li>Session cookie <strong>is not</strong> present (deleted, expired, invalid, etc)</li>
<li>User is logging out</li>
<li>No <code class="notranslate">LogoutHandlerInterface</code> implementation is called (because there is no token)</li>
</ol>
<hr>
<p dir="auto">After debugging I see what happens:</p>
<ol dir="auto">
<li><code class="notranslate">security.logout_listener</code> <a href="https://github.com/symfony/symfony/blob/2.6/src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php#L298">is created</a></li>
<li><code class="notranslate">security.logout_listener</code> is given <a href="https://github.com/symfony/symfony/blob/2.6/src/Symfony/Component/Security/Http/Logout/LogoutHandlerInterface.php"><code class="notranslate">LogoutHandlerInterface</code>s</a>: <a href="https://github.com/symfony/symfony/blob/2.6/src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php#L323">1</a>, <a href="https://github.com/symfony/symfony/blob/2.6/src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php#L332">2</a>, <a href="https://github.com/symfony/symfony/blob/2.6/src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php#L337">3</a></li>
<li>authentication listeners <a href="https://github.com/symfony/symfony/blob/2.6/src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php#L357">are created</a> from factories, including <a href="https://github.com/symfony/symfony/blob/2.6/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/RememberMeFactory.php"><code class="notranslate">RememberMeFactory</code></a></li>
<li><code class="notranslate">RememberMeFactory</code> <a href="https://github.com/symfony/symfony/blob/2.6/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/RememberMeFactory.php#L51">adds</a> its own <code class="notranslate">LogoutHandlerInterface</code></li>
<li>Security listeners <a href="https://github.com/symfony/symfony/blob/2.6/src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php#L359">are merged</a></li>
<li><code class="notranslate">Firewall</code> <a href="https://github.com/symfony/symfony/blob/2.6/src/Symfony/Component/Security/Http/Firewall.php#L67">iterates over listeners</a> and stops on the first giving <code class="notranslate">Response</code>.</li>
</ol>
<p dir="auto">Problem? Listeners are called in this order: <code class="notranslate">ChannelListener</code>, <code class="notranslate">ContextListener</code>, <code class="notranslate">ContainerAwareEventDispatcher</code>, <strong><code class="notranslate">LogoutListener</code></strong>, <code class="notranslate">UsernamePasswordFormAuthenticationListener</code>, <strong><code class="notranslate">RememberMeListener</code></strong>, <code class="notranslate">AnonymousAuthenticationListener</code>, <code class="notranslate">AccessListener</code>.</p>
<p dir="auto">So if the user doesn't have a session cookie, <code class="notranslate">LogoutListener</code> <strong>doesn't call</strong> any <code class="notranslate">LogoutHandlerInterface</code>s, because <a href="https://github.com/symfony/symfony/blob/2.6/src/Symfony/Component/Security/Http/Firewall/LogoutListener.php#L113">there is no token (yet)</a>.</p>
<hr>
<p dir="auto">IMHO <code class="notranslate">LogoutListener</code> should be called last, after other listeners, which might authenticate user before he/she is logged out. Otherwise none of the handlers are called.</p>
<p dir="auto">In my situation it is crucial that <code class="notranslate">RememberMeServices</code> (as <code class="notranslate">LogoutHandlerInterface</code>) + <code class="notranslate">CookieClearingLogoutHandler</code> get called, because Symfony co–exists with non–Symfony app.</p>
<hr>
<p dir="auto">I don't know what's the correct solution, but as a fast hack it could work to:</p>
<ul dir="auto">
<li>override <code class="notranslate">LogoutListener</code> and call <code class="notranslate">LogoutHandlerInterface</code>s manually with a dummy <code class="notranslate">TokenInterface</code> if there is no token yet,</li>
<li>override <code class="notranslate">LogoutListener</code> and do custom actions here (but I believe <code class="notranslate">LogoutHandlerInterface</code>s should be used, as they might contain important logic),</li>
<li>override <a href="https://github.com/symfony/symfony/blob/2.6/src/Symfony/Component/Security/Http/Logout/LogoutSuccessHandlerInterface.php"><code class="notranslate">LogoutSuccessHandlerInterface</code></a>, but same problem as above,</li>
<li>override <code class="notranslate">FirewallMap</code> to change the order of listeners (as it should have already been done in <code class="notranslate">SecurityExtension</code>?).</li>
</ul> | 0 |
<h2 dir="auto">Steps to Reproduce</h2>
<p dir="auto"><code class="notranslate">await linkWithGoogleCredential</code> gets stuck - this used to work up to <code class="notranslate">0.5.20</code></p>
<p dir="auto">In the example below it never reaches log step <code class="notranslate">---------------------- 4</code>, BUT is also doesn't catch any exception.</p>
<div class="highlight highlight-source-dart notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content=" final FirebaseAuth _auth = FirebaseAuth.instance;
final GoogleSignIn _googleSignIn = GoogleSignIn();
GoogleSignInAuthentication googleAuth;
try {
print("---------------------- 1");
final GoogleSignInAccount googleUser = await _googleSignIn.signIn();
print("---------------------- 2");
googleAuth = await googleUser.authentication;
print("---------------------- 3");
final FirebaseUser user = await _auth.linkWithGoogleCredential(
accessToken: googleAuth.accessToken,
idToken: googleAuth.idToken,
);
print("---------------------- 4");
} catch (err) {
print("---------------------- 5");
print(err);
}"><pre class="notranslate"> <span class="pl-k">final</span> <span class="pl-c1">FirebaseAuth</span> _auth <span class="pl-k">=</span> <span class="pl-c1">FirebaseAuth</span>.instance;
<span class="pl-k">final</span> <span class="pl-c1">GoogleSignIn</span> _googleSignIn <span class="pl-k">=</span> <span class="pl-c1">GoogleSignIn</span>();
<span class="pl-c1">GoogleSignInAuthentication</span> googleAuth;
<span class="pl-k">try</span> {
<span class="pl-en">print</span>(<span class="pl-s">"---------------------- 1"</span>);
<span class="pl-k">final</span> <span class="pl-c1">GoogleSignInAccount</span> googleUser <span class="pl-k">=</span> <span class="pl-k">await</span> _googleSignIn.<span class="pl-en">signIn</span>();
<span class="pl-en">print</span>(<span class="pl-s">"---------------------- 2"</span>);
googleAuth <span class="pl-k">=</span> <span class="pl-k">await</span> googleUser.authentication;
<span class="pl-en">print</span>(<span class="pl-s">"---------------------- 3"</span>);
<span class="pl-k">final</span> <span class="pl-c1">FirebaseUser</span> user <span class="pl-k">=</span> <span class="pl-k">await</span> _auth.<span class="pl-en">linkWithGoogleCredential</span>(
accessToken<span class="pl-k">:</span> googleAuth.accessToken,
idToken<span class="pl-k">:</span> googleAuth.idToken,
);
<span class="pl-en">print</span>(<span class="pl-s">"---------------------- 4"</span>);
} <span class="pl-k">catch</span> (err) {
<span class="pl-en">print</span>(<span class="pl-s">"---------------------- 5"</span>);
<span class="pl-en">print</span>(err);
}</pre></div>
<h2 dir="auto">Logs</h2>
<div class="highlight highlight-source-yaml notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content=" # Firebase
firebase_auth: ^0.6.6
firebase_core: ^0.2.5+1
firebase_dynamic_links: ^0.1.0+1
cloud_firestore: ^0.8.2+3
# Social login providers
flutter_facebook_login: ^1.1.1
google_sign_in: ^3.2.4"><pre class="notranslate"> <span class="pl-c"><span class="pl-c">#</span> Firebase</span>
<span class="pl-ent">firebase_auth</span>: <span class="pl-s">^0.6.6</span>
<span class="pl-ent">firebase_core</span>: <span class="pl-s">^0.2.5+1</span>
<span class="pl-ent">firebase_dynamic_links</span>: <span class="pl-s">^0.1.0+1</span>
<span class="pl-ent">cloud_firestore</span>: <span class="pl-s">^0.8.2+3</span>
<span class="pl-c"><span class="pl-c">#</span> Social login providers</span>
<span class="pl-ent">flutter_facebook_login</span>: <span class="pl-s">^1.1.1</span>
<span class="pl-ent">google_sign_in</span>: <span class="pl-s">^3.2.4</span></pre></div>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="[√] Flutter (Channel stable, v1.0.0, on Microsoft Windows [Version 10.0.17134.407], locale en-NZ)
• Flutter version 1.0.0 at C:\Users\b\git\flutter
• Framework revision 5391447fae (12 days ago), 2018-11-29 19:41:26 -0800
• Engine revision 7375a0f414
• Dart version 2.1.0 (build 2.1.0-dev.9.4 f9ebf21297)
[√] Android toolchain - develop for Android devices (Android SDK 28.0.3)
• Android SDK at C:\Users\b\AppData\Local\Android\sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-28, build-tools 28.0.3
• ANDROID_HOME = C:\Users\b\AppData\Local\Android\sdk
• Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1136-b06)
• All Android licenses accepted.
[√] Android Studio (version 3.2)
• Android Studio at C:\Program Files\Android\Android Studio
• Flutter plugin version 31.1.1
• Dart plugin version 181.5656
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1136-b06)
[√] IntelliJ IDEA Community Edition (version 2017.3)
• IntelliJ at C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2017.3
• Flutter plugin version 19.1
• Dart plugin version 173.3727.108
[√] Connected device (1 available)
• Nexus 6P • ENU7N15A27004986 • android-arm64 • Android 8.1.0 (API 27)
• No issues found!"><pre class="notranslate"><code class="notranslate">[√] Flutter (Channel stable, v1.0.0, on Microsoft Windows [Version 10.0.17134.407], locale en-NZ)
• Flutter version 1.0.0 at C:\Users\b\git\flutter
• Framework revision 5391447fae (12 days ago), 2018-11-29 19:41:26 -0800
• Engine revision 7375a0f414
• Dart version 2.1.0 (build 2.1.0-dev.9.4 f9ebf21297)
[√] Android toolchain - develop for Android devices (Android SDK 28.0.3)
• Android SDK at C:\Users\b\AppData\Local\Android\sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-28, build-tools 28.0.3
• ANDROID_HOME = C:\Users\b\AppData\Local\Android\sdk
• Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1136-b06)
• All Android licenses accepted.
[√] Android Studio (version 3.2)
• Android Studio at C:\Program Files\Android\Android Studio
• Flutter plugin version 31.1.1
• Dart plugin version 181.5656
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1136-b06)
[√] IntelliJ IDEA Community Edition (version 2017.3)
• IntelliJ at C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2017.3
• Flutter plugin version 19.1
• Dart plugin version 173.3727.108
[√] Connected device (1 available)
• Nexus 6P • ENU7N15A27004986 • android-arm64 • Android 8.1.0 (API 27)
• No issues found!
</code></pre></div>
<div class="highlight highlight-source-groovy-gradle notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="buildscript {
ext.kotlin_version = '1.3.11'
repositories {
google()
jcenter()
maven {
url 'https://maven.fabric.io/public'
}
maven {
url 'https://dl.bintray.com/android/android-tools'
}
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.gms:google-services:4.2.0' // Google Services plugin
}
}"><pre class="notranslate"><span class="pl-en">buildscript</span> {
ext<span class="pl-k">.</span>kotlin_version <span class="pl-k">=</span> <span class="pl-s"><span class="pl-pds">'</span>1.3.11<span class="pl-pds">'</span></span>
repositories {
google()
jcenter()
maven {
url <span class="pl-s"><span class="pl-pds">'</span>https://maven.fabric.io/public<span class="pl-pds">'</span></span>
}
maven {
url <span class="pl-s"><span class="pl-pds">'</span>https://dl.bintray.com/android/android-tools<span class="pl-pds">'</span></span>
}
}
dependencies {
classpath <span class="pl-s"><span class="pl-pds">'</span>com.android.tools.build:gradle:3.2.1<span class="pl-pds">'</span></span>
classpath <span class="pl-s"><span class="pl-pds">"</span>org.jetbrains.kotlin:kotlin-gradle-plugin:<span class="pl-smi">$k<span class="pl-smi">otlin_version</span></span><span class="pl-pds">"</span></span>
classpath <span class="pl-s"><span class="pl-pds">'</span>com.google.gms:google-services:4.2.0<span class="pl-pds">'</span></span> <span class="pl-c"><span class="pl-c">//</span> Google Services plugin</span>
}
}</pre></div> | <p dir="auto">I'm using <code class="notranslate">0.7.0</code> with <code class="notranslate">AuthCredential</code> API. The code that causes the exception on Android (only) is this:</p>
<div class="highlight highlight-source-dart notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="Future<String> verifyPhoneComplete(String code, String verifyId) {
firebase.AuthCredential phoneCred =
firebase.PhoneAuthProvider.getCredential(
verificationId: verifyId,
smsCode: code
);
return _auth.linkWithCredential(phoneCred).then((user) => user.uid);"><pre class="notranslate"><span class="pl-c1">Future</span><<span class="pl-c1">String</span>> <span class="pl-en">verifyPhoneComplete</span>(<span class="pl-c1">String</span> code, <span class="pl-c1">String</span> verifyId) {
firebase.<span class="pl-c1">AuthCredential</span> phoneCred <span class="pl-k">=</span>
firebase.<span class="pl-c1">PhoneAuthProvider</span>.<span class="pl-en">getCredential</span>(
verificationId<span class="pl-k">:</span> verifyId,
smsCode<span class="pl-k">:</span> code
);
<span class="pl-k">return</span> _auth.<span class="pl-en">linkWithCredential</span>(phoneCred).<span class="pl-en">then</span>((user) <span class="pl-k">=></span> user.uid);</pre></div>
<p dir="auto">Exception:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="E/MethodChannel#plugins.flutter.io/firebase_auth( 1893): Failed to handle method call
E/MethodChannel#plugins.flutter.io/firebase_auth( 1893): java.lang.IllegalArgumentException: Given String is empty or null
E/MethodChannel#plugins.flutter.io/firebase_auth( 1893): at com.google.android.gms.common.internal.Preconditions.checkNotEmpty(Unknown Source)
E/MethodChannel#plugins.flutter.io/firebase_auth( 1893): at com.google.firebase.auth.EmailAuthProvider.getCredential(Unknown Source)
E/MethodChannel#plugins.flutter.io/firebase_auth( 1893): at io.flutter.plugins.firebaseauth.FirebaseAuthPlugin.handleLinkWithEmailAndPassword(FirebaseAuthPlugin.java:272)
E/MethodChannel#plugins.flutter.io/firebase_auth( 1893): at io.flutter.plugins.firebaseauth.FirebaseAuthPlugin.onMethodCall(FirebaseAuthPlugin.java:122)
E/MethodChannel#plugins.flutter.io/firebase_auth( 1893): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:200)
E/MethodChannel#plugins.flutter.io/firebase_auth( 1893): at io.flutter.view.FlutterNativeView$PlatformMessageHandlerImpl.handlePlatformMessage(FlutterNativeView.java:188)
E/MethodChannel#plugins.flutter.io/firebase_auth( 1893): at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:202)
E/MethodChannel#plugins.flutter.io/firebase_auth( 1893): at android.os.MessageQueue.nativePollOnce(Native Method)
E/MethodChannel#plugins.flutter.io/firebase_auth( 1893): at android.os.MessageQueue.next(MessageQueue.java:143)
E/MethodChannel#plugins.flutter.io/firebase_auth( 1893): at android.os.Looper.loop(Looper.java:122)
E/MethodChannel#plugins.flutter.io/firebase_auth( 1893): at android.app.ActivityThread.main(ActivityThread.java:5254)
E/MethodChannel#plugins.flutter.io/firebase_auth( 1893): at java.lang.reflect.Method.invoke(Native Method)
E/MethodChannel#plugins.flutter.io/firebase_auth( 1893): at java.lang.reflect.Method.invoke(Method.java:372)
E/MethodChannel#plugins.flutter.io/firebase_auth( 1893): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
E/MethodChannel#plugins.flutter.io/firebase_auth( 1893): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)"><pre class="notranslate"><code class="notranslate">E/MethodChannel#plugins.flutter.io/firebase_auth( 1893): Failed to handle method call
E/MethodChannel#plugins.flutter.io/firebase_auth( 1893): java.lang.IllegalArgumentException: Given String is empty or null
E/MethodChannel#plugins.flutter.io/firebase_auth( 1893): at com.google.android.gms.common.internal.Preconditions.checkNotEmpty(Unknown Source)
E/MethodChannel#plugins.flutter.io/firebase_auth( 1893): at com.google.firebase.auth.EmailAuthProvider.getCredential(Unknown Source)
E/MethodChannel#plugins.flutter.io/firebase_auth( 1893): at io.flutter.plugins.firebaseauth.FirebaseAuthPlugin.handleLinkWithEmailAndPassword(FirebaseAuthPlugin.java:272)
E/MethodChannel#plugins.flutter.io/firebase_auth( 1893): at io.flutter.plugins.firebaseauth.FirebaseAuthPlugin.onMethodCall(FirebaseAuthPlugin.java:122)
E/MethodChannel#plugins.flutter.io/firebase_auth( 1893): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:200)
E/MethodChannel#plugins.flutter.io/firebase_auth( 1893): at io.flutter.view.FlutterNativeView$PlatformMessageHandlerImpl.handlePlatformMessage(FlutterNativeView.java:188)
E/MethodChannel#plugins.flutter.io/firebase_auth( 1893): at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:202)
E/MethodChannel#plugins.flutter.io/firebase_auth( 1893): at android.os.MessageQueue.nativePollOnce(Native Method)
E/MethodChannel#plugins.flutter.io/firebase_auth( 1893): at android.os.MessageQueue.next(MessageQueue.java:143)
E/MethodChannel#plugins.flutter.io/firebase_auth( 1893): at android.os.Looper.loop(Looper.java:122)
E/MethodChannel#plugins.flutter.io/firebase_auth( 1893): at android.app.ActivityThread.main(ActivityThread.java:5254)
E/MethodChannel#plugins.flutter.io/firebase_auth( 1893): at java.lang.reflect.Method.invoke(Native Method)
E/MethodChannel#plugins.flutter.io/firebase_auth( 1893): at java.lang.reflect.Method.invoke(Method.java:372)
E/MethodChannel#plugins.flutter.io/firebase_auth( 1893): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
E/MethodChannel#plugins.flutter.io/firebase_auth( 1893): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
</code></pre></div>
<p dir="auto"><code class="notranslate">flutter doctor -v</code>:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="[✓] Flutter (Channel dev, v1.1.8, on Mac OS X 10.13.6 17G3025, locale en-US)
• Flutter version 1.1.8 at /Volumes/ExtStripe/Scratch/flutter
• Framework revision 985ccb6d14 (4 days ago), 2019-01-08 13:45:55 -0800
• Engine revision 7112b72cc2
• Dart version 2.1.1 (build 2.1.1-dev.0.1 ec86471ccc)
[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
• Android SDK at /Users/kika/Library/Android/sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-28, build-tools 28.0.3
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1248-b01)
• All Android licenses accepted.
[✓] iOS toolchain - develop for iOS devices (Xcode 10.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 10.1, Build version 10B61
• ios-deploy 2.0.0
• CocoaPods version 1.5.3
[✓] Android Studio (version 3.3)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 31.3.3
• Dart plugin version 182.5124
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1248-b01)
[✓] VS Code (version 1.28.2)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 2.20.0
[✓] Connected device (2 available)
• Android SDK built for x86 • emulator-5554 • android-x86 • Android 5.1.1 (API 22) (emulator)
• iPhone 5s • D0A87E46-DDD7-46CF-B400-B4A4799315FF • ios • iOS 12.1 (simulator)
• No issues found!"><pre class="notranslate"><code class="notranslate">[✓] Flutter (Channel dev, v1.1.8, on Mac OS X 10.13.6 17G3025, locale en-US)
• Flutter version 1.1.8 at /Volumes/ExtStripe/Scratch/flutter
• Framework revision 985ccb6d14 (4 days ago), 2019-01-08 13:45:55 -0800
• Engine revision 7112b72cc2
• Dart version 2.1.1 (build 2.1.1-dev.0.1 ec86471ccc)
[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
• Android SDK at /Users/kika/Library/Android/sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-28, build-tools 28.0.3
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1248-b01)
• All Android licenses accepted.
[✓] iOS toolchain - develop for iOS devices (Xcode 10.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 10.1, Build version 10B61
• ios-deploy 2.0.0
• CocoaPods version 1.5.3
[✓] Android Studio (version 3.3)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 31.3.3
• Dart plugin version 182.5124
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1248-b01)
[✓] VS Code (version 1.28.2)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 2.20.0
[✓] Connected device (2 available)
• Android SDK built for x86 • emulator-5554 • android-x86 • Android 5.1.1 (API 22) (emulator)
• iPhone 5s • D0A87E46-DDD7-46CF-B400-B4A4799315FF • ios • iOS 12.1 (simulator)
• No issues found!
</code></pre></div> | 1 |
<p dir="auto">I have a 50 node cluster with 1 rc with 1500 replicas. Each pod list takes few second and saturates 4 core master for that time. This slows down the whole system including scheduler, node/pod status updates, controllers etc.</p>
<p dir="auto"><a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/wojtek-t/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/wojtek-t">@wojtek-t</a></p> | <h3 dir="auto">Background</h3>
<p dir="auto">Currently, to serve LIST operation in apiserver we do the following:</p>
<ul dir="auto">
<li>read all objects of a given resource from etcd</li>
<li>filter out objects that user is not interested in</li>
<li>return the result</li>
</ul>
<p dir="auto">This means, that complexity of LIST operation is proportional to the number of all objects of a given type, not to the number of objects returned to the user.</p>
<p dir="auto">As an example, consider 1000-node cluster with 30.000 pods running in it. If a user has a ReplicationController with, say 10 replicas, then listing them requires requires reading all 30.000 from etcd, filtering them and returning just 10 which are interesting for the user.</p>
<h3 dir="auto">Proposal</h3>
<p dir="auto">We would like to make the LIST operation proportional to the number of elements it returns as a result.</p>
<p dir="auto">With the "Cacher" layer (used by watch in apiserver: <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="91791454" data-permission-text="Title is private" data-url="https://github.com/kubernetes/kubernetes/issues/10475" data-hovercard-type="issue" data-hovercard-url="/kubernetes/kubernetes/issues/10475/hovercard" href="https://github.com/kubernetes/kubernetes/issues/10475">#10475</a>), we already store a copies of objects with a given type in apiserver so if we add an Indexer to it (which should be simple), we would be able to effectively serve list operations from it.</p>
<p dir="auto">The problem is that a cache in apiserver is delayed (usually by tens to hundreds milliseconds). So if we just start to serve list operations from there we will change the semantics - e.g. it can happen that if you POST an object to apiserver and call LIST immediately after, the returned list may not contain already POSTed object.</p>
<p dir="auto">In many cases, this doesn't really matter, for example if LIST is only done to start watching from that point, we will get eventual consistency anyway (just the starting point changes). However, it can possibly break some other clients.</p>
<p dir="auto">I can see 3 main options:</p>
<ul dir="auto">
<li>just change the semantics</li>
<li>add an option (parameter) to LIST operation to force listing from database; however, in this case we should probably make listing from database by switched off by default to take advantage from it wherever it's possible</li>
<li>change the LIST operation to take ResourceVersion paramater and ensure that what we return in a result is no older than the given ResourceVersion (however, to make it efficient, we don't give any guarantees on how fresh the result is - we only promise to return the result not older than the given ResourceVersion).</li>
</ul>
<p dir="auto">[The third option is the best in my opinion].</p>
<p dir="auto">What do you think about it?</p>
<p dir="auto">@kubernetes/goog-control-plane @kubernetes/goog-csi<br>
<a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/lavalamp/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/lavalamp">@lavalamp</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/brendandburns/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/brendandburns">@brendandburns</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/quinton-hoole/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/quinton-hoole">@quinton-hoole</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/bgrant0607/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/bgrant0607">@bgrant0607</a><br>
<a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/smarterclayton/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/smarterclayton">@smarterclayton</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/derekwaynecarr/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/derekwaynecarr">@derekwaynecarr</a></p> | 1 |
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have searched the <a href="https://github.com/apache/incubator-dubbo/issues">issues</a> of this repository and believe that this is not a duplicate.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have checked the <a href="https://github.com/apache/incubator-dubbo/blob/master/FAQ.md">FAQ</a> of this repository and believe that this is not a duplicate.</li>
</ul>
<h3 dir="auto">Environment</h3>
<ul dir="auto">
<li>Dubbo version: 2.7.0-SNAPSHOT</li>
</ul>
<p dir="auto">场景描述:<br>
新版异步方式,会在ConsumerContextFilter中设置 remoteAddress</p>
<div class="highlight highlight-source-java notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="RpcContext.getContext()
.setInvoker(invoker)
.setInvocation(invocation)
.setLocalAddress(NetUtils.getLocalHost(), 0)
.setRemoteAddress(invoker.getUrl().getHost(),
invoker.getUrl().getPort());"><pre class="notranslate"><span class="pl-smi">RpcContext</span>.<span class="pl-en">getContext</span>()
.<span class="pl-en">setInvoker</span>(<span class="pl-s1">invoker</span>)
.<span class="pl-en">setInvocation</span>(<span class="pl-s1">invocation</span>)
.<span class="pl-en">setLocalAddress</span>(<span class="pl-smi">NetUtils</span>.<span class="pl-en">getLocalHost</span>(), <span class="pl-c1">0</span>)
.<span class="pl-en">setRemoteAddress</span>(<span class="pl-s1">invoker</span>.<span class="pl-en">getUrl</span>().<span class="pl-en">getHost</span>(),
<span class="pl-s1">invoker</span>.<span class="pl-en">getUrl</span>().<span class="pl-en">getPort</span>());</pre></div>
<p dir="auto">且会在 ExceptionFilter 的 doPostProcess中使用</p>
<div class="highlight highlight-source-java notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="logger.error("Got unchecked and undeclared exception which called by " + RpcContext.getContext().getRemoteHost()
+ ". service: " + invoker.getInterface().getName() + ", method: " + invocation.getMethodName()
+ ", exception: " + exception.getClass().getName() + ": " + exception.getMessage(), exception);"><pre class="notranslate"><span class="pl-s1">logger</span>.<span class="pl-en">error</span>(<span class="pl-s">"Got unchecked and undeclared exception which called by "</span> + <span class="pl-smi">RpcContext</span>.<span class="pl-en">getContext</span>().<span class="pl-en">getRemoteHost</span>()
+ <span class="pl-s">". service: "</span> + <span class="pl-s1">invoker</span>.<span class="pl-en">getInterface</span>().<span class="pl-en">getName</span>() + <span class="pl-s">", method: "</span> + <span class="pl-s1">invocation</span>.<span class="pl-en">getMethodName</span>()
+ <span class="pl-s">", exception: "</span> + <span class="pl-s1">exception</span>.<span class="pl-en">getClass</span>().<span class="pl-en">getName</span>() + <span class="pl-s">": "</span> + <span class="pl-s1">exception</span>.<span class="pl-en">getMessage</span>(), <span class="pl-s1">exception</span>);</pre></div>
<p dir="auto">那么问题来了。<br>
当连续的两个异步调用 A/B 在同一个线程先后执行的时候,A 的结果尚未返回,B 就开始执行,此时 A与 B 的 RpcContext 是同一个对象,就会导致 B 的 RpcContext 覆盖掉 A 的设置,导致 A 结果返回后获取到的 RpcContext 不再是 A 设置的内容,导致数据不一致。</p>
<p dir="auto">提供一种问题解决思路,仅供参考:</p>
<ol dir="auto">
<li>RpcContext 提供拷贝函数,对 attachments, values 进行深拷贝,其他属性浅拷贝;</li>
<li>AsyncRpcResult中 storedContext以及 storedServerContext 调用RpcContext.getContext().copy()完成赋值;</li>
</ol> | <ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have searched the <a href="https://github.com/apache/dubbo/issues">issues</a> of this repository and believe that this is not a duplicate.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have checked the <a href="https://github.com/apache/dubbo/blob/master/FAQ.md">FAQ</a> of this repository and believe that this is not a duplicate.</li>
</ul>
<h3 dir="auto">Environment</h3>
<ul dir="auto">
<li>Dubbo version: 2.7.x</li>
<li>Operating System version: xxx</li>
<li>Java version: 1.8</li>
</ul>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/6637227/70201717-6788d800-1752-11ea-8b7a-32685857a147.png"><img src="https://user-images.githubusercontent.com/6637227/70201717-6788d800-1752-11ea-8b7a-32685857a147.png" alt="image" style="max-width: 100%;"></a></p> | 0 |
<p dir="auto">by <strong>eyakubovich</strong>:</p>
<pre class="notranslate">What does 'go version' print?
go version go1.3.1 linux/amd64
What steps reproduce the problem?
If possible, include a link to a program on play.golang.org.
1. Run a server that closes a connection by timeout: <a href="http://play.golang.org/p/qfkdd6hDat" rel="nofollow">http://play.golang.org/p/qfkdd6hDat</a>
2. Run the client: <a href="http://play.golang.org/p/hxTAdcdrOY" rel="nofollow">http://play.golang.org/p/hxTAdcdrOY</a>
What happened?
The first request succeeds (get empty body) but subsequent requests intermittently fail.
Client output:
2014/09/03 17:53:56 []
2014/09/03 17:53:56 resp err= Get <a href="http://localhost/foo" rel="nofollow">http://localhost/foo</a>: EOF
2014/09/03 17:53:57 []
2014/09/03 17:53:57 resp err= Get <a href="http://localhost/foo" rel="nofollow">http://localhost/foo</a>: EOF
2014/09/03 17:53:58 []
2014/09/03 17:53:58 resp err= Get <a href="http://localhost/foo" rel="nofollow">http://localhost/foo</a>: EOF
2014/09/03 17:53:59 []
2014/09/03 17:53:59 resp err= Get <a href="http://localhost/foo" rel="nofollow">http://localhost/foo</a>: http: can't write HTTP request
on broken connection
2014/09/03 17:54:00 []
2014/09/03 17:54:00 resp err= Get <a href="http://localhost/foo" rel="nofollow">http://localhost/foo</a>: EOF
2014/09/03 17:54:01 []
2014/09/03 17:54:01 resp err= Get <a href="http://localhost/foo" rel="nofollow">http://localhost/foo</a>: EOF
2014/09/03 17:54:02 []
2014/09/03 17:54:02 resp err= Get <a href="http://localhost/foo" rel="nofollow">http://localhost/foo</a>: EOF
2014/09/03 17:54:03 []
2014/09/03 17:54:03 resp err= Get <a href="http://localhost/foo" rel="nofollow">http://localhost/foo</a>: EOF
2014/09/03 17:54:04 []
2014/09/03 17:54:04 resp err= Get <a href="http://localhost/foo" rel="nofollow">http://localhost/foo</a>: EOF
2014/09/03 17:54:05 body err= unexpected EOF
2014/09/03 17:54:06 []
2014/09/03 17:54:06 resp err= Get <a href="http://localhost/foo" rel="nofollow">http://localhost/foo</a>: EOF
2014/09/03 17:54:07 []
2014/09/03 17:54:07 resp err= Get <a href="http://localhost/foo" rel="nofollow">http://localhost/foo</a>: EOF
2014/09/03 17:54:08 []
2014/09/03 17:54:08 resp err= Get <a href="http://localhost/foo" rel="nofollow">http://localhost/foo</a>: EOF
2014/09/03 17:54:09 body err= unexpected EOF
2014/09/03 17:54:10 body err= unexpected EOF
2014/09/03 17:54:11 []
2014/09/03 17:54:11 resp err= Get <a href="http://localhost/foo" rel="nofollow">http://localhost/foo</a>: EOF
2014/09/03 17:54:12 body err= unexpected EOF
2014/09/03 17:54:13 []
2014/09/03 17:54:13 resp err= Get <a href="http://localhost/foo" rel="nofollow">http://localhost/foo</a>: EOF
2014/09/03 17:54:14 body err= unexpected EOF
2014/09/03 17:54:15 []
What should have happened instead?
- Subsequent requests should behave identically by returning empty body.
- Note that the server may have closed the connection abruptly. That can result in
resp.Body.Read() failing. However the Get() should not fail with EOF.
Please provide any additional information below.</pre> | <pre class="notranslate">Before filing a bug, please check whether it has been fixed since the
latest release. Search the issue tracker and check that you're running the
latest version of Go:
Run "go version" and compare against
<a href="http://golang.org/doc/devel/release.html" rel="nofollow">http://golang.org/doc/devel/release.html</a> If a newer version of Go exists,
install it and retry what you did to reproduce the problem.
Thanks.
What steps will reproduce the problem?
If possible, include a link to a program on play.golang.org.
1. the code <a href="http://play.golang.org/p/au0SyUo0jN" rel="nofollow">http://play.golang.org/p/au0SyUo0jN</a>
2.
3.
What is the expected output?
ability to connects to remote with local ip/port binding.
What do you see instead?
no local binding avaible.
Which compiler are you using (5g, 6g, 8g, gccgo)?
6g
Which operating system are you using?
Linux y570-yin 3.2.0-38-generic #61-Ubuntu SMP Tue Feb 19 12:18:21 UTC 2013 x86_64
x86_64 x86_64 GNU/Linux
Which version are you using? (run 'go version')
go version go1.0.3
Please provide any additional information below.
In some case, we wanna to dial remote host with special local address and local port,
net.DialIP/net.DialTCP/net.DialUDP/net.DialUnix can do this, but net.Dial no.
should we do it?</pre>
<p dir="auto">Attachments:</p>
<ol dir="auto">
<li><a href="https://storage.googleapis.com/go-attachment/4922/0/dialext.go" rel="nofollow">dialext.go</a> (3510 bytes)</li>
</ol> | 0 |
<p dir="auto">I have created a device that supports integer constant tensors (because I would like to be able to support the inputs to reshape etc...), but not the integer maths operators (because I'm not going to accelerate those initially).</p>
<p dir="auto">The gradient generation logic creates trees of integer maths. The constants for this maths are placed on the device, while the maths nodes themselves are placed on the CPU (as expected).</p>
<p dir="auto">This isn't very sensible.</p>
<p dir="auto">I think it would be better that constants are not placed on a device, unless they are feeding downstream nodes that are also on the same device.</p>
<p dir="auto">There may be some classes of constant (ones with a specific memory placement, very large ones), which would end up on a different device to their downstream nodes, but I think that the default should be to keep them together.</p> | <p dir="auto">Are tf.TFRecord(num_parallel_reads) and interleave(num_parallel_calls) duplicated? what is the behavior if they are both set > 1? And the difference of shuffle before repeat and shuffle after repeat? I think the design of Dataset is too complicated, we need a more clear approach.</p> | 0 |
<h1 dir="auto">Bug report</h1>
<blockquote>
<p dir="auto">webpack.config.js<br>
<code class="notranslate">{ target: 'es5' }</code></p>
</blockquote>
<blockquote>
<p dir="auto">build result</p>
</blockquote>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="1. __webpack_require__.a(module, async (__webpack_handle_async_dependencies__) => {}
2. var wrapDeps = function(deps) { return deps.map(function(dep) {
if(dep !== null && typeof dep === "object") {
if(dep[webpackThen]) return dep;
if(dep.then) {
var queue = [], result;
dep.then(function(r) {
obj[webpackExports] = r;
completeQueue(queue);
queue = 0;
});
var obj = { [webpackThen]: (fn, reject) => { queueFunction(queue, fn); dep.catch(reject); } };
return obj;
}
}
return { [webpackThen]: (fn) => { completeFunction(fn); }, [webpackExports]: dep };
}); };"><pre class="notranslate"><code class="notranslate">1. __webpack_require__.a(module, async (__webpack_handle_async_dependencies__) => {}
2. var wrapDeps = function(deps) { return deps.map(function(dep) {
if(dep !== null && typeof dep === "object") {
if(dep[webpackThen]) return dep;
if(dep.then) {
var queue = [], result;
dep.then(function(r) {
obj[webpackExports] = r;
completeQueue(queue);
queue = 0;
});
var obj = { [webpackThen]: (fn, reject) => { queueFunction(queue, fn); dep.catch(reject); } };
return obj;
}
}
return { [webpackThen]: (fn) => { completeFunction(fn); }, [webpackExports]: dep };
}); };
</code></pre></div>
<blockquote>
<p dir="auto">files at:</p>
</blockquote>
<ol dir="auto">
<li>webpack/lib/dependencies/HarmonyCompatibilityDependency.js</li>
<li>webpack/lib/runtime/AsyncModuleRuntimeModule.js</li>
</ol>
<blockquote>
<p dir="auto">why not run supportsArrowFunction()?</p>
</blockquote>
<ol dir="auto">
<li>runtimeTemplate.supportsArrowFunction()</li>
<li>Can traditional functions cause other errors ?</li>
</ol>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="new InitFragment(
`${RuntimeGlobals.asyncModule}(${module.moduleArgument}, **async (__webpack_handle_async_dependencies__) => {\n`**,
InitFragment.STAGE_ASYNC_BOUNDARY,
0,
undefined,
module.buildMeta.async
? `\n__webpack_handle_async_dependencies__();\n}, 1);`
: "\n});"
)"><pre class="notranslate"><code class="notranslate">new InitFragment(
`${RuntimeGlobals.asyncModule}(${module.moduleArgument}, **async (__webpack_handle_async_dependencies__) => {\n`**,
InitFragment.STAGE_ASYNC_BOUNDARY,
0,
undefined,
module.buildMeta.async
? `\n__webpack_handle_async_dependencies__();\n}, 1);`
: "\n});"
)
</code></pre></div>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="`var wrapDeps = ${runtimeTemplate.returningFunction(
`deps.map(${runtimeTemplate.basicFunction("dep", [
'if(dep !== null && typeof dep === "object") {',
Template.indent([
"if(dep[webpackThen]) return dep;",
"if(dep.then) {",
Template.indent([
"var queue = [], result;",
`dep.then(${runtimeTemplate.basicFunction("r", [
"obj[webpackExports] = r;",
"completeQueue(queue);",
"queue = 0;"
])});`,
"**var obj = { [webpackThen]: (fn, reject) => { queueFunction(queue, fn); dep.catch(reject); } };**",
"return obj;"
]),
"}"
]),
"}",
"**return { [webpackThen]: (fn) => { completeFunction(fn); }, [webpackExports]: dep };**"
])})`,
"deps"
)};`,"><pre class="notranslate"><code class="notranslate">`var wrapDeps = ${runtimeTemplate.returningFunction(
`deps.map(${runtimeTemplate.basicFunction("dep", [
'if(dep !== null && typeof dep === "object") {',
Template.indent([
"if(dep[webpackThen]) return dep;",
"if(dep.then) {",
Template.indent([
"var queue = [], result;",
`dep.then(${runtimeTemplate.basicFunction("r", [
"obj[webpackExports] = r;",
"completeQueue(queue);",
"queue = 0;"
])});`,
"**var obj = { [webpackThen]: (fn, reject) => { queueFunction(queue, fn); dep.catch(reject); } };**",
"return obj;"
]),
"}"
]),
"}",
"**return { [webpackThen]: (fn) => { completeFunction(fn); }, [webpackExports]: dep };**"
])})`,
"deps"
)};`,
</code></pre></div>
<p dir="auto"><strong>Other relevant information:</strong><br>
webpack version: 5.25.0<br>
Node.js version: 12<br>
Operating System: mac<br>
Additional tools:</p>
<p dir="auto">english is poor, sry</p> | <h1 dir="auto">Bug report</h1>
<p dir="auto"><strong>What is the current behavior?</strong></p>
<p dir="auto">Not sure if this is a problem with a loader or webpack itself, but on a project that is using typescript, I'm getting a warning:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content=" WARNING in ./React/src/components/_shared/form/form-model.ts
17:0-39 "export 'IValidation' was not found in '_types/IValidation'"
at HarmonyExportImportedSpecifierDependency._getErrors (C:\project\node_modules\webpack\lib\dependencies\HarmonyExportImportedSpecifierDependency.js:352:11)
at HarmonyExportImportedSpecifierDependency.getWarnings (C:\project\node_modules\webpack\lib\dependencies\HarmonyExportImportedSpecifierDependency.js:299:15)
at Compilation.reportDependencyErrorsAndWarnings (C:\project\node_modules\webpack\lib\Compilation.js:985:24)
at Compilation.finish (C:\project\node_modules\webpack\lib\Compilation.js:817:9)
at hooks.make.callAsync.err (C:\project\node_modules\webpack\lib\Compiler.js:479:17)
at _done (eval at create (C:\project\node_modules\tapable\lib\HookCodeFactory.js:24:12), <anonymous>:9:1)
at _err0 (eval at create (C:\project\node_modules\tapable\lib\HookCodeFactory.js:24:12), <anonymous>:20:22)
at _addModuleChain (C:\project\node_modules\webpack\lib\Compilation.js:758:12)
at processModuleDependencies.err (C:\project\node_modules\webpack\lib\Compilation.js:697:9)
at _combinedTickCallback (internal/process/next_tick.js:131:7)
at process._tickCallback (internal/process/next_tick.js:180:9)"><pre class="notranslate"> <span class="pl-c1">WARNING</span> <span class="pl-k">in</span> <span class="pl-kos">.</span><span class="pl-c1">/</span><span class="pl-v">React</span><span class="pl-c1">/</span><span class="pl-s1">src</span><span class="pl-c1">/</span><span class="pl-s1">components</span><span class="pl-c1">/</span><span class="pl-s1">_shared</span><span class="pl-c1">/</span><span class="pl-s1">form</span><span class="pl-c1">/</span><span class="pl-s1">form</span><span class="pl-c1">-</span><span class="pl-s1">model</span><span class="pl-kos">.</span><span class="pl-c1">ts</span>
<span class="pl-c1">17</span>:<span class="pl-c1">0</span><span class="pl-c1">-</span><span class="pl-c1">39</span> <span class="pl-s">"export 'IValidation' was not found in '_types/IValidation'"</span>
<span class="pl-s1">at</span><span class="pl-kos"></span> <span class="pl-v">HarmonyExportImportedSpecifierDependency</span><span class="pl-kos">.</span><span class="pl-en">_getErrors</span> <span class="pl-kos">(</span><span class="pl-v">C</span>:\p<span class="pl-s1">roject</span>\n<span class="pl-s1">ode_modules</span>\w<span class="pl-s1">ebpack</span>\l<span class="pl-s1">ib</span>\d<span class="pl-s1">ependencies</span>\H<span class="pl-s1">armonyExportImportedSpecifierDependency</span><span class="pl-kos">.</span><span class="pl-c1">js</span>:<span class="pl-c1">352</span>:<span class="pl-c1">11</span><span class="pl-kos">)</span>
<span class="pl-s1">at</span><span class="pl-kos"></span> <span class="pl-v">HarmonyExportImportedSpecifierDependency</span><span class="pl-kos">.</span><span class="pl-en">getWarnings</span> <span class="pl-kos">(</span><span class="pl-v">C</span>:\p<span class="pl-s1">roject</span>\n<span class="pl-s1">ode_modules</span>\w<span class="pl-s1">ebpack</span>\l<span class="pl-s1">ib</span>\d<span class="pl-s1">ependencies</span>\H<span class="pl-s1">armonyExportImportedSpecifierDependency</span><span class="pl-kos">.</span><span class="pl-c1">js</span>:<span class="pl-c1">299</span>:<span class="pl-c1">15</span><span class="pl-kos">)</span>
<span class="pl-s1">at</span><span class="pl-kos"></span> <span class="pl-v">Compilation</span><span class="pl-kos">.</span><span class="pl-en">reportDependencyErrorsAndWarnings</span> <span class="pl-kos">(</span><span class="pl-v">C</span>:\p<span class="pl-s1">roject</span>\n<span class="pl-s1">ode_modules</span>\w<span class="pl-s1">ebpack</span>\l<span class="pl-s1">ib</span>\C<span class="pl-s1">ompilation</span><span class="pl-kos">.</span><span class="pl-c1">js</span>:<span class="pl-c1">985</span>:<span class="pl-c1">24</span><span class="pl-kos">)</span>
<span class="pl-s1">at</span><span class="pl-kos"></span> <span class="pl-v">Compilation</span><span class="pl-kos">.</span><span class="pl-en">finish</span> <span class="pl-kos">(</span><span class="pl-v">C</span>:\p<span class="pl-s1">roject</span>\n<span class="pl-s1">ode_modules</span>\w<span class="pl-s1">ebpack</span>\l<span class="pl-s1">ib</span>\C<span class="pl-s1">ompilation</span><span class="pl-kos">.</span><span class="pl-c1">js</span>:<span class="pl-c1">817</span>:<span class="pl-c1">9</span><span class="pl-kos">)</span>
<span class="pl-s1">at</span> <span class="pl-s1">hooks</span><span class="pl-kos">.</span><span class="pl-c1">make</span><span class="pl-kos">.</span><span class="pl-c1">callAsync</span><span class="pl-kos">.</span><span class="pl-en">err</span> <span class="pl-kos">(</span><span class="pl-v">C</span>:\p<span class="pl-s1">roject</span>\n<span class="pl-s1">ode_modules</span>\w<span class="pl-s1">ebpack</span>\l<span class="pl-s1">ib</span>\C<span class="pl-s1">ompiler</span><span class="pl-kos">.</span><span class="pl-c1">js</span>:<span class="pl-c1">479</span>:<span class="pl-c1">17</span><span class="pl-kos">)</span>
<span class="pl-s1">at</span> <span class="pl-s1">_done</span> <span class="pl-kos">(</span><span class="pl-s1">eval</span> <span class="pl-s1">at</span> <span class="pl-en">create</span> <span class="pl-kos">(</span><span class="pl-v">C</span>:\p<span class="pl-s1">roject</span>\n<span class="pl-s1">ode_modules</span>\t<span class="pl-s1">apable</span>\l<span class="pl-s1">ib</span>\H<span class="pl-s1">ookCodeFactory</span><span class="pl-kos">.</span><span class="pl-c1">js</span>:<span class="pl-c1">24</span>:<span class="pl-c1">12</span><span class="pl-kos">)</span><span class="pl-kos">,</span> <span class="pl-c1"><</span><span class="pl-ent">anonymous</span><span class="pl-c1">></span>:9:1)
at _err0 (eval at create (C:\project\node_modules\tapable\lib\HookCodeFactory.js:24:12), <span class="pl-c1"><</span><span class="pl-ent">anonymous</span><span class="pl-c1">></span>:20:22)
at _addModuleChain (C:\project\node_modules\webpack\lib\Compilation.js:758:12)
at processModuleDependencies.err (C:\project\node_modules\webpack\lib\Compilation.js:697:9)
at _combinedTickCallback (internal/process/next_tick.js:131:7)
at process._tickCallback (internal/process/next_tick.js:180:9)</pre></div>
<p dir="auto">However, the file in question _types/IValidation, is imported in numerous other files without any warnings being emitted related to those other files that are also importing IValidation from _types/IValidation.</p>
<p dir="auto">The contents of the file are simple, and there is an "export interface IValidation" in the file:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="export enum ValidationType {
Required,
Min,
Max,
MinLength,
MaxLength,
}
export interface IValidation {
validationType: ValidationType;
errorMessage?: string;
minValue?: number;
maxValue?: number;
maxLength?: number;
minLength?: number;
}"><pre class="notranslate"><span class="pl-k">export</span> <span class="pl-s1">enum</span> <span class="pl-v">ValidationType</span> <span class="pl-kos">{</span>
<span class="pl-v">Required</span><span class="pl-kos">,</span>
<span class="pl-v">Min</span><span class="pl-kos">,</span>
<span class="pl-v">Max</span><span class="pl-kos">,</span>
<span class="pl-v">MinLength</span><span class="pl-kos">,</span>
<span class="pl-v">MaxLength</span><span class="pl-kos">,</span>
<span class="pl-kos">}</span>
<span class="pl-k">export</span> <span class="pl-s1">interface</span> <span class="pl-v">IValidation</span> <span class="pl-kos">{</span>
<span class="pl-c1">validationType</span>: <span class="pl-v">ValidationType</span><span class="pl-kos"></span><span class="pl-kos">;</span>
<span class="pl-s1">errorMessage</span>?<span class="pl-s1"></span>: <span class="pl-s1">string</span><span class="pl-kos">;</span>
<span class="pl-s1">minValue</span>?<span class="pl-s1"></span>: <span class="pl-s1">number</span><span class="pl-kos">;</span>
<span class="pl-s1">maxValue</span>?<span class="pl-s1"></span>: <span class="pl-s1">number</span><span class="pl-kos">;</span>
<span class="pl-s1">maxLength</span>?<span class="pl-s1"></span>: <span class="pl-s1">number</span><span class="pl-kos">;</span>
<span class="pl-s1">minLength</span>?<span class="pl-s1"></span>: <span class="pl-s1">number</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span></pre></div>
<p dir="auto">We do have our "src" directory set as a module resolution root in the resolve section of our webpack config, but I also tried importing the file with a relative path and still get the warning.</p>
<p dir="auto">I am kind of wondering if this is related to typescript. We are using ts-loader, but we have it doing type checking only and are doing transpiling with babel.</p>
<p dir="auto"><strong>If the current behavior is a bug, please provide the steps to reproduce.</strong><br>
Not sure since I get the warning due to the import of the file in question in one file but not due to several other files that also import the same interface from the same file.</p>
<p dir="auto"><strong>What is the expected behavior?</strong><br>
It should not issue a warning about a missing export if the export clearly exists.</p>
<p dir="auto"><strong>Other relevant information:</strong><br>
webpack version: 4.8.3<br>
Node.js version: 8.9.1<br>
Operating System: Windows 10<br>
Additional tools: webpack-cli 2.1.3</p> | 0 |
<p dir="auto">When building a large library many classes need to define fields and methods that are meant only for use by other classes within the library, not the client. There is no simple way to express this in TypeScript. One can duplicate the entire public API in a set of mirror interfaces classes, but that creates a lot of duplicated code & doc maintenance, and sometime you really want to expose class names to the client. There appears to be a common convention of using the <a class="user-mention notranslate" data-hovercard-type="organization" data-hovercard-url="/orgs/internal/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/internal">@internal</a> JSDoc tag in this situation but it is not enforced by the compiler nor recognized by JSDoc.</p>
<p dir="auto">The solution in Java is package-private access. The analogous mechanism in TS would be namespace-private access.</p> | <p dir="auto">Currently to protect integrity of data one can only use classes with private or protected fields. Classes are harder to work with compared to object literals. Being able to specify that certain fields are invisible to outside modules would be a valuable addition to support programming in functional style in TypeScript.</p>
<p dir="auto">So what I am suggesting is to be able to specify whether a field of an interface is exported from a module or not. This also means that the instance of such interface can only be created within the module it is declared.</p>
<p dir="auto">The similar features can be found in:</p>
<ul dir="auto">
<li>F# called <code class="notranslate">signature files</code>: <a href="http://msdn.microsoft.com/en-us/library/dd233196.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/dd233196.aspx</a></li>
<li>Haskell called <code class="notranslate">export lists</code>: <a href="http://www.haskell.org/onlinereport/modules.html" rel="nofollow">http://www.haskell.org/onlinereport/modules.html</a></li>
</ul> | 1 |
<ul dir="auto">
<li>Electron version: 1.4.5</li>
<li>Operating system: win10</li>
</ul>
<p dir="auto">Hi!<br>
Recently I updated electron from 1.4.4 to 1.4.5 and reinstalled node_modules<br>
I got an error during npm install (as I can see it fails on spellchecker modules install):</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="gyp ERR! configure error
gyp ERR! stack Error: iojs-v1.4.5.tar.gz local checksum d47724cf608ccdcc59aeabd5d508e169f92caef9ccf56b360bc97449b2bbc4aa not match remote 5be8e4ffbd9eb3a07b003530af5e1757c0a53e8ef9280b40634e3d6f4198995e
gyp ERR! stack at deref (C:\Program Files (x86)\Nodist\bin\node_modules\npm\node_modules\node-gyp\lib\install.js:266:20)
gyp ERR! stack at Request.<anonymous> (C:\Program Files (x86)\Nodist\bin\node_modules\npm\node_modules\node-gyp\lib\install.js:354:24)
gyp ERR! stack at emitOne (events.js:82:20)
gyp ERR! stack at Request.emit (events.js:169:7)
gyp ERR! stack at IncomingMessage.<anonymous> (C:\Program Files (x86)\Nodist\bin\node_modules\npm\node_modules\request\request.js:969:12)
gyp ERR! stack at emitNone (events.js:72:20)
gyp ERR! stack at IncomingMessage.emit (events.js:166:7)
gyp ERR! stack at endReadableNT (_stream_readable.js:921:12)
gyp ERR! stack at nextTickCallbackWith2Args (node.js:442:9)
gyp ERR! stack at process._tickCallback (node.js:356:17)
gyp ERR! System Windows_NT 10.0.14393
gyp ERR! command "C:\\Program Files (x86)\\Nodist\\v-x64\\4.6.1\\node.exe" "C:\\Program Files (x86)\\Nodist\\bin\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd D:\UNIF-CIRC\project\ansibleclient\src\electron\app\node_modules\keytar
gyp ERR! node -v v4.6.1
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok
npm ERR! Windows_NT 10.0.14393
npm ERR! argv "C:\\Program Files (x86)\\Nodist\\v-x64\\4.6.1\\node.exe" "C:\\Program Files (x86)\\Nodist\\bin\\node_modules\\npm\\bin\\npm-cli.js" "install" "--production" "--cache-min" "999999999" "--build-from-source"
npm ERR! node v4.6.1
npm ERR! npm v4.0.1
npm ERR! code ELIFECYCLE
npm ERR! keytar@3.0.2 install: node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the keytar@3.0.2 install script node-gyp rebuild.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the keytar package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs keytar
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls keytar
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! D:\UNIF-CIRC\project\ansibleclient\src\electron\app\npm-debug.log
at ChildProcess.<anonymous> (D:\UNIF-CIRC\project\ansibleclient\src\electron\node_modules\electron-builder\src\util\util.ts:160:14)
at ChildProcess.g (events.js:260:16)
at emitTwo (events.js:87:13)
at ChildProcess.emit (events.js:172:7)
at maybeClose (internal/child_process.js:829:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
`From previous event:
at spawn (D:\UNIF-CIRC\project\ansibleclient\src\electron\node_modules\electron-builder\src\util\util.ts:123:3)
at spawnNpmProduction (D:\UNIF-CIRC\project\ansibleclient\src\electron\node_modules\electron-builder\src\util\util.ts:49:3)
at Object.installDependencies (D:\UNIF-CIRC\project\ansibleclient\src\electron\node_modules\electron-builder\src\util\util.ts:20:122)
at D:\UNIF-CIRC\project\ansibleclient\src\electron\node_modules\electron-builder\src\install-app-deps.ts:34:2
at next (native)
From previous event:
at tsAwaiter (D:\UNIF-CIRC\project\ansibleclient\src\electron\node_modules\electron-builder\src\util\awaiter.ts:10:47)
at main (D:\UNIF-CIRC\project\ansibleclient\src\electron\node_modules\electron-builder\src\install-app-deps.ts:23:3)
at Object.<anonymous> (D:\UNIF-CIRC\project\ansibleclient\src\electron\node_modules\electron-builder\out\install-app-deps.js:28:1)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Function.Module.runMain (module.js:441:10)
at startup (node.js:139:18)
at node.js:974:3"><pre class="notranslate"><code class="notranslate">gyp ERR! configure error
gyp ERR! stack Error: iojs-v1.4.5.tar.gz local checksum d47724cf608ccdcc59aeabd5d508e169f92caef9ccf56b360bc97449b2bbc4aa not match remote 5be8e4ffbd9eb3a07b003530af5e1757c0a53e8ef9280b40634e3d6f4198995e
gyp ERR! stack at deref (C:\Program Files (x86)\Nodist\bin\node_modules\npm\node_modules\node-gyp\lib\install.js:266:20)
gyp ERR! stack at Request.<anonymous> (C:\Program Files (x86)\Nodist\bin\node_modules\npm\node_modules\node-gyp\lib\install.js:354:24)
gyp ERR! stack at emitOne (events.js:82:20)
gyp ERR! stack at Request.emit (events.js:169:7)
gyp ERR! stack at IncomingMessage.<anonymous> (C:\Program Files (x86)\Nodist\bin\node_modules\npm\node_modules\request\request.js:969:12)
gyp ERR! stack at emitNone (events.js:72:20)
gyp ERR! stack at IncomingMessage.emit (events.js:166:7)
gyp ERR! stack at endReadableNT (_stream_readable.js:921:12)
gyp ERR! stack at nextTickCallbackWith2Args (node.js:442:9)
gyp ERR! stack at process._tickCallback (node.js:356:17)
gyp ERR! System Windows_NT 10.0.14393
gyp ERR! command "C:\\Program Files (x86)\\Nodist\\v-x64\\4.6.1\\node.exe" "C:\\Program Files (x86)\\Nodist\\bin\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd D:\UNIF-CIRC\project\ansibleclient\src\electron\app\node_modules\keytar
gyp ERR! node -v v4.6.1
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok
npm ERR! Windows_NT 10.0.14393
npm ERR! argv "C:\\Program Files (x86)\\Nodist\\v-x64\\4.6.1\\node.exe" "C:\\Program Files (x86)\\Nodist\\bin\\node_modules\\npm\\bin\\npm-cli.js" "install" "--production" "--cache-min" "999999999" "--build-from-source"
npm ERR! node v4.6.1
npm ERR! npm v4.0.1
npm ERR! code ELIFECYCLE
npm ERR! keytar@3.0.2 install: node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the keytar@3.0.2 install script node-gyp rebuild.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the keytar package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs keytar
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls keytar
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! D:\UNIF-CIRC\project\ansibleclient\src\electron\app\npm-debug.log
at ChildProcess.<anonymous> (D:\UNIF-CIRC\project\ansibleclient\src\electron\node_modules\electron-builder\src\util\util.ts:160:14)
at ChildProcess.g (events.js:260:16)
at emitTwo (events.js:87:13)
at ChildProcess.emit (events.js:172:7)
at maybeClose (internal/child_process.js:829:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
`From previous event:
at spawn (D:\UNIF-CIRC\project\ansibleclient\src\electron\node_modules\electron-builder\src\util\util.ts:123:3)
at spawnNpmProduction (D:\UNIF-CIRC\project\ansibleclient\src\electron\node_modules\electron-builder\src\util\util.ts:49:3)
at Object.installDependencies (D:\UNIF-CIRC\project\ansibleclient\src\electron\node_modules\electron-builder\src\util\util.ts:20:122)
at D:\UNIF-CIRC\project\ansibleclient\src\electron\node_modules\electron-builder\src\install-app-deps.ts:34:2
at next (native)
From previous event:
at tsAwaiter (D:\UNIF-CIRC\project\ansibleclient\src\electron\node_modules\electron-builder\src\util\awaiter.ts:10:47)
at main (D:\UNIF-CIRC\project\ansibleclient\src\electron\node_modules\electron-builder\src\install-app-deps.ts:23:3)
at Object.<anonymous> (D:\UNIF-CIRC\project\ansibleclient\src\electron\node_modules\electron-builder\out\install-app-deps.js:28:1)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Function.Module.runMain (module.js:441:10)
at startup (node.js:139:18)
at node.js:974:3
</code></pre></div>
<p dir="auto">I thought that something wrong with node-gyp, keytar or with new version of node.js. I tried a lot of things, but found out that simple change from 1.4.5 to 1.4.4 solved my problem.<br>
So, guys, maybe you have some ideas what went wrong, because it prevents update of electron module.</p>
<p dir="auto">Thanks!</p> | <ul dir="auto">
<li>Electron version: 1.4.5</li>
<li>Operating system: macOS 10.12.1</li>
</ul>
<p dir="auto">Files distributed at <a href="https://atom.io/download/atom-shell/v1.4.5" rel="nofollow">https://atom.io/download/atom-shell/v1.4.5</a> and SHASUM256.txt there does not match. As a result, electron-rebuild for electron 1.4..5 fails.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$ wget --quiet https://atom.io/download/atom-shell/v1.4.5/iojs-v1.4.5.tar.gz
$ ls -l iojs-v1.4.5.tar.gz
-rw-r--r-- 1 enami wheel 28470398 Nov 2 08:33 iojs-v1.4.5.tar.gz
$ shasum -a 256 iojs-v1.4.5.tar.gz
d47724cf608ccdcc59aeabd5d508e169f92caef9ccf56b360bc97449b2bbc4aa iojs-v1.4.5.tar.gz
$ wget -O - --quiet https://atom.io/download/atom-shell/v1.4.5/SHASUMS256.txt
12a6135e6cce24c3fb4159e15387a20719a7e4fa68c894e0cfb55e47f7ccd093 node-v1.4.5.tar.gz
5be8e4ffbd9eb3a07b003530af5e1757c0a53e8ef9280b40634e3d6f4198995e iojs-v1.4.5.tar.gz
1e82db1c880d1b21042f21deae0cf82cab6c39a9a6ab1a067271ecb7cc7500f2 iojs-v1.4.5-headers.tar.gz
708eb6840231b8f0f84cb95fb91d8b35454b080a8be475deecd9f413f8f8ed07 node.lib
fdcf7f8609c64ae000044f477e7abc3a4408777e6825f33c0decdf9a5a1188dd x64/node.lib
708eb6840231b8f0f84cb95fb91d8b35454b080a8be475deecd9f413f8f8ed07 win-x86/iojs.lib
fdcf7f8609c64ae000044f477e7abc3a4408777e6825f33c0decdf9a5a1188dd win-x64/iojs.lib"><pre class="notranslate"><code class="notranslate">$ wget --quiet https://atom.io/download/atom-shell/v1.4.5/iojs-v1.4.5.tar.gz
$ ls -l iojs-v1.4.5.tar.gz
-rw-r--r-- 1 enami wheel 28470398 Nov 2 08:33 iojs-v1.4.5.tar.gz
$ shasum -a 256 iojs-v1.4.5.tar.gz
d47724cf608ccdcc59aeabd5d508e169f92caef9ccf56b360bc97449b2bbc4aa iojs-v1.4.5.tar.gz
$ wget -O - --quiet https://atom.io/download/atom-shell/v1.4.5/SHASUMS256.txt
12a6135e6cce24c3fb4159e15387a20719a7e4fa68c894e0cfb55e47f7ccd093 node-v1.4.5.tar.gz
5be8e4ffbd9eb3a07b003530af5e1757c0a53e8ef9280b40634e3d6f4198995e iojs-v1.4.5.tar.gz
1e82db1c880d1b21042f21deae0cf82cab6c39a9a6ab1a067271ecb7cc7500f2 iojs-v1.4.5-headers.tar.gz
708eb6840231b8f0f84cb95fb91d8b35454b080a8be475deecd9f413f8f8ed07 node.lib
fdcf7f8609c64ae000044f477e7abc3a4408777e6825f33c0decdf9a5a1188dd x64/node.lib
708eb6840231b8f0f84cb95fb91d8b35454b080a8be475deecd9f413f8f8ed07 win-x86/iojs.lib
fdcf7f8609c64ae000044f477e7abc3a4408777e6825f33c0decdf9a5a1188dd win-x64/iojs.lib
</code></pre></div>
<p dir="auto">Files under v1.4.4 matches:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$ wget --quiet https://atom.io/download/atom-shell/v1.4.4/iojs-v1.4.4.tar.gz
$ ls -l iojs-v1.4.4.tar.gz
-rw-r--r-- 1 enami wheel 461449 Oct 20 10:15 iojs-v1.4.4.tar.gz
$ shasum -a 256 iojs-v1.4.4.tar.gz
a66af755d556fa80af26216f5369eb34cba7402bc4065ef20cff8289dccd1649 iojs-v1.4.4.tar.gz
$ wget -O - --quiet https://atom.io/download/atom-shell/v1.4.4/SHASUMS256.txt
dde446656bbdcbcbce2de86e83b66eb643e73d1020d517ac3806b5c76cb98754 node-v1.4.4.tar.gz
a66af755d556fa80af26216f5369eb34cba7402bc4065ef20cff8289dccd1649 iojs-v1.4.4.tar.gz
e7a24ff7188a20bed63948c2f7383cd079a6b92599a434e0d43335d5ffaf30a9 iojs-v1.4.4-headers.tar.gz
805015b751242aead4f96e694a805835e7395f5db5aa39c48546ca9677bd3c2b node.lib
8713f2bd1f8ae3b4284d9d9a6c6771e33b4eb45b499e0cc05f9bc6e1c348f431 x64/node.lib
805015b751242aead4f96e694a805835e7395f5db5aa39c48546ca9677bd3c2b win-x86/iojs.lib
8713f2bd1f8ae3b4284d9d9a6c6771e33b4eb45b499e0cc05f9bc6e1c348f431 win-x64/iojs.lib"><pre class="notranslate"><code class="notranslate">$ wget --quiet https://atom.io/download/atom-shell/v1.4.4/iojs-v1.4.4.tar.gz
$ ls -l iojs-v1.4.4.tar.gz
-rw-r--r-- 1 enami wheel 461449 Oct 20 10:15 iojs-v1.4.4.tar.gz
$ shasum -a 256 iojs-v1.4.4.tar.gz
a66af755d556fa80af26216f5369eb34cba7402bc4065ef20cff8289dccd1649 iojs-v1.4.4.tar.gz
$ wget -O - --quiet https://atom.io/download/atom-shell/v1.4.4/SHASUMS256.txt
dde446656bbdcbcbce2de86e83b66eb643e73d1020d517ac3806b5c76cb98754 node-v1.4.4.tar.gz
a66af755d556fa80af26216f5369eb34cba7402bc4065ef20cff8289dccd1649 iojs-v1.4.4.tar.gz
e7a24ff7188a20bed63948c2f7383cd079a6b92599a434e0d43335d5ffaf30a9 iojs-v1.4.4-headers.tar.gz
805015b751242aead4f96e694a805835e7395f5db5aa39c48546ca9677bd3c2b node.lib
8713f2bd1f8ae3b4284d9d9a6c6771e33b4eb45b499e0cc05f9bc6e1c348f431 x64/node.lib
805015b751242aead4f96e694a805835e7395f5db5aa39c48546ca9677bd3c2b win-x86/iojs.lib
8713f2bd1f8ae3b4284d9d9a6c6771e33b4eb45b499e0cc05f9bc6e1c348f431 win-x64/iojs.lib
</code></pre></div> | 1 |
<p dir="auto">when adding the class "col-lg-offset-1" (as it says in the docs), the div did not offset, but it worked when I changed it to "col-offset-1"</p> | <p dir="auto">So as per the documentation, I tried using two different offsets for desktop and phone. But I could not find the col-lg-offset on the CDN hosted css file.</p>
<p dir="auto"><a href="http://netdna.bootstrapcdn.com/bootstrap/3.0.0-rc1/css/bootstrap.min.css" rel="nofollow">http://netdna.bootstrapcdn.com/bootstrap/3.0.0-rc1/css/bootstrap.min.css</a></p>
<p dir="auto">Am not sure if this is an issue or am I going wrong somewhere?</p> | 1 |
<p dir="auto">Using TensorBoard histogram_freq feature cause a lot of warnings like:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Instructions for updating:
Please switch to tf.summary.histogram. Note that tf.summary.histogram uses the node name instead of the tag. This means that TensorFlow will automatically de-duplicate summary names based on their scope.
WARNING:tensorflow:From /usr/local/lib/python3.5/dist-packages/Keras-1.1.2-py3.5.egg/keras/callbacks.py:525 in _set_model.: histogram_summary (from tensorflow.python.ops.logging_ops) is deprecated and will be removed after 2016-11-30."><pre class="notranslate"><code class="notranslate">Instructions for updating:
Please switch to tf.summary.histogram. Note that tf.summary.histogram uses the node name instead of the tag. This means that TensorFlow will automatically de-duplicate summary names based on their scope.
WARNING:tensorflow:From /usr/local/lib/python3.5/dist-packages/Keras-1.1.2-py3.5.egg/keras/callbacks.py:525 in _set_model.: histogram_summary (from tensorflow.python.ops.logging_ops) is deprecated and will be removed after 2016-11-30.
</code></pre></div>
<p dir="auto">Also, turning it off cause another warning:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="WARNING:tensorflow:From /usr/local/lib/python3.5/dist-packages/keras/callbacks.py:536 in _set_model.: SummaryWriter.__init__ (from tensorflow.python.training.summary_io) is deprecated and will be removed after 2016-11-30.
Instructions for updating:
Please switch to tf.summary.FileWriter. The interface and behavior is the same; this is just a rename.```"><pre lang="Please" class="notranslate"><code class="notranslate">WARNING:tensorflow:From /usr/local/lib/python3.5/dist-packages/keras/callbacks.py:536 in _set_model.: SummaryWriter.__init__ (from tensorflow.python.training.summary_io) is deprecated and will be removed after 2016-11-30.
Instructions for updating:
Please switch to tf.summary.FileWriter. The interface and behavior is the same; this is just a rename.```
</code></pre></div> | <p dir="auto">Please go to TF Forum for help and support:</p>
<p dir="auto"><a href="https://discuss.tensorflow.org/tag/keras" rel="nofollow">https://discuss.tensorflow.org/tag/keras</a></p>
<p dir="auto">If you open a GitHub issue, here is our policy:</p>
<p dir="auto">It must be a bug, a feature request, or a significant problem with the documentation (for small docs fixes please send a PR instead).<br>
The form below must be filled out.</p>
<p dir="auto"><strong>Here's why we have that policy:</strong>.</p>
<p dir="auto">Keras developers respond to issues. We want to focus on work that benefits the whole community, e.g., fixing bugs and adding features. Support only helps individuals. GitHub also notifies thousands of people when issues are filed. We want them to see you communicating an interesting problem, rather than being redirected to Stack Overflow.</p>
<p dir="auto"><strong>URL(s) with the issue:</strong>.<br>
<a href="https://keras.io/examples/timeseries/" rel="nofollow">https://keras.io/examples/timeseries/</a><br>
Please provide a link to the documentation entry, for example: <a href="https://keras.io/guides/customizing_what_happens_in_fit/" rel="nofollow">https://keras.io/guides/customizing_what_happens_in_fit/</a></p>
<p dir="auto"><strong>Description of the issue (what needs to be changed):</strong>.<br>
Duplicate entry of Classification example on Keras Timeseries example homepage<br>
See the attached image</p>
<p dir="auto"><strong>Correct links</strong>.<br>
Is the link to the source code correct?</p>
<p dir="auto"><strong>Parameters defined</strong>.</p>
<p dir="auto">Are all parameters defined and formatted correctly?</p>
<p dir="auto"><strong>Returns defined</strong>.</p>
<p dir="auto">Are return values defined?</p>
<p dir="auto"><strong>Raises listed and defined</strong></p>
<p dir="auto">Are the errors defined?</p>
<p dir="auto"><strong>Usage example</strong></p>
<p dir="auto">Is there a usage example?<br>
See the API guide: <a href="https://www.tensorflow.org/community/contribute/docs_ref" rel="nofollow">https://www.tensorflow.org/community/contribute/docs_ref</a> on how to write testable usage examples.</p>
<p dir="auto"><strong>Request visuals, if applicable</strong>.</p>
<p dir="auto">Are there currently visuals? If not, will it clarify the content?</p>
<p dir="auto"><strong>Submit a pull request?</strong>.</p>
<p dir="auto">Are you planning to also submit a pull request to fix the issue? See the <a href="https://github.com/keras-team/keras/blob/master/CONTRIBUTING.md">docs contributor guide</a>:</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/91022311/151016379-ac255551-71aa-4288-8448-5c490fc10802.PNG"><img src="https://user-images.githubusercontent.com/91022311/151016379-ac255551-71aa-4288-8448-5c490fc10802.PNG" alt="Capture" style="max-width: 100%;"></a></p> | 0 |
<p dir="auto">Failed: <a href="https://k8s-gubernator.appspot.com/build/kubernetes-jenkins/logs/kubernetes-e2e-gci-gke/2189/" rel="nofollow">https://k8s-gubernator.appspot.com/build/kubernetes-jenkins/logs/kubernetes-e2e-gci-gke/2189/</a></p>
<p dir="auto">Run so broken it didn't make JUnit output!</p> | <p dir="auto">Failed: <a href="https://k8s-gubernator.appspot.com/build/kubernetes-jenkins/logs/kubernetes-e2e-gci-gke/1883/" rel="nofollow">https://k8s-gubernator.appspot.com/build/kubernetes-jenkins/logs/kubernetes-e2e-gci-gke/1883/</a></p>
<p dir="auto">Run so broken it didn't make JUnit output!</p> | 1 |
<p dir="auto">Make sure these boxes are checked before submitting your issue - thank you!</p>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have checked the superset logs for python stacktraces and included it here as text if any</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have reproduced the issue with at least the latest released version of superset</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have checked the issue tracker for the same issue and I haven't found one similar</li>
</ul>
<h3 dir="auto">Superset version</h3>
<p dir="auto">0.18.4</p>
<h3 dir="auto">Expected results</h3>
<p dir="auto">Labels are seen fully wherever they are located on heatmap.</p>
<h3 dir="auto">Actual results</h3>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/3881689/29667163-0eb83d0a-88e4-11e7-9be3-d38ca8cc9ea7.png"><img src="https://user-images.githubusercontent.com/3881689/29667163-0eb83d0a-88e4-11e7-9be3-d38ca8cc9ea7.png" alt="heatmap_problem" style="max-width: 100%;"></a></p>
<h3 dir="auto">Steps to reproduce</h3>
<p dir="auto">Run superset<br>
Create calendar heatmap chart, check labels behaviour.</p> | <p dir="auto">Make sure these boxes are checked before submitting your issue - thank you!</p>
<h3 dir="auto">Superset version</h3>
<h3 dir="auto">Expected results</h3>
<p dir="auto">I see the callout is visible</p>
<h3 dir="auto">Actual results</h3>
<p dir="auto">It is overlayed when placed on dashboard ( see attachment screen )</p>
<h3 dir="auto">Steps to reproduce</h3>
<ol dir="auto">
<li>Create calendar heat map and place on dashboard.</li>
<li>click on cell<br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/30741870/29485497-91e77040-84db-11e7-994a-cfba58a825ec.png"><img src="https://user-images.githubusercontent.com/30741870/29485497-91e77040-84db-11e7-994a-cfba58a825ec.png" alt="cal" style="max-width: 100%;"></a></li>
</ol> | 1 |
<h3 dir="auto">System info</h3>
<ul dir="auto">
<li>Playwright Version: 1.32</li>
<li>Operating System: macOS 13.2</li>
<li>Browser: All</li>
</ul>
<h3 dir="auto">Source code</h3>
<p dir="auto"><strong>Config file</strong></p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="// playwright.config.ts
import { defineConfig, devices } from '@playwright/test';
export default defineConfig({
projects: [
{
name: 'chromium',
use: { ...devices['Desktop Chrome'], },
},
});"><pre class="notranslate"><span class="pl-c">// playwright.config.ts</span>
<span class="pl-k">import</span> <span class="pl-kos">{</span> <span class="pl-s1">defineConfig</span><span class="pl-kos">,</span> <span class="pl-s1">devices</span> <span class="pl-kos">}</span> <span class="pl-k">from</span> <span class="pl-s">'@playwright/test'</span><span class="pl-kos">;</span>
<span class="pl-k">export</span> <span class="pl-k">default</span> <span class="pl-en">defineConfig</span><span class="pl-kos">(</span><span class="pl-kos">{</span>
<span class="pl-c1">projects</span>: <span class="pl-kos">[</span>
<span class="pl-kos">{</span>
<span class="pl-c1">name</span>: <span class="pl-s">'chromium'</span><span class="pl-kos">,</span>
<span class="pl-c1">use</span>: <span class="pl-kos">{</span> ...<span class="pl-s1">devices</span><span class="pl-kos">[</span><span class="pl-s">'Desktop Chrome'</span><span class="pl-kos">]</span><span class="pl-kos">,</span> <span class="pl-kos">}</span><span class="pl-kos">,</span>
<span class="pl-kos">}</span><span class="pl-kos">,</span><span class="pl-kos"></span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<p dir="auto"><strong>Test file (self-contained)</strong></p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="// cmp.test.ts
import test from '@playwright/test'
enum URLs {
FR = 'https://www.vinted.fr',
LT = 'https://www.vinted.lt',
DE = 'https://www.vinted.de',
}
test.describe('cookies', () => {
for (const [country, baseURL] of Object.entries(URLs)) {
test.describe(() => {
test.use({ baseURL })
test(`test accepting cookies in ${country}`, async ({ page }) => {
// test
})
})
}
})"><pre class="notranslate"><span class="pl-c">// cmp.test.ts</span>
<span class="pl-k">import</span> <span class="pl-s1">test</span> <span class="pl-k">from</span> <span class="pl-s">'@playwright/test'</span>
<span class="pl-s1">enum</span> <span class="pl-v">URLs</span> <span class="pl-kos">{</span>
<span class="pl-c1">FR</span> <span class="pl-c1">=</span> <span class="pl-s">'https://www.vinted.fr'</span><span class="pl-kos">,</span>
<span class="pl-c1">LT</span> <span class="pl-c1">=</span> <span class="pl-s">'https://www.vinted.lt'</span><span class="pl-kos">,</span>
<span class="pl-c1">DE</span> <span class="pl-c1">=</span> <span class="pl-s">'https://www.vinted.de'</span><span class="pl-kos">,</span>
<span class="pl-kos">}</span>
<span class="pl-s1">test</span><span class="pl-kos">.</span><span class="pl-en">describe</span><span class="pl-kos">(</span><span class="pl-s">'cookies'</span><span class="pl-kos">,</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">=></span> <span class="pl-kos">{</span>
<span class="pl-k">for</span> <span class="pl-kos">(</span><span class="pl-k">const</span> <span class="pl-kos">[</span><span class="pl-s1">country</span><span class="pl-kos">,</span> <span class="pl-s1">baseURL</span><span class="pl-kos">]</span> <span class="pl-k">of</span> <span class="pl-v">Object</span><span class="pl-kos">.</span><span class="pl-en">entries</span><span class="pl-kos">(</span><span class="pl-v">URLs</span><span class="pl-kos">)</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-s1">test</span><span class="pl-kos">.</span><span class="pl-en">describe</span><span class="pl-kos">(</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">=></span> <span class="pl-kos">{</span>
<span class="pl-s1">test</span><span class="pl-kos">.</span><span class="pl-en">use</span><span class="pl-kos">(</span><span class="pl-kos">{</span> baseURL <span class="pl-kos">}</span><span class="pl-kos">)</span>
<span class="pl-en">test</span><span class="pl-kos">(</span><span class="pl-s">`test accepting cookies in <span class="pl-s1"><span class="pl-kos">${</span><span class="pl-s1">country</span><span class="pl-kos">}</span></span>`</span><span class="pl-kos">,</span> <span class="pl-k">async</span> <span class="pl-kos">(</span><span class="pl-kos">{</span> page <span class="pl-kos">}</span><span class="pl-kos">)</span> <span class="pl-c1">=></span> <span class="pl-kos">{</span>
<span class="pl-c">// test</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span>
<span class="pl-kos">}</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span></pre></div>
<p dir="auto"><strong>Expected</strong></p>
<ul dir="auto">
<li>Test names in UI mode to be displayed the same like in VS Code plugin - with variable names.</li>
<li>All parameterized tests to be displayed</li>
</ul>
<p dir="auto">VS Code plugin <g-emoji class="g-emoji" alias="green_circle" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/1f7e2.png">🟢</g-emoji><br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/17873445/227503940-f2308580-62e8-4734-b666-6c125ba17026.png"><img src="https://user-images.githubusercontent.com/17873445/227503940-f2308580-62e8-4734-b666-6c125ba17026.png" alt="SCR-20230324-i0j" style="max-width: 100%;"></a></p>
<p dir="auto"><strong>Actual</strong><br>
Currently it shows one correct name plus nested titles with project name but those do not run the tests.</p>
<p dir="auto">UI Mode 🔴<br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/17873445/227504963-569fc5a5-1141-4bf5-ab30-67caf4395c7b.png"><img width="419" alt="SCR-20230324-i5o" src="https://user-images.githubusercontent.com/17873445/227504963-569fc5a5-1141-4bf5-ab30-67caf4395c7b.png" style="max-width: 100%;"></a></p> | <h3 dir="auto">System info</h3>
<ul dir="auto">
<li>Playwright Version: [v1.35.0]</li>
<li>Operating System: [All]</li>
<li>Browser: [Chromium]</li>
<li>Other info:</li>
</ul>
<h3 dir="auto">Source code</h3>
<p dir="auto">In our application we have toggle button that looks like this:<br>
<a target="_blank" rel="noopener noreferrer" href="https://user-images.githubusercontent.com/13851264/250511642-6bf5fa79-b9b3-4e42-b498-20b7aa0d21a9.png"><img src="https://user-images.githubusercontent.com/13851264/250511642-6bf5fa79-b9b3-4e42-b498-20b7aa0d21a9.png" alt="image" style="max-width: 100%;"></a></p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="<div class="custom-togglebtn>
<label class="custom-togglebtn__label">
<input class="custom-togglebtn__input>
<span class="custom-togglebtn__icon"></span>
</label>
</div>"><pre class="notranslate"><code class="notranslate"><div class="custom-togglebtn>
<label class="custom-togglebtn__label">
<input class="custom-togglebtn__input>
<span class="custom-togglebtn__icon"></span>
</label>
</div>
</code></pre></div>
<p dir="auto">I see in docs that Locator.setChecked() should be used only for 'checkbox or a radio element' but in common toggle element is a checkbox.<br>
When I use <code class="notranslate">Locator.setChecked()</code> method to 'check' or 'uncheck' the toggle (page.locator('div.custom-togglebtn')) -> <strong>it works in reverse</strong>.<br>
What I mean:</p>
<ul dir="auto">
<li>setChecked(true) disables the toggle</li>
<li>setChecked(false) enables the toggle</li>
</ul>
<p dir="auto"><strong>Steps</strong><br>
Try to enable a toggle element using Locator.setChecked(true)</p>
<p dir="auto"><strong>Expected</strong></p>
<p dir="auto">Toggle is enabled</p>
<p dir="auto"><strong>Actual</strong></p>
<p dir="auto">Toggle is disabled</p> | 0 |
<p dir="auto">I'm using PR4 and when generating a Doctrine crud with routes the UrlMatcher contains duplicate GOTO commands.<br>
I tried adding a prefix to the imported routes but that did not work.</p>
<p dir="auto">If I remove the method requirements in the CRUD routes there is no longer a duplicate GOTO in the UrlMatcher.</p>
<p dir="auto">I'm including my bundle routes (which includes the generated CRUD routes) in the main routing.yml file. If I include the CRUD routes directly into the main routing.yml everything works.</p> | <div class="highlight highlight-text-html-php notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="$io = new SymfonyStyle($input, $output);
$io->ask('question with default value Backslash\\', '\\');"><pre class="notranslate"><span class="pl-s1"><span class="pl-c1">$</span>io</span> = <span class="pl-k">new</span> <span class="pl-v">SymfonyStyle</span>(<span class="pl-s1"><span class="pl-c1">$</span>input</span>, <span class="pl-s1"><span class="pl-c1">$</span>output</span>);
<span class="pl-s1"><span class="pl-c1">$</span>io</span>-><span class="pl-en">ask</span>(<span class="pl-s">'question with default value Backslash\\'</span>, <span class="pl-s">'\\'</span>);</pre></div>
<p dir="auto">This code snippet will print the following in command line:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" question with default value Backslash</info> [</comment>]:
> "><pre class="notranslate"><code class="notranslate"> question with default value Backslash</info> [</comment>]:
>
</code></pre></div>
<ul dir="auto">
<li>symfony/console v3.1.3</li>
<li>php v7.0.9</li>
<li>Mac OSX v10.11.6</li>
</ul> | 0 |
<p dir="auto">Hi,</p>
<p dir="auto">I just <strong>upgraded from 1.8.4 to 1.9.0.1</strong> and while my roles and inventory SSH configuration are unchanged:</p>
<p dir="auto"><strong>Inventory SSH Configuration:</strong></p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="[group1:vars]
ansible_ssh_user=deployment
ansible_ssh_private_key_file=./files/dev/deployment_rsa
ansible_sudo_pass=password123"><pre class="notranslate"><code class="notranslate">[group1:vars]
ansible_ssh_user=deployment
ansible_ssh_private_key_file=./files/dev/deployment_rsa
ansible_sudo_pass=password123
</code></pre></div>
<p dir="auto"><strong>my_role/vars/main.yml:</strong></p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="
---
sudo: yes"><pre class="notranslate"><code class="notranslate">
---
sudo: yes
</code></pre></div>
<p dir="auto"><strong>This previously working task my_role/tasks/main.yml:</strong></p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="
---
- name: install jdk
yum: pkg=jdk-{{ jdk_package_version }} state=present"><pre class="notranslate"><code class="notranslate">
---
- name: install jdk
yum: pkg=jdk-{{ jdk_package_version }} state=present
</code></pre></div>
<p dir="auto"><strong>is now failing with:</strong></p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="failed: [host1] => {"failed": true}
msg: Error from repoquery: ['/usr/bin/repoquery', '--show-duplicates', '--plugins', '--quiet', '-q', '--disablerepo=*', '--pkgnarrow=installed', '--qf', '%{name}-%{version}-%{release}.%{arch}', 'jdk-1.2.27.1.0-3707']: Could not set cachedir: [Errno 13] Permission denied: '/var/tmp/yum-deployment-aVYwNt'
Error: Could not make cachedir, exiting"><pre class="notranslate"><code class="notranslate">failed: [host1] => {"failed": true}
msg: Error from repoquery: ['/usr/bin/repoquery', '--show-duplicates', '--plugins', '--quiet', '-q', '--disablerepo=*', '--pkgnarrow=installed', '--qf', '%{name}-%{version}-%{release}.%{arch}', 'jdk-1.2.27.1.0-3707']: Could not set cachedir: [Errno 13] Permission denied: '/var/tmp/yum-deployment-aVYwNt'
Error: Could not make cachedir, exiting
</code></pre></div>
<p dir="auto">whereas before the ansible upgrade it was working fine. I am <strong>not</strong> passing any sudo / user related configuration in CLI.</p>
<p dir="auto">If I add sudo: yes to every task in the tasks/main.yml it works, but clearly this is not something I want to do.</p>
<p dir="auto">Has something changed in the sudo / user precedence in the new ansible version that I should know about? This seems like a bug to me but I could be wrong..</p>
<p dir="auto">Thanks in advance,<br>
Yannis</p> | <h5 dir="auto">ISSUE TYPE</h5>
<ul dir="auto">
<li>Feature Idea</li>
</ul>
<h5 dir="auto">COMPONENT NAME</h5>
<p dir="auto">network namespace</p>
<h5 dir="auto">ANSIBLE VERSION</h5>
<p dir="auto">none</p>
<h5 dir="auto">CONFIGURATION</h5>
<p dir="auto">n/a</p>
<h5 dir="auto">OS / ENVIRONMENT</h5>
<p dir="auto">Linux</p>
<h5 dir="auto">SUMMARY</h5>
<p dir="auto">Ansible currently has no support for Linux network namespaces. It would be highly useful to get at least basic support for them via facts. Right now, if an interface is a non-default network namespace, ansible won't detect it at all, and it wont show up in fact variables such as <code class="notranslate">ansible_interfaces</code> or <code class="notranslate">ansible_{{ifname}}</code>.</p>
<h5 dir="auto">STEPS TO REPRODUCE</h5>
<p dir="auto">Have an interface in a non-default network namespace.</p>
<h5 dir="auto">EXPECTED RESULTS</h5>
<p dir="auto">Interface details to show up in facts such as <code class="notranslate">ansible_interfaces</code> and <code class="notranslate">ansible_{{ifname}}</code>.</p>
<h5 dir="auto">ACTUAL RESULTS</h5>
<p dir="auto">Interface details missing.</p>
<h5 dir="auto">Details</h5>
<p dir="auto">Writing a custom fact for this would be very cumbersome as ansible gathers a lot of information about the interfaces and state of networking that would have to be duplicated.</p>
<p dir="auto">I think it might be simple to support this by getting a list of network namespaces, and then running the <code class="notranslate">setup</code> module again inside each network namespace (via <code class="notranslate">ip netns exec</code>). Could also enhance that by only gathering the network related facts. The resulting variables would then be available inside a <code class="notranslate">netns_{{nsname}}</code> tree. For example:</p>
<div class="highlight highlight-source-json notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="{
"ansible_network_namespaces": ["foo","bar"],
"ansible_netns_foo": {
"ansible_all_ipv4_addresses": [ "1.2.3.4" ],
"ansible_interfaces: [ "iffoo" ],
"ansible_iffoo": { "ipv4": { "address": "1.2.3.4", "netmask": ... } },
...
},
"ansible_netns_bar": {
"ansible_all_ipv4_addresses": [ "5.6.7.8" ],
"ansible_interfaces: [ "ifbar" ],
"ansible_ifbar": { "ipv4": { "address": "5.6.7.8", "netmask": ... } },
...
},"><pre class="notranslate">{
<span class="pl-ent">"ansible_network_namespaces"</span>: [<span class="pl-s"><span class="pl-pds">"</span>foo<span class="pl-pds">"</span></span>,<span class="pl-s"><span class="pl-pds">"</span>bar<span class="pl-pds">"</span></span>],
<span class="pl-ent">"ansible_netns_foo"</span>: {
<span class="pl-ent">"ansible_all_ipv4_addresses"</span>: [ <span class="pl-s"><span class="pl-pds">"</span>1.2.3.4<span class="pl-pds">"</span></span> ],
<span class="pl-s"><span class="pl-pds">"</span>ansible_interfaces: [ <span class="pl-pds">"</span></span><span class="pl-ii">iffoo" ],</span>
<span class="pl-ent">"ansible_iffoo"</span>: { <span class="pl-ent">"ipv4"</span>: { <span class="pl-ent">"address"</span>: <span class="pl-s"><span class="pl-pds">"</span>1.2.3.4<span class="pl-pds">"</span></span>, <span class="pl-ent">"netmask"</span>: <span class="pl-ii">... </span>} },
<span class="pl-ii">...</span>
},
<span class="pl-ent">"ansible_netns_bar"</span>: {
<span class="pl-ent">"ansible_all_ipv4_addresses"</span>: [ <span class="pl-s"><span class="pl-pds">"</span>5.6.7.8<span class="pl-pds">"</span></span> ],
<span class="pl-s"><span class="pl-pds">"</span>ansible_interfaces: [ <span class="pl-pds">"</span></span><span class="pl-ii">ifbar" ],</span>
<span class="pl-ent">"ansible_ifbar"</span>: { <span class="pl-ent">"ipv4"</span>: { <span class="pl-ent">"address"</span>: <span class="pl-s"><span class="pl-pds">"</span>5.6.7.8<span class="pl-pds">"</span></span>, <span class="pl-ent">"netmask"</span>: <span class="pl-ii">... </span>} },
<span class="pl-ii">...</span>
},</pre></div> | 0 |
<p dir="auto">Context:</p>
<p dir="auto"><strong>System:</strong><br>
2020 Macbook 13"<br>
OS: macOS Monterey 12.0.1<br>
Memory: 12.2 GB / 16 GB LPDDR4X<br>
CPU: 2 GHz Intel Core i5 Quad-core</p>
<p dir="auto"><strong>Binaries:</strong><br>
Node: 14.17.5<br>
npm: 6.14.14</p>
<p dir="auto"><strong>npmPackages:</strong><br>
playwright: ^1.20.0 => 1.20.0</p>
<p dir="auto"><strong>Describe the bug</strong></p>
<p dir="auto">Running "npx playwright codegen google.com" and doing no further actions will stay up for around 1 minute each time and then crash the debugger and the test browser window, I've done about 5 consecutive tests with a timer to check this. I've asked colleagues (they have a basically same specced mac) to do the same with the same results. I've noticed this issue while doing some initial setup on our locally ran application, but to debug the issue further I tested this on google.com and the behavior is the same.</p>
<p dir="auto">Also noticed after checking other issue previously reported that using debug mode on the tests also crashes after 1 minute.</p>
<p dir="auto">All of this on chromium.</p> | <p dir="auto"><strong>Context:</strong></p>
<ul dir="auto">
<li>Playwright Version: 1.20.0</li>
<li>Operating System: Macos 11.6.5</li>
<li>Python version: Python 3.10.2</li>
<li>Browser: Chromium</li>
</ul>
<p dir="auto"><strong>Code Snippet</strong></p>
<p dir="auto">The easiest way to replicate this issue is to just add a breakpoint in the following snippet after launching the browser, e.g. line 5, and then initialize the debugger and wait for it to reach the breakpoint. Then just wait and Chromium will suddenly close all on its own within a minute or two.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="with sync_playwright() as p:
browser = p.chromium.launch(headless=False)
page = browser.new_page()
page.goto("http://playwright.dev/")
print(page.title())
browser.close()"><pre class="notranslate"><code class="notranslate">with sync_playwright() as p:
browser = p.chromium.launch(headless=False)
page = browser.new_page()
page.goto("http://playwright.dev/")
print(page.title())
browser.close()
</code></pre></div>
<p dir="auto"><strong>Describe the bug</strong></p>
<p dir="auto">This issue began to occur after upgrading playwright to version 1.20.0 on my local machine. We have ~30 playwright tests that get parameterized to run in both Firefox and Chromium and I validated that everything was working by running the full test suite inside an Ubuntu Focal Docker container. So far, so good. The issue started to occur when I was helping a colleague debug an issue in headed mode and my chromium browser kept quitting in the middle of the debug session. The Playwright process continued running.</p>
<p dir="auto">Then I tried running our full test suite locally in MacOS and after about 15-17 tests, all of the remaining chromium tests would instantly fail with an error indicating the page was already closed. This is extremely consistent and persisted through reboots and rebuilding my venv (I had been testing a pytest-parallel plugin and wanted to make sure it wasn't interfering) and only stops occurring when I downgrade playwright to 1.18.2 which is the last stable version we were using. I've included the traceback from the first chromium test that fails during each session. Seems to be some kind of memory error.</p>
<p dir="auto"><strong>TLDR</strong></p>
<ul dir="auto">
<li>Playwright 1.20.0 Chromium appears to crash after running for a minute or two on MacOS</li>
<li>Firefox does not exhibit this issue (I haven't tested webkit)</li>
<li>This issue does not occur in Linux (haven't tested windows)</li>
<li>This is a regression since 1.18.2 which was the last version I tested (we skipped over 1.19.x)</li>
</ul>
<p dir="auto"><strong>Traceback</strong></p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="self = <playwright._impl._connection.Channel object at 0x1089be530>
method = 'click', params = {'selector': 'a[href="/app/edit-recruiter-profile"]'}
return_as_dict = False
async def inner_send(
self, method: str, params: Optional[Dict], return_as_dict: bool
) -> Any:
if params is None:
params = {}
callback = self._connection._send_message_to_server(self._guid, method, params)
if self._connection._error:
error = self._connection._error
self._connection._error = None
raise error
done, _ = await asyncio.wait(
{
self._connection._transport.on_error_future,
callback.future,
},
return_when=asyncio.FIRST_COMPLETED,
)
if not callback.future.done():
callback.future.cancel()
> result = next(iter(done)).result()
E playwright._impl._api_types.Error: Browser closed.
E ==================== Browser output: ====================
E <launching> /Users/silasj/Library/Caches/ms-playwright/chromium-978106/chrome-mac/Chromium.app/Contents/MacOS/Chromium --disable-background-networking --enable-features=NetworkService,NetworkServiceInProcess --disable-background-timer-throttling --disable-backgrounding-occluded-windows --disable-breakpad --disable-client-side-phishing-detection --disable-component-extensions-with-background-pages --disable-default-apps --disable-dev-shm-usage --disable-extensions --disable-features=ImprovedCookieControls,LazyFrameLoading,GlobalMediaControls,DestroyProfileOnBrowserClose,MediaRouter,AcceptCHFrame,AutoExpandDetailsElement --allow-pre-commit-input --disable-hang-monitor --disable-ipc-flooding-protection --disable-popup-blocking --disable-prompt-on-repost --disable-renderer-backgrounding --disable-sync --force-color-profile=srgb --metrics-recording-only --no-first-run --enable-automation --password-store=basic --use-mock-keychain --no-service-autorun --export-tagged-pdf --enable-use-zoom-for-dsf=false --no-sandbox --user-data-dir=/var/folders/kv/d09mrzfj49l9yp6hqzg58v840000gn/T/playwright_chromiumdev_profile-ibOEpD --remote-debugging-pipe --no-startup-window
E <launched> pid=2236
E [pid=2236][err] Received signal 6
E [pid=2236][err] [0x000118efda79]
E [pid=2236][err] [0x000118e59d13]
E [pid=2236][err] [0x000118efd9d1]
E [pid=2236][err] [0x7fff208d1d7d]
E [pid=2236][err] [0x7ffee14fb5d8]
E [pid=2236][err] [0x7fff207e1406]
E [pid=2236][err] [0x7fff206c1165]
E [pid=2236][err] [0x7fff206c42aa]
E [pid=2236][err] [0x000118a4b0fc]
E [pid=2236][err] [0x00011628f6af]
E [pid=2236][err] [0x000115395f67]
E [pid=2236][err] [0x0001166f4d1e]
E [pid=2236][err] [0x000118ee42e9]
E [pid=2236][err] [0x000118eb8a60]
E [pid=2236][err] [0x000118ecd979]
E [pid=2236][err] [0x000118ecd69c]
E [pid=2236][err] [0x000118ecde72]
E [pid=2236][err] [0x000118f0f323]
E [pid=2236][err] [0x000118f09cf2]
E [pid=2236][err] [0x000118f0ed5f]
E [pid=2236][err] [0x7fff2098437c]
E [pid=2236][err] [0x7fff209842e4]
E [pid=2236][err] [0x7fff20984064]
E [pid=2236][err] [0x7fff20982a8c]
E [pid=2236][err] [0x7fff2098204c]
E [pid=2236][err] [0x7fff28bcaa83]
E [pid=2236][err] [0x7fff28bca7e5]
E [pid=2236][err] [0x7fff28bca583]
E [pid=2236][err] [0x7fff2318ad72]
E [pid=2236][err] [0x7fff23189545]
E [pid=2236][err] [0x000118a12ab0]
E [pid=2236][err] [0x000118f09cf2]
E [pid=2236][err] [0x000118a129e9]
E [pid=2236][err] [0x7fff2317b869]
E [pid=2236][err] [0x000118f0fa2c]
E [pid=2236][err] [0x000118f0e892]
E [pid=2236][err] [0x000118ece0dd]
E [pid=2236][err] [0x000118e9843d]
E [pid=2236][err] [0x00011661ff7b]
E [pid=2236][err] [0x000116621612]
E [pid=2236][err] [0x00011661d8dc]
E [pid=2236][err] [0x00011899d4e8]
E [pid=2236][err] [0x00011899e53a]
E [pid=2236][err] [0x00011899e0cb]
E [pid=2236][err] [0x00011899c84c]
E [pid=2236][err] [0x00011899d0d0]
E [pid=2236][err] [0x0001152271be]
E [pid=2236][err] [0x00010e7018d1]
E [pid=2236][err] [0x7fff208a7f3d]
E [pid=2236][err] [0x000000000020]
E [pid=2236][err] [end of stack trace]
E [pid=2236][err] [0322/180717.089119:WARNING:process_memory_mac.cc(93)] mach_vm_read(0x7ffee14fe000, 0x2000): (os/kern) invalid address (1)
E [pid=2236][err] [0322/180717.250919:WARNING:crash_report_exception_handler.cc(235)] UniversalExceptionRaise: (os/kern) failure (5)
E =========================== logs ===========================
E waiting for selector "a[href="/app/edit"]"
E selector resolved to visible <a data-v-d7081870="" data-v-1b7f802e="" href="/app…>Complete task</a>
E attempting click action
E waiting for element to be visible, enabled and stable
E element is not stable - waiting...
E ============================================================
../venv/lib/python3.10/site-packages/playwright/_impl/_connection.py:63: Error"><pre class="notranslate"><code class="notranslate">self = <playwright._impl._connection.Channel object at 0x1089be530>
method = 'click', params = {'selector': 'a[href="/app/edit-recruiter-profile"]'}
return_as_dict = False
async def inner_send(
self, method: str, params: Optional[Dict], return_as_dict: bool
) -> Any:
if params is None:
params = {}
callback = self._connection._send_message_to_server(self._guid, method, params)
if self._connection._error:
error = self._connection._error
self._connection._error = None
raise error
done, _ = await asyncio.wait(
{
self._connection._transport.on_error_future,
callback.future,
},
return_when=asyncio.FIRST_COMPLETED,
)
if not callback.future.done():
callback.future.cancel()
> result = next(iter(done)).result()
E playwright._impl._api_types.Error: Browser closed.
E ==================== Browser output: ====================
E <launching> /Users/silasj/Library/Caches/ms-playwright/chromium-978106/chrome-mac/Chromium.app/Contents/MacOS/Chromium --disable-background-networking --enable-features=NetworkService,NetworkServiceInProcess --disable-background-timer-throttling --disable-backgrounding-occluded-windows --disable-breakpad --disable-client-side-phishing-detection --disable-component-extensions-with-background-pages --disable-default-apps --disable-dev-shm-usage --disable-extensions --disable-features=ImprovedCookieControls,LazyFrameLoading,GlobalMediaControls,DestroyProfileOnBrowserClose,MediaRouter,AcceptCHFrame,AutoExpandDetailsElement --allow-pre-commit-input --disable-hang-monitor --disable-ipc-flooding-protection --disable-popup-blocking --disable-prompt-on-repost --disable-renderer-backgrounding --disable-sync --force-color-profile=srgb --metrics-recording-only --no-first-run --enable-automation --password-store=basic --use-mock-keychain --no-service-autorun --export-tagged-pdf --enable-use-zoom-for-dsf=false --no-sandbox --user-data-dir=/var/folders/kv/d09mrzfj49l9yp6hqzg58v840000gn/T/playwright_chromiumdev_profile-ibOEpD --remote-debugging-pipe --no-startup-window
E <launched> pid=2236
E [pid=2236][err] Received signal 6
E [pid=2236][err] [0x000118efda79]
E [pid=2236][err] [0x000118e59d13]
E [pid=2236][err] [0x000118efd9d1]
E [pid=2236][err] [0x7fff208d1d7d]
E [pid=2236][err] [0x7ffee14fb5d8]
E [pid=2236][err] [0x7fff207e1406]
E [pid=2236][err] [0x7fff206c1165]
E [pid=2236][err] [0x7fff206c42aa]
E [pid=2236][err] [0x000118a4b0fc]
E [pid=2236][err] [0x00011628f6af]
E [pid=2236][err] [0x000115395f67]
E [pid=2236][err] [0x0001166f4d1e]
E [pid=2236][err] [0x000118ee42e9]
E [pid=2236][err] [0x000118eb8a60]
E [pid=2236][err] [0x000118ecd979]
E [pid=2236][err] [0x000118ecd69c]
E [pid=2236][err] [0x000118ecde72]
E [pid=2236][err] [0x000118f0f323]
E [pid=2236][err] [0x000118f09cf2]
E [pid=2236][err] [0x000118f0ed5f]
E [pid=2236][err] [0x7fff2098437c]
E [pid=2236][err] [0x7fff209842e4]
E [pid=2236][err] [0x7fff20984064]
E [pid=2236][err] [0x7fff20982a8c]
E [pid=2236][err] [0x7fff2098204c]
E [pid=2236][err] [0x7fff28bcaa83]
E [pid=2236][err] [0x7fff28bca7e5]
E [pid=2236][err] [0x7fff28bca583]
E [pid=2236][err] [0x7fff2318ad72]
E [pid=2236][err] [0x7fff23189545]
E [pid=2236][err] [0x000118a12ab0]
E [pid=2236][err] [0x000118f09cf2]
E [pid=2236][err] [0x000118a129e9]
E [pid=2236][err] [0x7fff2317b869]
E [pid=2236][err] [0x000118f0fa2c]
E [pid=2236][err] [0x000118f0e892]
E [pid=2236][err] [0x000118ece0dd]
E [pid=2236][err] [0x000118e9843d]
E [pid=2236][err] [0x00011661ff7b]
E [pid=2236][err] [0x000116621612]
E [pid=2236][err] [0x00011661d8dc]
E [pid=2236][err] [0x00011899d4e8]
E [pid=2236][err] [0x00011899e53a]
E [pid=2236][err] [0x00011899e0cb]
E [pid=2236][err] [0x00011899c84c]
E [pid=2236][err] [0x00011899d0d0]
E [pid=2236][err] [0x0001152271be]
E [pid=2236][err] [0x00010e7018d1]
E [pid=2236][err] [0x7fff208a7f3d]
E [pid=2236][err] [0x000000000020]
E [pid=2236][err] [end of stack trace]
E [pid=2236][err] [0322/180717.089119:WARNING:process_memory_mac.cc(93)] mach_vm_read(0x7ffee14fe000, 0x2000): (os/kern) invalid address (1)
E [pid=2236][err] [0322/180717.250919:WARNING:crash_report_exception_handler.cc(235)] UniversalExceptionRaise: (os/kern) failure (5)
E =========================== logs ===========================
E waiting for selector "a[href="/app/edit"]"
E selector resolved to visible <a data-v-d7081870="" data-v-1b7f802e="" href="/app…>Complete task</a>
E attempting click action
E waiting for element to be visible, enabled and stable
E element is not stable - waiting...
E ============================================================
../venv/lib/python3.10/site-packages/playwright/_impl/_connection.py:63: Error
</code></pre></div> | 1 |
<h1 dir="auto">Description of the new feature/enhancement</h1>
<p dir="auto">The <a href="https://github.com/microsoft/terminal/blob/master/doc/cascadia/SettingsSchema.md#implemented-keybindings">list of implemented keybindings</a> is missing the option of moving tabs to the left/right.</p>
<p dir="auto">I did try and look for this request in other places, but the closest I could find was PR <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="519592866" data-permission-text="Title is private" data-url="https://github.com/microsoft/terminal/issues/3478" data-hovercard-type="pull_request" data-hovercard-url="/microsoft/terminal/pull/3478/hovercard" href="https://github.com/microsoft/terminal/pull/3478">#3478</a>, which implements this functionality as mouse-input by drag & drop, but as far as I could tell it is still missing as keyboard shortcuts.</p>
<p dir="auto">I saw this mentioned in <a href="https://github.com/microsoft/terminal/issues/443#issuecomment-525722525" data-hovercard-type="issue" data-hovercard-url="/microsoft/terminal/issues/443/hovercard">another thread</a>, but again I was not able to tell if this was just proposed as a request or actually solved.</p>
<h1 dir="auto">Proposed technical implementation details (optional)</h1>
<p dir="auto">This should be straightforward: Get the keywords <code class="notranslate">moveTabLeft</code> and <code class="notranslate">moveTabRight</code> in to the list of supported keybindings.</p> | <h1 dir="auto">Environment</h1>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Windows build number: Microsoft Windows [Version 10.0.18362.295]
Windows Terminal version (if applicable): Version: 0.3.2171.0
Any other software?
GNU Emacs 24.3.1
tmux1.8
CentOS 7.0"><pre lang="none" class="notranslate"><code class="notranslate">Windows build number: Microsoft Windows [Version 10.0.18362.295]
Windows Terminal version (if applicable): Version: 0.3.2171.0
Any other software?
GNU Emacs 24.3.1
tmux1.8
CentOS 7.0
</code></pre></div>
<h1 dir="auto">Steps to reproduce</h1>
<p dir="auto">When I ssh to my CentOS 7.0 server and start a new tmux session (<code class="notranslate">tmux new-session -s someSession</code>), and open a new or existing file in emacs, every time I move my cursor on a white space or special character, I get a unwanted square character printed on the screen. Some characters are already there (e.g. on empty lines) when I first open the file. The changes are only visual and don't modify the actual text file (i.e. saving and re-opening the file clears the new characters) but those that are there when the file opens appear consistently, generally in empty lines.</p>
<p dir="auto">If I try with emacs outside of tmux it works fine, so it seems to be specific to tmux or one of its setting.</p>
<p dir="auto">I did try to set my <code class="notranslate">$TERM</code> to xterm-256color, rxvt, etc. in the tmux configs but it didn't seem to change anything.</p>
<h1 dir="auto">Expected behavior</h1>
<p dir="auto">The text file should display as is without any additional characters, e.g.</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/14117454/63214587-01a71080-c0cf-11e9-9ef6-618b3add0e62.png"><img src="https://user-images.githubusercontent.com/14117454/63214587-01a71080-c0cf-11e9-9ef6-618b3add0e62.png" alt="image" style="max-width: 100%;"></a></p>
<h1 dir="auto">Actual behavior</h1>
<p dir="auto">See screen shot and additional square characters:<br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/14117454/63214584-ec31e680-c0ce-11e9-809f-a021e9b1aa38.png"><img src="https://user-images.githubusercontent.com/14117454/63214584-ec31e680-c0ce-11e9-809f-a021e9b1aa38.png" alt="image" style="max-width: 100%;"></a></p> | 0 |
<p dir="auto">We recently started to use the cluster sniffing feature in the Java API for node discovery which works great. But in our cluster setup we have 3 nodes (out of 9) which have different hardware (disk, less iops) and those are causing performance problems when they have to handle requests. To solve the issue I disabled sniffing again and didn't connect to those 3 nodes.</p>
<p dir="auto">In order to still have node discovery in case a node is added or removed to/from the cluster it would be great to have an exclusion feature.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Settings.Builder settingsBuilder = Settings.settingsBuilder()
.put("cluster.name", "cluster")
.put("client.transport.sniff", true).
.putArray("client.transport.sniff.exclude", "node1", "node2", ...);"><pre class="notranslate"><code class="notranslate">Settings.Builder settingsBuilder = Settings.settingsBuilder()
.put("cluster.name", "cluster")
.put("client.transport.sniff", true).
.putArray("client.transport.sniff.exclude", "node1", "node2", ...);
</code></pre></div>
<p dir="auto">So sniffing would detect every x seconds all the nodes in the cluster, but it will not connect to the ones which are excluded.</p> | <p dir="auto">I have a case where the completion suggester is omitting results, below are two example documents. For a search like "Samsung", only Document 1 will be returned. Actually its the only document returned, so the <code class="notranslate">size=10</code> is not reached. The only major difference i can is see is the weight, will the completion suggester omitt result if there's a huge difference in weight?</p>
<p dir="auto">Document 1:<br>
<code class="notranslate">{ "_index" : "suggester", "_type" : "suggestions", "_id" : "b089f7c6a85f39fb882398b6c8ba34c1", "_score" : 1.0, "_source":{"suggest":{"input":["Sm","Samsung Mobiles Tablets","Mobiles \u0026 Tablets","(Export) Galaxy Note 4 Sm","Galaxy Note 4 Sm","Note 4 Sm","4 Sm"], "output":62020, "payload":{"br":"Samsung", "ca":"Mobiles \u0026 Tablets", "cl":"N910C LTE 32GB White","co":"product","li":"http://one", "pr":"(Export) Galaxy Note 4 Sm","th":"thumb1.jpg"},"weight":63}} }</code></p>
<p dir="auto">Document 2:<br>
<code class="notranslate">{ "_index" : "suggester", "_type" : "suggestions", "_id" : "22480c43af984689f7254bda8d16f99a", "_score" : 1.0, "_source":{"suggest":{"input":["Samsung Mobiles Tablets","Mobiles \u0026 Tablets","Galaxy Note 4 Sm","Note 4 Sm","4 Sm","Sm"],"output":21970, "payload":{"br":"Samsung","ca":"Mobiles \u0026 Tablets","cl":"N910S LTE Black (Local warranty)","co":"product","li":"http://two", "pr":"Galaxy Note 4 Sm", "th":"thumb2.jpg"}, "weight":27}} }</code></p> | 0 |
<p dir="auto"><strong>I'm submitting a ...</strong> (check one with "x")</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="[x] feature request"><pre class="notranslate"><code class="notranslate">[x] feature request
</code></pre></div>
<p dir="auto"><strong>Current behavior</strong><br>
Currently we have two ways to work with forms:</p>
<ol dir="auto">
<li>Declarative with <code class="notranslate">ngModel</code>:</li>
</ol>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="//user.component.html:
<form>
<input name="name" type="text" [ngModel]="user?.name" (ngModelChange)="user==null || user.name=$event" required/>
</form>
//user.component.ts:
this.user = user;"><pre class="notranslate"><code class="notranslate">//user.component.html:
<form>
<input name="name" type="text" [ngModel]="user?.name" (ngModelChange)="user==null || user.name=$event" required/>
</form>
//user.component.ts:
this.user = user;
</code></pre></div>
<p dir="auto">You can clearly see that it can be quite verbose. Name has to be specified two or three times, elvis operator does not work with assignments. This example is simplified, see how ugly it could be:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="<div class="input" label="La Carte Attorney Confirmed Claim Task Set: " name="laCarteAttorneyConfirmedClaimTaskSet" type="search" [ngModel]="department?.laCarteAttorneyConfirmedClaimTaskSet" (ngModelChange)="department==null || department.laCarteAttorneyConfirmedClaimTaskSet=$event" [dataProvider]="claim" labelField="name" trackBy="id"></div>"><pre class="notranslate"><code class="notranslate"><div class="input" label="La Carte Attorney Confirmed Claim Task Set: " name="laCarteAttorneyConfirmedClaimTaskSet" type="search" [ngModel]="department?.laCarteAttorneyConfirmedClaimTaskSet" (ngModelChange)="department==null || department.laCarteAttorneyConfirmedClaimTaskSet=$event" [dataProvider]="claim" labelField="name" trackBy="id"></div>
</code></pre></div>
<ol start="2" dir="auto">
<li>Reactive, manually building <code class="notranslate">FormGroup</code>:</li>
</ol>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="//user.component.html:
<form [formGroup]="group">
<input formControlName="name" type="text" />
</form>
//user.component.ts:
public group:FormGroup;
this.group = this.createFormGroup();
createFormGroup() {
let group: any = {};
group['name'] = new FormControl('', Validators.required);
return new FormGroup(group);
}
group.updateValue(user);"><pre class="notranslate"><code class="notranslate">//user.component.html:
<form [formGroup]="group">
<input formControlName="name" type="text" />
</form>
//user.component.ts:
public group:FormGroup;
this.group = this.createFormGroup();
createFormGroup() {
let group: any = {};
group['name'] = new FormControl('', Validators.required);
return new FormGroup(group);
}
group.updateValue(user);
</code></pre></div>
<p dir="auto">It is even more verbose - name has to be specified twice, most of time in two separate files, <code class="notranslate">FormGroup</code> is created manually. This is particularly annoying when form has many inputs.</p>
<p dir="auto"><strong>Expected behavior</strong></p>
<p dir="auto">Can't we take best from both? We already have all necessary information to create <code class="notranslate">FormGroup</code> from markup.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="//user.component.html:
<form>
<input formControlName="name" type="text" required/>
</form>
//user.component.ts:
ViewChild(FormGroupDirective)
private group:FormGroupDirective;
group.updateValue(user);"><pre class="notranslate"><code class="notranslate">//user.component.html:
<form>
<input formControlName="name" type="text" required/>
</form>
//user.component.ts:
ViewChild(FormGroupDirective)
private group:FormGroupDirective;
group.updateValue(user);
</code></pre></div>
<p dir="auto">This is much cleaner, shorter, less error prone.</p> | <p dir="auto"><strong>I'm submitting a ...</strong> (check one with "x")</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="[ ] bug report => search github for a similar issue or PR before submitting
[x ] feature request
[ ] support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question"><pre class="notranslate"><code class="notranslate">[ ] bug report => search github for a similar issue or PR before submitting
[x ] feature request
[ ] support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question
</code></pre></div>
<p dir="auto"><strong>Current behavior</strong><br>
The documentation for ngComponentOutlet as well as the comments at the top of the source code seem to indicate that one of the properties is ngComponentOutletProviders where it is possible to specify individual providers.</p>
<p dir="auto"><a href="url">https://github.com/angular/angular/blob/master/packages/common/src/directives/ng_component_outlet.ts#L25-L26</a></p>
<p dir="auto">It appears from looking at the source code that this feature has not been implemented (I was banging my head against my desk trying to figure out why it didn't work until I read the angular source code).</p>
<p dir="auto"><strong>Expected behavior</strong><br>
Documentation matches current functionality</p>
<p dir="auto"><strong>Minimal reproduction of the problem with instructions</strong></p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="import { MyDynamicComponent } from './my-dynamic.component';
@Component({
selector: 'parent-of-dynamic-component',
template: '<ng-container *ngComponentOutlet="myDynamicComponent; providers: myProvider;"></ng-conatiner>'
})
export class ParentOfDynamicComponent {
myDynamicComponent = MyDynamicComponent;
myProvider = [ { provide: 'THING', useValue: { thing: 'thing' } ];
}"><pre class="notranslate"><code class="notranslate">import { MyDynamicComponent } from './my-dynamic.component';
@Component({
selector: 'parent-of-dynamic-component',
template: '<ng-container *ngComponentOutlet="myDynamicComponent; providers: myProvider;"></ng-conatiner>'
})
export class ParentOfDynamicComponent {
myDynamicComponent = MyDynamicComponent;
myProvider = [ { provide: 'THING', useValue: { thing: 'thing' } ];
}
</code></pre></div>
<p dir="auto"><strong>What is the motivation / use case for changing the behavior?</strong><br>
It causes a lot of confusion when the documentation states certain functionality that doesn't exist. It would be a convenient feature to have, but it's easy to work around by creating an injector with your provider.</p>
<p dir="auto"><strong>Please tell us about your environment:</strong><br>
N/A</p>
<ul dir="auto">
<li>
<p dir="auto"><strong>Angular version:</strong> 2.0.X<br>
4.0.2</p>
</li>
<li>
<p dir="auto"><strong>Browser:</strong> [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]</p>
</li>
</ul>
<p dir="auto">All</p>
<ul dir="auto">
<li><strong>Language:</strong> [all | TypeScript X.X | ES6/7 | ES5]<br>
All</li>
<li><strong>Node (for AoT issues):</strong> <code class="notranslate">node --version</code> =</li>
</ul> | 0 |
<p dir="auto">I’m using the German ergonomic keyboard mapping <a href="http://neo-layout.org/" rel="nofollow">Neo</a> and Mac OS.</p>
<p dir="auto">By default, Atom has several key bindings of the form <code class="notranslate">Alt+X</code> (<code class="notranslate">X</code> being a letter). These correspond to special characters on my keyboard map, e.g., <code class="notranslate">Alt+F</code> (or, in Apple terms <code class="notranslate">Option F</code>) is <code class="notranslate">=</code>.</p>
<p dir="auto">Expected behaviour:</p>
<ul dir="auto">
<li>The symbol is inserted.</li>
</ul>
<p dir="auto">Actual behaviour:</p>
<ul dir="auto">
<li>The key binding is triggered.</li>
</ul>
<p dir="auto">I suppose you could argue that this behaviour is not a bug; in this case I urge you to reconsider the default bindings, since the current default effectively blocks me (and other non-English keyboard users) from entering various special characters.</p> | <p dir="auto">I am running Atom 0.161.0 on Mac OS X Yosemite and use the <a href="http://www.neo-layout.org/" rel="nofollow">German Neo Layout</a>. Unfortunately I can't type the characters : < > and =. In other applications (Browser, Email and so forth) it works as expected.<br>
I am aware of the issues <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="35573301" data-permission-text="Title is private" data-url="https://github.com/atom/atom-keymap/issues/35" data-hovercard-type="issue" data-hovercard-url="/atom/atom-keymap/issues/35/hovercard" href="https://github.com/atom/atom-keymap/issues/35">atom/atom-keymap#35</a>, <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="28529842" data-permission-text="Title is private" data-url="https://github.com/atom/atom/issues/1625" data-hovercard-type="issue" data-hovercard-url="/atom/atom/issues/1625/hovercard" href="https://github.com/atom/atom/issues/1625">#1625</a> and <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="45798871" data-permission-text="Title is private" data-url="https://github.com/atom/atom/issues/3834" data-hovercard-type="issue" data-hovercard-url="/atom/atom/issues/3834/hovercard" href="https://github.com/atom/atom/issues/3834">#3834</a> but these are only for the "right ALT" key.</p> | 1 |
<p dir="auto">Please allow terminal to run scripts at startup from a task bar jump list.</p>
<p dir="auto">What would be nice is having the Windows Terminal jump list provide a list of startup scripts, same way VS allows me to open projects form the jump list. I could pull up the jump list from the task bar and select whichever project I was working on. For example I could select a script from the jump list to take me to a particular working directory and setup command line compilation for the terminal instance.</p> | <ul dir="auto">
<li>Your Windows build number: (Type <code class="notranslate">ver</code> at a Windows Command Prompt)<br>
Version 10.0.17134.407, Intel Core i7-7700 embedded graphics, Full HD, 100%</li>
<li>What you're doing and what's happening:<br>
Our console app uses WriteConsoleOutputCharacterW, WriteConsoleOutputAttribute, FillConsoleOutputCharacterW, FillConsoleOutputAttribute etc.<br>
We draw on-screen boxes and menus using the box-drawing characters. When a sequence of characters is drawn in a single API call, the glyphs are contiguous. If written one at a time in adjacent locations, single pixel (I think) gaps separate the horizontal lines. The right-hand extension in the first image is done char-at-a-time, the horizontals in the tabs were done as single writes.<br>
We use a green background to indicate entry fields. When no text is written to the field cells, they draw slightly narrower than cells with text.<br>
I noticed something like this in the past, where writing a field to spaces to erase it then writing something in (or vice-versa, can't remember) left hairlines at the left and right edges of the region in question. This was hidden by carefully sequencing the write operations.<br>
This behaviour appears on some PCs in our company but not others.<br>
Previously I thought changing the font size fixed it, but not at present. This may be because the artifacts do not seem to appear for non-Unicode screen drawing using the same font and size.<br>
Note that choosing properties, font, OK causes the screen to redraw and all lines are contiguous until redrawn by the application when the gaps reappear.<br>
I normally use Lucida Console 18, but the same effect occurs with Consolas and at other font sizes. The image snippets captured use extra-large fonts for detail.</li>
</ul>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/47542711/52742509-bc7d2580-303c-11e9-9dcd-2e104a351cd9.png"><img src="https://user-images.githubusercontent.com/47542711/52742509-bc7d2580-303c-11e9-9dcd-2e104a351cd9.png" alt="lucida_36_gaps" style="max-width: 100%;"></a><br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/47542711/52742514-c2730680-303c-11e9-9d52-d452c870ca63.png"><img src="https://user-images.githubusercontent.com/47542711/52742514-c2730680-303c-11e9-9d52-d452c870ca63.png" alt="lucida_20_wiggles" style="max-width: 100%;"></a></p>
<ul dir="auto">
<li>What's wrong / what should be happening instead:<br>
Line-drawing characters should be contiguous, backgrounds should be uniformly sized.</li>
</ul> | 0 |
<p dir="auto">This is related to <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="151924353" data-permission-text="Title is private" data-url="https://github.com/tensorflow/tensorflow/issues/2170" data-hovercard-type="issue" data-hovercard-url="/tensorflow/tensorflow/issues/2170/hovercard" href="https://github.com/tensorflow/tensorflow/issues/2170">#2170</a>, which describes how to use <code class="notranslate">tf.gather</code> to index on the first dimension of a tensor. What I'd like to do now is batch this operation:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="params = tf.constant([[1, 2], [3, 4], [5. 6]])
indices = tf.constant([0, 1, 0])
gathered = tf.batch_gather(params, indices)
# gathered = [1, 4, 5]"><pre class="notranslate"><code class="notranslate">params = tf.constant([[1, 2], [3, 4], [5. 6]])
indices = tf.constant([0, 1, 0])
gathered = tf.batch_gather(params, indices)
# gathered = [1, 4, 5]
</code></pre></div> | <p dir="auto">We should make our slicing and assignment ops more general to capture more of the functionality of numpy slicing, and add <code class="notranslate">__getitem__</code> sugar for all of it. Specifically,</p>
<ol dir="auto">
<li>We should have a 2.5 dimensional set of ops, with dimensions (1) get vs. set, (2) slice type, and for the assignment ops (3) the update op. Currently we have <code class="notranslate">slice</code>, <code class="notranslate">assign_update</code>, <code class="notranslate">assign_add</code>, <code class="notranslate">assign_sub</code>, <code class="notranslate">gather</code>, <code class="notranslate">scatter_update</code>, <code class="notranslate">scatter_add</code>, <code class="notranslate">scatter_sub</code>. We should also have <code class="notranslate">assign_slice_update</code>, <code class="notranslate">assign_slice_add</code>, <code class="notranslate">assign_slice_sub</code>.</li>
<li>Both slicing and slice assignment should support strides, with no performance cost if strides aren't used.</li>
<li>Ideally, the slice ops should support negative indexing a la Python. Since the slice parameters are already CPU, this is implementable with near zero cost. The unfortunate bit is that since we picked the wrong format for specifying ranges (start + length instead of start : end), negative indexing might be awkward. Thus, it might be best left to a separate bug.</li>
<li>Support numpy-like boolean indexing.</li>
<li>Generalize <code class="notranslate">gather</code> and <code class="notranslate">scatter_*</code> to take an array of input index tensors, efficiently broadcast them, and do multidimensional indexing similar to numpy.</li>
<li>Make <code class="notranslate">__getitem__</code> provide sugar for all of the above. Ideally we'd have something idiomatically similar at least to <code class="notranslate">__setitem__</code>, but this is problematic since the returned assignment op is important to have, <code class="notranslate">__setitem__</code> does not return a value, and the nice range sugar is available only inside indexing / assignment calls.</li>
</ol>
<p dir="auto"><a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/ebrevdo/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/ebrevdo">@ebrevdo</a>: I'm assigning this to you for now since you might get to it first, but feel free to grab only the piece of it that you need for now.</p> | 1 |
<p dir="auto">Atom has multiple associations with files. It seems like each install in creating a new association without removing the old ones.</p>
<p dir="auto"><a href="https://pbs.twimg.com/media/Bu_8ZhICIAAkF2T.png:large" rel="nofollow">https://pbs.twimg.com/media/Bu_8ZhICIAAkF2T.png:large</a></p> | <p dir="auto">support/6be6d1eaa44911e38bd5c0467822a465?page=1</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://camo.githubusercontent.com/083b5472896f2ccf565018dcb5fdeacf09ee817001e0d49eb7382c48c4ff401c/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f313437362f323335323632332f39346132616131652d613538652d313165332d383933322d6632383562656465643662352e706e67"><img src="https://camo.githubusercontent.com/083b5472896f2ccf565018dcb5fdeacf09ee817001e0d49eb7382c48c4ff401c/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f313437362f323335323632332f39346132616131652d613538652d313165332d383933322d6632383562656465643662352e706e67" alt="screen shot 2014-03-06 at 4 21 49 pm" data-canonical-src="https://f.cloud.github.com/assets/1476/2352623/94a2aa1e-a58e-11e3-8932-f285beded6b5.png" style="max-width: 100%;"></a></p> | 1 |
<h3 dir="auto">Preflight Checklist</h3>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have read the <a href="https://github.com/electron/electron/blob/master/CONTRIBUTING.md">Contributing Guidelines</a> for this project.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I agree to follow the <a href="https://github.com/electron/electron/blob/master/CODE_OF_CONDUCT.md">Code of Conduct</a> that this project adheres to.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have searched the <a href="https://www.github.com/electron/electron/issues">issue tracker</a> for a feature request that matches the one I want to file, without success.</li>
</ul>
<h3 dir="auto">Electron Version</h3>
<p dir="auto">12.0.5</p>
<h3 dir="auto">What operating system are you using?</h3>
<p dir="auto">Ubuntu</p>
<h3 dir="auto">Operating System Version</h3>
<p dir="auto">Ubuntu 21.04 x86_64 5.11.0-16-generic</p>
<h3 dir="auto">What arch are you using?</h3>
<p dir="auto">x64</p>
<h3 dir="auto">Last Known Working Electron version</h3>
<p dir="auto"><em>No response</em></p>
<h3 dir="auto">Expected Behavior</h3>
<p dir="auto">SVG Icon could also be loaded too</p>
<h3 dir="auto">Actual Behavior</h3>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/61906684/117102503-ae915780-ada2-11eb-9359-1e7a92a9a5e9.png"><img src="https://user-images.githubusercontent.com/61906684/117102503-ae915780-ada2-11eb-9359-1e7a92a9a5e9.png" alt="image" style="max-width: 100%;"></a></p>
<h3 dir="auto">Testcase Gist URL</h3>
<p dir="auto"><em>No response</em></p>
<h3 dir="auto">Additional Information</h3>
<p dir="auto"><em>No response</em></p> | <h3 dir="auto">Preflight Checklist</h3>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have read the <a href="https://github.com/electron/electron/blob/master/CONTRIBUTING.md">Contributing Guidelines</a> for this project.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I agree to follow the <a href="https://github.com/electron/electron/blob/master/CODE_OF_CONDUCT.md">Code of Conduct</a> that this project adheres to.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have searched the issue tracker for an issue that matches the one I want to file, without success.</li>
</ul>
<h3 dir="auto">Issue Details</h3>
<ul dir="auto">
<li>
<p dir="auto"><strong>Electron Version:</strong><br>
Electron 9.1.0</p>
</li>
<li>
<p dir="auto"><strong>Operating System:</strong><br>
Debian GNU/Linux 10 (buster)</p>
</li>
</ul>
<h3 dir="auto">Expected Behavior</h3>
<p dir="auto">Rotate the electron after the npm start command</p>
<h3 dir="auto">Actual Behavior</h3>
<p dir="auto">[17300:0714/163809.183079:FATAL:electron_main_delegate.cc(264)] Running as root without --no-sandbox is not supported. See <a href="https://crbug.com/638180" rel="nofollow">https://crbug.com/638180</a>.</p>
<h3 dir="auto">To Reproduce</h3>
<p dir="auto">Just follow the documentation to install electron and create the application.</p> | 0 |
<p dir="auto">Challenge <a href="http://freecodecamp.com/challenges/waypoint-manipulate-arrays-with-pop" rel="nofollow">http://freecodecamp.com/challenges/waypoint-manipulate-arrays-with-pop</a> has an issue. Please describe how to reproduce it, and include links to screenshots if possible.</p>
<p dir="auto">All of the javascript challenges have assertions with long strings of code. I am not sure if it is by design but it seems odd to me.</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://cloud.githubusercontent.com/assets/2525359/9384083/459f057a-4713-11e5-8d93-b2dc2ce3e896.png"><img src="https://cloud.githubusercontent.com/assets/2525359/9384083/459f057a-4713-11e5-8d93-b2dc2ce3e896.png" alt="image" style="max-width: 100%;"></a></p> | <h4 dir="auto">beta.freecodecamp.com</h4>
<h4 dir="auto">Issue Description</h4>
<p dir="auto">It's exactly the same <a href="https://github.com/freeCodeCamp/freeCodeCamp/issues/13462" data-hovercard-type="issue" data-hovercard-url="/freeCodeCamp/freeCodeCamp/issues/13462/hovercard">problem at this issue.</a></p>
<ol dir="auto">
<li>I decided to link my email in settings. (I login with my Github account)</li>
<li>After submitting the form I got an email from freecodecamp for verification.</li>
<li>On clicking the verification link I was redirected to the main site of freecodecamp ie <a href="https://www.freecodecamp.com" rel="nofollow">https://www.freecodecamp.com</a> instead of the beta site <a href="http://beta.freecodecamp.com" rel="nofollow">http://beta.freecodecamp.com</a><br>
and I got an error message "Oops, something went wrong, please try again later" on <a href="https://www.freecodecamp.com" rel="nofollow">https://www.freecodecamp.com</a>.</li>
<li>When I came back to the beta site i.e <a href="http://beta.freecodecamp.com" rel="nofollow">http://beta.freecodecamp.com</a> there the email setting section of the setting page my email address was already linked</li>
<li>And I noticed that I had only 1 brownie point. When I checked my public profile I found out that all my solved challenges were wiped out completely.</li>
</ol>
<p dir="auto">My FreeCodeCamp's account (freecodecamp.com not beta.freecodecamp.com) has not affected.</p>
<p dir="auto">May I get back my progress?</p> | 0 |
<p dir="auto">I've noticed that text appears more blurry on electron than in regular Chrome.</p>
<p dir="auto">Mind you i'm using the latest electron version 1.6.0.</p>
<p dir="auto">This is a comparison between <strong>Chrome (Top)</strong> and Electron's <strong>Chromium (Bottom)</strong></p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://camo.githubusercontent.com/405c55863e6db13f645ff01e77434abf7c7fd1bb018fe956168e665ef27d87e2/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f736e6170732d6275636b65742f323031372f30322f58374a4c7373462f323031372d30322d31375f31342d34352d35332e706e67"><img src="https://camo.githubusercontent.com/405c55863e6db13f645ff01e77434abf7c7fd1bb018fe956168e665ef27d87e2/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f736e6170732d6275636b65742f323031372f30322f58374a4c7373462f323031372d30322d31375f31342d34352d35332e706e67" alt="" data-canonical-src="https://s3.amazonaws.com/snaps-bucket/2017/02/X7JLssF/2017-02-17_14-45-53.png" style="max-width: 100%;"></a></p>
<p dir="auto">Any ideas how to fix this?</p> | <p dir="auto">Since Electron 1.2.0, that means since the update from Chrome 50 to Chrome 51, there no LCD-text-antialiasing anymore (tested only on Windows).</p>
<p dir="auto">Here an animated GIF showing the difference (300% zoomed screenshots) - look at the 'To run...' text:<br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://cloud.githubusercontent.com/assets/5989766/16565403/46503f2a-420d-11e6-9573-da40f6abd453.gif"><img src="https://cloud.githubusercontent.com/assets/5989766/16565403/46503f2a-420d-11e6-9573-da40f6abd453.gif" alt="lcd-text-antialiasing" data-animated-image="" style="max-width: 100%;"></a><br>
The text is now less sharp and slightly blurred...</p>
<p dir="auto">NWJS has the same problem since updating to Chrome 51, but Chrome 51 itself is fine.</p>
<p dir="auto">Due my own research it seems that the problem might be somehow related to some page/window background-color and/or transparency settings... (Chrome renders automatically with grayscale-antialiasing on transparent elements).</p> | 1 |
<h5 dir="auto">Issue Type: Bug Report</h5>
<h5 dir="auto">Ansible Version:</h5>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$ ansible --version
ansible 1.9.0.1
configured module search path = None"><pre class="notranslate"><code class="notranslate">$ ansible --version
ansible 1.9.0.1
configured module search path = None
</code></pre></div>
<h5 dir="auto">Environment:</h5>
<p dir="auto">Running on Mac OS to manage an Ubuntu 14.04 VM.</p>
<h5 dir="auto">Summary:</h5>
<p dir="auto">The new version 1.2.1 of the "docker-py" module seems to have removed the "docker.client.DEFAULT_DOCKER_API_VERSION" variable that Ansible was using.</p>
<p dir="auto">FWIW - It looks like this 1.2.1 release of "docker-py" just came out today, 4/29/15. See: <a href="https://pypi.python.org/pypi/docker-py" rel="nofollow">https://pypi.python.org/pypi/docker-py</a>.</p>
<p dir="auto">And here's a link to the diff on "docker-py" where <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/shin-/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/shin-">@shin-</a> removed "docker.client.DEFAULT_DOCKER_API_VERSION":<br>
<a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/docker/docker-py/commit/ae329cb3acb3ff38bd986215c99b1136a6183f78/hovercard" href="https://github.com/docker/docker-py/commit/ae329cb3acb3ff38bd986215c99b1136a6183f78">docker/docker-py@<tt>ae329cb</tt></a></p>
<p dir="auto">And the new "docker.constants" file where this variable was moved to:<br>
<a href="https://github.com/docker/docker-py/blob/ae329cb3acb3ff38bd986215c99b1136a6183f78/docker/constants.py#L1">https://github.com/docker/docker-py/blob/ae329cb3acb3ff38bd986215c99b1136a6183f78/docker/constants.py#L1</a></p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="TASK: [apt-cacher-ng | Run the extellisys/apt-cacher-ng Docker container] *****
failed: [default] => {"failed": true, "parsed": false}
BECOME-SUCCESS-ldprfowyxhdsqcsgmtrqpvirszzgajwq
Traceback (most recent call last):
File "/home/vagrant/.ansible/tmp/ansible-tmp-1430328017.67-135370415083178/docker", line 3104, in <module>
main()
File "/home/vagrant/.ansible/tmp/ansible-tmp-1430328017.67-135370415083178/docker", line 1449, in main
manager = DockerManager(module)
File "/home/vagrant/.ansible/tmp/ansible-tmp-1430328017.67-135370415083178/docker", line 558, in __init__
docker_api_version=docker.client.DEFAULT_DOCKER_API_VERSION
AttributeError: 'module' object has no attribute 'DEFAULT_DOCKER_API_VERSION'"><pre class="notranslate"><code class="notranslate">TASK: [apt-cacher-ng | Run the extellisys/apt-cacher-ng Docker container] *****
failed: [default] => {"failed": true, "parsed": false}
BECOME-SUCCESS-ldprfowyxhdsqcsgmtrqpvirszzgajwq
Traceback (most recent call last):
File "/home/vagrant/.ansible/tmp/ansible-tmp-1430328017.67-135370415083178/docker", line 3104, in <module>
main()
File "/home/vagrant/.ansible/tmp/ansible-tmp-1430328017.67-135370415083178/docker", line 1449, in main
manager = DockerManager(module)
File "/home/vagrant/.ansible/tmp/ansible-tmp-1430328017.67-135370415083178/docker", line 558, in __init__
docker_api_version=docker.client.DEFAULT_DOCKER_API_VERSION
AttributeError: 'module' object has no attribute 'DEFAULT_DOCKER_API_VERSION'
</code></pre></div>
<p dir="auto">If I downgrade my "docker-py" to the previous 1.1.0 release, the Ansible operation completes successfully.</p>
<h5 dir="auto">Steps To Reproduce:</h5>
<p dir="auto">Pretty basic use of Ansible's "docker" module:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="- name: apt-cacher-ng | Run the extellisys/apt-cacher-ng Docker container
docker:
image=extellisys/apt-cacher-ng
name=apt-cacher-ng
ports="{{ apt_cache_server_port }}:3142"
volumes="{{ apt_cache_server_dir }}:/var/cache/apt-cacher-ng""><pre class="notranslate"><code class="notranslate">- name: apt-cacher-ng | Run the extellisys/apt-cacher-ng Docker container
docker:
image=extellisys/apt-cacher-ng
name=apt-cacher-ng
ports="{{ apt_cache_server_port }}:3142"
volumes="{{ apt_cache_server_dir }}:/var/cache/apt-cacher-ng"
</code></pre></div>
<p dir="auto">Again, this issue occurs when "docker-py" is 1.2.1 and not when "docker-py" is 1.1.0.</p>
<h5 dir="auto">Expected Results:</h5>
<p dir="auto">I expect Ansible's "docker" module to work correctly.</p>
<h5 dir="auto">Actual Results:</h5>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="TASK: [apt-cacher-ng | Run the extellisys/apt-cacher-ng Docker container] *****
failed: [default] => {"failed": true, "parsed": false}
BECOME-SUCCESS-ldprfowyxhdsqcsgmtrqpvirszzgajwq
Traceback (most recent call last):
File "/home/vagrant/.ansible/tmp/ansible-tmp-1430328017.67-135370415083178/docker", line 3104, in <module>
main()
File "/home/vagrant/.ansible/tmp/ansible-tmp-1430328017.67-135370415083178/docker", line 1449, in main
manager = DockerManager(module)
File "/home/vagrant/.ansible/tmp/ansible-tmp-1430328017.67-135370415083178/docker", line 558, in __init__
docker_api_version=docker.client.DEFAULT_DOCKER_API_VERSION
AttributeError: 'module' object has no attribute 'DEFAULT_DOCKER_API_VERSION'"><pre class="notranslate"><code class="notranslate">TASK: [apt-cacher-ng | Run the extellisys/apt-cacher-ng Docker container] *****
failed: [default] => {"failed": true, "parsed": false}
BECOME-SUCCESS-ldprfowyxhdsqcsgmtrqpvirszzgajwq
Traceback (most recent call last):
File "/home/vagrant/.ansible/tmp/ansible-tmp-1430328017.67-135370415083178/docker", line 3104, in <module>
main()
File "/home/vagrant/.ansible/tmp/ansible-tmp-1430328017.67-135370415083178/docker", line 1449, in main
manager = DockerManager(module)
File "/home/vagrant/.ansible/tmp/ansible-tmp-1430328017.67-135370415083178/docker", line 558, in __init__
docker_api_version=docker.client.DEFAULT_DOCKER_API_VERSION
AttributeError: 'module' object has no attribute 'DEFAULT_DOCKER_API_VERSION'
</code></pre></div> | <p dir="auto">docker-py recently moved their constants in a backwards incompatible way in v1.2.x</p>
<p dir="auto">Previously we accessed <code class="notranslate">docker.client.DEFAULT_DOCKER_API_VERSION</code></p>
<p dir="auto">That constant is now available at <code class="notranslate">docker.client.constants.DEFAULT_DOCKER_API_VERSION</code></p>
<p dir="auto">See <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="71432030" data-permission-text="Title is private" data-url="https://github.com/docker/docker-py/issues/570" data-hovercard-type="pull_request" data-hovercard-url="/docker/docker-py/pull/570/hovercard" href="https://github.com/docker/docker-py/pull/570">docker/docker-py#570</a> for the relevant change.</p>
<p dir="auto">We will need to update reference of this constant.</p>
<p dir="auto">cc <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/smashwilson/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/smashwilson">@smashwilson</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/abadger/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/abadger">@abadger</a></p> | 1 |
<p dir="auto">This came up in a <a href="https://twitter.com/devongovett/status/1199862177559171072?s=21" rel="nofollow">twitter thread</a> with <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/gaearon/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/gaearon">@gaearon</a> and <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/aweary/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/aweary">@aweary</a> and we decided to move the discussion here. I’ll try to summarize the conversation so far below.</p>
<p dir="auto">The basic question was whether a build tool could extract the static parts of a component tree ahead of time into HTML, and ship smaller JS to the client with only the dynamic parts. This could have benefits for code size and hydration performance for statically generated sites. It would likely have a smaller impact on dynamically generated server rendered sites, but it’s possible there are static parts that could be extracted there too (e.g. header, footer, article content, etc.).</p>
<p dir="auto">There are a couple potential ways to go about this, each with various tradeoffs.</p>
<ol dir="auto">
<li>Do something like what ember and other template compilers do and generate some kind of IR from components and inject dynamic content into slots at runtime. This would likely require a lot of changes to React itself. <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/aweary/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/aweary">@aweary</a> seems to be working on some kind of <a href="https://twitter.com/aweary/status/1199867044532903937?s=21" rel="nofollow">compiler</a> to do just that.</li>
<li>Rewrite the JS with something like prepack, similar to what <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/trueadm/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/trueadm">@trueadm</a> did <a href="https://github.com/trueadm/ssr-with-prepack-hackathon">here</a> (though it sounded like the output was quite variable in size).</li>
<li>Rewrite the component tree to generate a different but equivalent tree with the static parts hoisted out. Similar to this <a href="https://github.com/jamiebuilds/babel-react-optimize">babel plugin</a> but taken much farther to work at a whole tree level instead of a component level. Also to remove the static parts from JS altogether and generate static HTML to avoid duplicate content in JS and unnecessary hydration cost. Some way to allow static HTML in the middle of a tree to be reused might be needed, but maybe compiling to multiple roots would work?</li>
</ol>
<p dir="auto">Obviously a lot more thought is needed here. As <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/gaearon/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/gaearon">@gaearon</a> noted, a solid definition of “static” will be important for this discussion. Mine is that it could be rendered to HTML and never updated by JS, but perhaps people have other ideas.</p> | <p dir="auto">The problem is best expressed in terms of an example:</p>
<p dir="auto">I've a function that acts as an plugs into my implementation of an isomorphic style loader. The function is simply set on the very high-level <code class="notranslate">AppContext</code> (that contains the application services, and components and the whole shebang) which is passed through root component as a <code class="notranslate">context</code>. So, a component inside essentially just needs to get that style applier function from the context and run them. And naturally, abstracting it into a higher order component would make the most sense to initiate the styles and dispose of them, paired with the lifecycle.</p>
<p dir="auto"><strong>Note:</strong> A similar live implementation running my site, <a href="https://www.prasannavl.com" rel="nofollow">https://www.prasannavl.com</a> is here: <a href="https://github.com/prasannavl/prasannavl.com/blob/0060cc4acbd8796f2495a68c3669b1b224476b15/src/modules/core/createStyled.ts">https://github.com/prasannavl/prasannavl.com/blob/0060cc4acbd8796f2495a68c3669b1b224476b15/src/modules/core/createStyled.ts</a> (However, since its just my site, I'm duplicating the class to workaround the below mentioned problem)</p>
<p dir="auto">However, I <strong>DO NOT</strong> want to couple this component into my app's context. So, essentially, I want something like this:</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="export function createStyledWith<T>(styleApplier: CssStyle.StyleApplierFunction, InnerComponent: T, ...styles: any[]) {
class StyledComponent extends React.Component<any, any> {
static displayName = getDisplayName(InnerComponent);
private removeCss: () => void;
componentWillMount() {
this.removeCss = styleApplier.apply(this, styles);
}
componentWillUnmount() {
const removeCss = this.removeCss;
setTimeout(removeCss, 0);
}
render() {
return React.createElement(InnerComponent as any, this.props);
}
}
// Trick the type system into thinking its the same component
return StyledComponent as any as T;
}"><pre class="notranslate"><span class="pl-k">export</span> <span class="pl-k">function</span> <span class="pl-en">createStyledWith</span><span class="pl-c1"><</span><span class="pl-smi">T</span><span class="pl-c1">></span><span class="pl-kos">(</span><span class="pl-s1">styleApplier</span>: <span class="pl-smi">CssStyle</span><span class="pl-kos">.</span><span class="pl-smi">StyleApplierFunction</span><span class="pl-kos">,</span> <span class="pl-smi">InnerComponent</span>: <span class="pl-smi">T</span><span class="pl-kos">,</span> ...<span class="pl-s1">styles</span>: <span class="pl-smi">any</span><span class="pl-kos">[</span><span class="pl-kos">]</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-k">class</span> <span class="pl-smi">StyledComponent</span> <span class="pl-k">extends</span> <span class="pl-smi">React</span><span class="pl-kos">.</span><span class="pl-c1">Component</span><span class="pl-kos"><</span><span class="pl-smi">any</span><span class="pl-kos">,</span> <span class="pl-smi">any</span><span class="pl-kos">></span> <span class="pl-kos">{</span>
<span class="pl-k">static</span> <span class="pl-c1">displayName</span> <span class="pl-c1">=</span> <span class="pl-en">getDisplayName</span><span class="pl-kos">(</span><span class="pl-smi">InnerComponent</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-k">private</span> <span class="pl-c1">removeCss</span>: <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">=></span> <span class="pl-smi"><span class="pl-k">void</span></span><span class="pl-kos">;</span>
<span class="pl-en">componentWillMount</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">removeCss</span> <span class="pl-c1">=</span> <span class="pl-s1">styleApplier</span><span class="pl-kos">.</span><span class="pl-en">apply</span><span class="pl-kos">(</span><span class="pl-smi">this</span><span class="pl-kos">,</span> <span class="pl-s1">styles</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span>
<span class="pl-en">componentWillUnmount</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-k">const</span> <span class="pl-s1">removeCss</span> <span class="pl-c1">=</span> <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">removeCss</span><span class="pl-kos">;</span>
<span class="pl-en">setTimeout</span><span class="pl-kos">(</span><span class="pl-s1">removeCss</span><span class="pl-kos">,</span> <span class="pl-c1">0</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span>
<span class="pl-en">render</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-k">return</span> <span class="pl-smi">React</span><span class="pl-kos">.</span><span class="pl-en">createElement</span><span class="pl-kos">(</span><span class="pl-smi">InnerComponent</span> <span class="pl-k">as</span> <span class="pl-smi">any</span><span class="pl-kos">,</span> <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">props</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span>
<span class="pl-kos">}</span>
<span class="pl-c">// Trick the type system into thinking its the same component</span>
<span class="pl-k">return</span> <span class="pl-smi">StyledComponent</span> <span class="pl-k">as</span> <span class="pl-smi">any</span> <span class="pl-k">as</span> <span class="pl-smi">T</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span></pre></div>
<p dir="auto">The problem: How do I create a <code class="notranslate">styleApplier</code> that pull the service from the context?</p>
<p dir="auto">I simply cannot pass the decoupled style applier function into this component, unless I have it stored else where.</p>
<p dir="auto"><strong>Why?</strong></p>
<p dir="auto">I have no access to the context outside of the component. Well, that can be solved by providing a closure that accesses the context, and pull the services. (Or so I thought). But since this doesn't have <code class="notranslate">contextTypes</code>, React will refuse to acknowledge the existence of context. So, there's really no way to make this work without another un-necessary abstraction - another higher order component - that pulls the styleapplier out of the context, and then provides it to this component that can then be called.</p>
<p dir="auto">Higher order components may be gold. But if you fill an entire ship with gold, it will sink. Its great that the React community is insisting on the HOC pattern. But it seems a little dogmatic for that to be the only way to do certain things. Because, its seems totally wasteful to do this for components that are tiny, and exists in hundreds. HOCs may only have small processor time requirement, but does consume memory with each component. More diffing for react, more things to keep around, more lifecycle method executions and so on.</p>
<p dir="auto">Note that, I'm only using the above as an example. My concern is more of the pattern involved. I encounter this on many scenarios, and seem to have to jump through hoops to access these if I do not want to use more higher order components, with no other good way to solve this.</p>
<p dir="auto">Things that <em>could</em> potentially solve this:</p>
<ul dir="auto">
<li>Most reasonable one IMO: Make context validation optional. Don't shove it down the component's throat.</li>
<li>Provide a way to access context from the outside without using higher order components. (Well, I think this kinda breaks many encapsulations, but just leaving it out there since it would theoretically solve the issue)</li>
</ul> | 0 |
<p dir="auto">Windows build number: Windows 10 Pro 64 bit, Ver 1909, OS build 18363.815<br>
PowerToys version: 0.17.0<br>
PowerToy module for which you are reporting the bug (if applicable):</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="
# Actual behavior
Selecting "settings" - Powertoys window loads for a couple of seconds and then shuts down. I have been having this problem since Powertoys 0.11.
Program is running in administrative mode. Had no issues when installing. Tried uninstalling/reinstalling, didn't fix the problem. It works on other pc's/tablets that I own.
"><pre class="notranslate"><code class="notranslate">
# Actual behavior
Selecting "settings" - Powertoys window loads for a couple of seconds and then shuts down. I have been having this problem since Powertoys 0.11.
Program is running in administrative mode. Had no issues when installing. Tried uninstalling/reinstalling, didn't fix the problem. It works on other pc's/tablets that I own.
</code></pre></div> | <h1 dir="auto">Environment</h1>
<p dir="auto">W10 Pro V1903 Build 18362.295<br>
PowerToys: 0.11.0<br>
Settings Screen</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Windows build number: [run "ver" at a command prompt]
PowerToys version:
PowerToy module for which you are reporting the bug (if applicable):"><pre class="notranslate"><code class="notranslate">Windows build number: [run "ver" at a command prompt]
PowerToys version:
PowerToy module for which you are reporting the bug (if applicable):
</code></pre></div>
<h1 dir="auto">Steps to reproduce</h1>
<p dir="auto">Just installed and attempted to open settings. Screen is totally blank/empty.<br>
I 'repaired - same issue.<br>
Uninstalled, reboot and reinstall - same issue.</p>
<h1 dir="auto">Expected behavior</h1>
<p dir="auto">Expect to see config options</p>
<h1 dir="auto">Actual behavior</h1>
<p dir="auto">Blank window.</p>
<h1 dir="auto">Screenshots</h1>
<p dir="auto"><a href="https://i.imgur.com/a7oWKgp.png" rel="nofollow">https://i.imgur.com/a7oWKgp.png</a></p> | 1 |
<p dir="auto">Upgrading my app from alpha34 to alpha35, one directive I had with a selector <code class="notranslate">[on-init]</code> was not working anymore. I realize it must be conflicting in the parser with the canonical syntax for events, but it was working until alpha35 and the error we have now is not really explicit:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="TypeError: Cannot set property 'lastInBinding' of undefined
at Function._ConvertAstIntoProtoRecords.create (http://me:8080/jspm_packages/npm/angular2@2.0.0-alpha.35/src/change_detection/proto_change_detector.js:97:39)
at http://me:8080/jspm_packages/npm/angular2@2.0.0-alpha.35/src/change_detection/proto_change_detector.js:35:47"><pre class="notranslate"><code class="notranslate">TypeError: Cannot set property 'lastInBinding' of undefined
at Function._ConvertAstIntoProtoRecords.create (http://me:8080/jspm_packages/npm/angular2@2.0.0-alpha.35/src/change_detection/proto_change_detector.js:97:39)
at http://me:8080/jspm_packages/npm/angular2@2.0.0-alpha.35/src/change_detection/proto_change_detector.js:35:47
</code></pre></div>
<p dir="auto">Maybe the error could be more explicit and the doc warns about not using these prefixes (<code class="notranslate">on</code>, <code class="notranslate">var</code>, <code class="notranslate">bind</code>) in attribute selectors?</p> | <p dir="auto">Related: <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="101190599" data-permission-text="Title is private" data-url="https://github.com/angular/angular/issues/3664" data-hovercard-type="issue" data-hovercard-url="/angular/angular/issues/3664/hovercard" href="https://github.com/angular/angular/issues/3664">#3664</a> (should be fixed together)</p>
<p dir="auto">I have a template with the following element:</p>
<div class="highlight highlight-text-html-basic notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="<input type="file" id="picture" accept="image/*"
(change)="onFileSelected(f, $event)"
(fileread)>"><pre class="notranslate"><span class="pl-kos"><</span><span class="pl-ent">input</span> <span class="pl-c1">type</span>="<span class="pl-s">file</span>" <span class="pl-c1">id</span>="<span class="pl-s">picture</span>" <span class="pl-c1">accept</span>="<span class="pl-s">image/*</span>"
<span class="pl-c1">(change)</span>="<span class="pl-s">onFileSelected(f, $event)</span>"
<span class="pl-c1">(fileread)</span><span class="pl-kos">></span></pre></div>
<p dir="auto">On alpha 33 it worked great.<br>
On alpha35 it produces the following runtime error:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="EXCEPTION: TypeError: Cannot set property 'lastInBinding' of undefined
angular2.js:13030 STACKTRACE:
angular2.js:13030 TypeError: Cannot set property 'lastInBinding' of undefined
at Function.execute._ConvertAstIntoProtoRecords.create (http://localhost:5555/lib/angular2.js:18104:47)
at http://localhost:5555/lib/angular2.js:17730:49
at Array.map (native)
at createEventRecords (http://localhost:5555/lib/angular2.js:17729:36)
at JitProtoChangeDetector.execute.JitProtoChangeDetector._createFactory (http://localhost:5555/lib/angular2.js:17575:39)
at new JitProtoChangeDetector (http://localhost:5555/lib/angular2.js:17567:32)
at $__1.execute.JitChangeDetection.createProtoChangeDetector (http://localhost:5555/lib/angular2.js:10323:20)
at http://localhost:5555/lib/angular2.js:15553:42
at Array.map (native)
at Function.execute.ListWrapper.map (http://localhost:5555/lib/angular2.js:6374:26)"><pre class="notranslate"><code class="notranslate">EXCEPTION: TypeError: Cannot set property 'lastInBinding' of undefined
angular2.js:13030 STACKTRACE:
angular2.js:13030 TypeError: Cannot set property 'lastInBinding' of undefined
at Function.execute._ConvertAstIntoProtoRecords.create (http://localhost:5555/lib/angular2.js:18104:47)
at http://localhost:5555/lib/angular2.js:17730:49
at Array.map (native)
at createEventRecords (http://localhost:5555/lib/angular2.js:17729:36)
at JitProtoChangeDetector.execute.JitProtoChangeDetector._createFactory (http://localhost:5555/lib/angular2.js:17575:39)
at new JitProtoChangeDetector (http://localhost:5555/lib/angular2.js:17567:32)
at $__1.execute.JitChangeDetection.createProtoChangeDetector (http://localhost:5555/lib/angular2.js:10323:20)
at http://localhost:5555/lib/angular2.js:15553:42
at Array.map (native)
at Function.execute.ListWrapper.map (http://localhost:5555/lib/angular2.js:6374:26)
</code></pre></div>
<p dir="auto">The following modification still produces the error:</p>
<div class="highlight highlight-text-html-basic notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="<input type="file" id="picture" accept="image/*"
(change)="onFileSelected(f, $event)"
(fileread)="">"><pre class="notranslate"><span class="pl-kos"><</span><span class="pl-ent">input</span> <span class="pl-c1">type</span>="<span class="pl-s">file</span>" <span class="pl-c1">id</span>="<span class="pl-s">picture</span>" <span class="pl-c1">accept</span>="<span class="pl-s">image/*</span>"
<span class="pl-c1">(change)</span>="<span class="pl-s">onFileSelected(f, $event)</span>"
<span class="pl-c1">(fileread)</span>=""<span class="pl-kos">></span></pre></div>
<p dir="auto">This one works</p>
<div class="highlight highlight-text-html-basic notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="<input type="file" id="picture" accept="image/*"
(change)="onFileSelected(f, $event)"
(fileread)="x">"><pre class="notranslate"><span class="pl-kos"><</span><span class="pl-ent">input</span> <span class="pl-c1">type</span>="<span class="pl-s">file</span>" <span class="pl-c1">id</span>="<span class="pl-s">picture</span>" <span class="pl-c1">accept</span>="<span class="pl-s">image/*</span>"
<span class="pl-c1">(change)</span>="<span class="pl-s">onFileSelected(f, $event)</span>"
<span class="pl-c1">(fileread)</span>="<span class="pl-s">x</span>"<span class="pl-kos">></span></pre></div> | 1 |
<p dir="auto">Hello,</p>
<p dir="auto">the only thing keeping me away from atom is the fact that it's crashing everytime I try to open a large file, jquery.min.js for example. In comparision to sublime, this is pretty bad because when atom doesn't crash, it takes up to 10 seconds to load the syntax highlighter.</p>
<p dir="auto">Is there an issue similar to this or is this already tracked?</p>
<p dir="auto">I'm using OSX Yosemite and Windows 8.1</p> | <p dir="auto">So, I use my text editor for all kinds of things (writing code, reading readmes, editing dotfiles, etc). One of the things I do most often during any given day is open up large log files to troubleshoot Enterprise problems. These files can sometimes get as large as 500-800MB.</p>
<p dir="auto">I just tried viewing a 350MB log file and Atom locked up immediately -- the file selector didn't change and the entire window went completely white 4 seconds after I tried viewing the file. I could still close the top level window, but we should still have better handling for this kind of thing.</p>
<p dir="auto">Sublime Text 2 took about 55 seconds to open the file, but gave a nice progress indicator while it was loading:</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://camo.githubusercontent.com/402a77c9e676b55fa95c38e26e4345d76be5e51f1cb9b2e2790d94de0ce90c00/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f3234342f3139303337392f63306162633237652d376565352d313165322d386563342d3432303563646565306164302e706e67"><img src="https://camo.githubusercontent.com/402a77c9e676b55fa95c38e26e4345d76be5e51f1cb9b2e2790d94de0ce90c00/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f3234342f3139303337392f63306162633237652d376565352d313165322d386563342d3432303563646565306164302e706e67" alt="Screen Shot 2013-02-24 at 4 50 56 PM" data-canonical-src="https://f.cloud.github.com/assets/244/190379/c0abc27e-7ee5-11e2-8ec4-4205cdee0ad0.png" style="max-width: 100%;"></a></p>
<p dir="auto">Once it loaded it was as responsive as any other file I load (scrolled fast, normal text highlight performance, etc). It would be nice if we set this as a baseline for expected behavior (progress bar + responsive after loading).</p> | 1 |
<p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=david_syer" rel="nofollow">Dave Syer</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-7192?redirect=false" rel="nofollow">SPR-7192</a></strong> and commented</p>
<p dir="auto">Example from Chris's DIStyles presentation:</p>
<p dir="auto">AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(TellerUI.class, InMemoryAccountRepository.class, TransferServiceImpl.class, FlatFeePolicy.class);<br>
TransferService transferService = context.getBean(TransferService.class);</p>
<p dir="auto">This works fine now if all the types have explicitly <code class="notranslate">@Autowired</code> constructors, it would be great if those components could just be autowirable (implicitly). All we would need would be to optimistically register a bean definition for any class where we don't find explicit <code class="notranslate">@Autowired</code> instructions.</p>
<hr>
<p dir="auto"><strong>Issue Links:</strong></p>
<ul dir="auto">
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398172524" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/16883" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/16883/hovercard" href="https://github.com/spring-projects/spring-framework/issues/16883">#16883</a> Make <code class="notranslate">@Autowired</code> optional on a single constructor of a class decorated with <code class="notranslate">@Component</code> (<em><strong>"duplicates"</strong></em>)</li>
</ul>
<p dir="auto">1 votes, 2 watchers</p> | <p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=wim_dc" rel="nofollow">Wim De Clercq</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-9646?redirect=false" rel="nofollow">SPR-9646</a></strong> and commented</p>
<p dir="auto">Using "RedirectAttributes flash"<br>
and<br>
flash.addFlashAttribute("flash_msg", "letter");</p>
<p dir="auto">Can sometimes cause this flashmap to somehow get a bit buggy and only make the attribute available after the 2nd redirect / request.</p>
<p dir="auto">This bug is reproducable by doing the following:<br>
You need a double submit to a controller which will add to the flashmap.<br>
(I use fiddler2 to block 2 requests, and then send them simultaniously)</p>
<p dir="auto">The controller will:<br>
1st request: add something to flashmap and return "redirect:/whatever";<br>
2nd request: add something to flashmap and return "viewname" (no redirect);</p>
<p dir="auto">It's a bit of a thread race, but usually the 2nd is later, and your browser will not redirect from the 1st request, but instead show the page of the 2nd.</p>
<p dir="auto">From that moment, the flashmap is lagging 1 request behind for me.</p>
<p dir="auto">I've added a small test project which will cause the bug to happen for me:<br>
In essence, the JSP is:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="<c:if test="${not empty flash_msg}">
<strong><c:out value="${flash_msg}"/></strong>
</c:if>"><pre class="notranslate"><code class="notranslate"><c:if test="${not empty flash_msg}">
<strong><c:out value="${flash_msg}"/></strong>
</c:if>
</code></pre></div>
<p dir="auto">Controller is straightforward, and it will do what I've just said to reproduce the problem (new2 method): 1st request> redirect, 2nd request show page.</p>
<div class="highlight highlight-source-java notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="@Controller
@RequestMapping(value = "/messages")
public class MessageController {
boolean beenThere = false;
@RequestMapping(method = RequestMethod.GET)
public ModelAndView doGet(ModelAndView mav) {
mav.setViewName("display-message");
return mav;
}
@RequestMapping(value="/new", method = RequestMethod.POST)
public ModelAndView createNewMessage(ModelAndView mav, RedirectAttributes flash) {
flash.addFlashAttribute("flash_msg", "number");
mav.setViewName("redirect:/messages");
return mav;
}
@RequestMapping(value="/new2", method = RequestMethod.POST)
public ModelAndView createNewMessage2(ModelAndView mav, RedirectAttributes flash) {
flash.addFlashAttribute("flash_msg", "letter");
if(!beenThere){
mav.setViewName("redirect:/messages");
} else {
mav.setViewName("display-message");
}
beenThere = !beenThere;
return mav;
}
}"><pre class="notranslate"><span class="pl-c1">@</span><span class="pl-c1">Controller</span>
<span class="pl-c1">@</span><span class="pl-c1">RequestMapping</span>(<span class="pl-s1">value</span> = <span class="pl-s">"/messages"</span>)
<span class="pl-k">public</span> <span class="pl-k">class</span> <span class="pl-smi">MessageController</span> {
<span class="pl-smi">boolean</span> <span class="pl-s1">beenThere</span> = <span class="pl-c1">false</span>;
<span class="pl-c1">@</span><span class="pl-c1">RequestMapping</span>(<span class="pl-s1">method</span> = <span class="pl-smi">RequestMethod</span>.<span class="pl-c1">GET</span>)
<span class="pl-k">public</span> <span class="pl-smi">ModelAndView</span> <span class="pl-en">doGet</span>(<span class="pl-smi">ModelAndView</span> <span class="pl-s1">mav</span>) {
<span class="pl-s1">mav</span>.<span class="pl-en">setViewName</span>(<span class="pl-s">"display-message"</span>);
<span class="pl-k">return</span> <span class="pl-s1">mav</span>;
}
<span class="pl-c1">@</span><span class="pl-c1">RequestMapping</span>(<span class="pl-s1">value</span>=<span class="pl-s">"/new"</span>, <span class="pl-s1">method</span> = <span class="pl-smi">RequestMethod</span>.<span class="pl-c1">POST</span>)
<span class="pl-k">public</span> <span class="pl-smi">ModelAndView</span> <span class="pl-en">createNewMessage</span>(<span class="pl-smi">ModelAndView</span> <span class="pl-s1">mav</span>, <span class="pl-smi">RedirectAttributes</span> <span class="pl-s1">flash</span>) {
<span class="pl-s1">flash</span>.<span class="pl-en">addFlashAttribute</span>(<span class="pl-s">"flash_msg"</span>, <span class="pl-s">"number"</span>);
<span class="pl-s1">mav</span>.<span class="pl-en">setViewName</span>(<span class="pl-s">"redirect:/messages"</span>);
<span class="pl-k">return</span> <span class="pl-s1">mav</span>;
}
<span class="pl-c1">@</span><span class="pl-c1">RequestMapping</span>(<span class="pl-s1">value</span>=<span class="pl-s">"/new2"</span>, <span class="pl-s1">method</span> = <span class="pl-smi">RequestMethod</span>.<span class="pl-c1">POST</span>)
<span class="pl-k">public</span> <span class="pl-smi">ModelAndView</span> <span class="pl-en">createNewMessage2</span>(<span class="pl-smi">ModelAndView</span> <span class="pl-s1">mav</span>, <span class="pl-smi">RedirectAttributes</span> <span class="pl-s1">flash</span>) {
<span class="pl-s1">flash</span>.<span class="pl-en">addFlashAttribute</span>(<span class="pl-s">"flash_msg"</span>, <span class="pl-s">"letter"</span>);
<span class="pl-k">if</span>(!<span class="pl-s1">beenThere</span>){
<span class="pl-s1">mav</span>.<span class="pl-en">setViewName</span>(<span class="pl-s">"redirect:/messages"</span>);
} <span class="pl-k">else</span> {
<span class="pl-s1">mav</span>.<span class="pl-en">setViewName</span>(<span class="pl-s">"display-message"</span>);
}
<span class="pl-s1">beenThere</span> = !<span class="pl-s1">beenThere</span>;
<span class="pl-k">return</span> <span class="pl-s1">mav</span>;
}
}</pre></div>
<p dir="auto">So if I click button "number", I end up at "new" method, and "number" appears on my screen.</p>
<p dir="auto">HOWEVER, after new2 is called twice with a double submit, I expect that if I click on the "number", "number" will be displayed on the page. But instead "letter" is displayed. And on the next request "number" is in the scope. So basically my flash scope has turned into a scope which makes attributes available for the 2nd request.</p>
<p dir="auto">I attached the war from this project, and a zip of the project.<br>
No weird configurations are used as far as I can tell.</p>
<p dir="auto">—</p>
<p dir="auto">Wim De Clercq</p>
<hr>
<p dir="auto"><strong>Affects:</strong> 3.1.1</p>
<p dir="auto"><strong>Attachments:</strong></p>
<ul dir="auto">
<li><a href="https://jira.spring.io/secure/attachment/20129/flashmessage.war" rel="nofollow">flashmessage.war</a> (<em>3.49 MB</em>)</li>
<li><a href="https://jira.spring.io/secure/attachment/20130/SpringTest.zip" rel="nofollow">SpringTest.zip</a> (<em>5.47 kB</em>)</li>
</ul>
<p dir="auto"><strong>Referenced from:</strong> commits <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/spring-attic/spring-framework-issues/commit/7c4ddd5a55947285c6195cd39e52f632d55ef4f3/hovercard" href="https://github.com/spring-attic/spring-framework-issues/commit/7c4ddd5a55947285c6195cd39e52f632d55ef4f3">spring-attic/spring-framework-issues@<tt>7c4ddd5</tt></a></p> | 0 |
<p dir="auto">If you run a cypher like this in 2-M05:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="START n=node(1)
RETURN HEAD(LABELS(n))"><pre class="notranslate"><code class="notranslate">START n=node(1)
RETURN HEAD(LABELS(n))
</code></pre></div>
<p dir="auto">you get a syntax error, saying that it expected a collection, but getting a boolean. This worked fine in M04 and previous.</p> | <p dir="auto">There seems to be a breaking change in new cypher parser, which now incorrectly parses:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="START node=node(*)
WHERE ANY (label in LABELS(node) WHERE label IN ['mylabel'])
RETURN node"><pre class="notranslate"><code class="notranslate">START node=node(*)
WHERE ANY (label in LABELS(node) WHERE label IN ['mylabel'])
RETURN node
</code></pre></div>
<p dir="auto">with error:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Error: Type mismatch: expected Collection<Any> but was Boolean (line 1, column 40)
"START node=node(*) WHERE ANY (label IN LABELS(node) WHERE label IN ['mylabel']) RETURN node"
^"><pre class="notranslate"><code class="notranslate">Error: Type mismatch: expected Collection<Any> but was Boolean (line 1, column 40)
"START node=node(*) WHERE ANY (label IN LABELS(node) WHERE label IN ['mylabel']) RETURN node"
^
</code></pre></div>
<p dir="auto">You can also see this here: <a href="http://console-test.neo4j.org/r/scx0j4" rel="nofollow">http://console-test.neo4j.org/r/scx0j4</a></p>
<p dir="auto">This was first reported in a SO question: <a href="http://stackoverflow.com/questions/18746605/neo4j-2-0-0-m05-cypher-changes-in-function-predicates-by-labels" rel="nofollow">http://stackoverflow.com/questions/18746605/neo4j-2-0-0-m05-cypher-changes-in-function-predicates-by-labels</a>.</p> | 1 |
<h1 dir="auto">Description of the new feature/enhancement</h1>
<h1 dir="auto">Proposed technical implementation details (optional)</h1> | <h1 dir="auto">Environment</h1>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Windows build number: Win32NT 10.0.18362.0 Microsoft Windows NT 10.0.18362.0
Windows Terminal version commit: 200e90d1c64cb8ad3f48b808ac695bac5bb6e696
Any other software?
Visual Studio Community 2019 16.3.3
"><pre lang="none" class="notranslate"><code class="notranslate">Windows build number: Win32NT 10.0.18362.0 Microsoft Windows NT 10.0.18362.0
Windows Terminal version commit: 200e90d1c64cb8ad3f48b808ac695bac5bb6e696
Any other software?
Visual Studio Community 2019 16.3.3
</code></pre></div>
<h1 dir="auto">Steps to reproduce</h1>
<p dir="auto">vim Terminal\src\cascadia\TerminalApp\TerminalPage.cpp<br>
yank and paste second line.</p>
<h1 dir="auto">Expected behavior</h1>
<p dir="auto">pasted line appears text, below scrolls down</p>
<h1 dir="auto">Actual behavior</h1>
<p dir="auto">pasted line appears text scrolls up.<br>
At this point there is no consistency between cursor and location in the file.<br>
Hitting "u" to undo even when at the "Already at the oldest change" point removes the text under the cursor and scrolls everything up. leading to multiple copies of the vim status line</p>
<p dir="auto">Confirms this is a problem even when ssh [-ing] to a remote machine and using vim there not the local windows instance as well.</p>
<p dir="auto"><strong>Last known working commit: <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/microsoft/terminal/commit/2c8b3243dca0c48dd05ecd7b420a7a03b3e19c93/hovercard" href="https://github.com/microsoft/terminal/commit/2c8b3243dca0c48dd05ecd7b420a7a03b3e19c93"><tt>2c8b324</tt></a> Wed Sep 25 22:00:06 2019 -0700</strong></p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/48268993/66604133-8a947280-eb7b-11e9-92ed-a54d73cd9bb1.png"><img src="https://user-images.githubusercontent.com/48268993/66604133-8a947280-eb7b-11e9-92ed-a54d73cd9bb1.png" alt="image" style="max-width: 100%;"></a></p>
<p dir="auto">Screenshot is after simply hitting "u" 6 times.</p> | 0 |
<h3 dir="auto">Version</h3>
<p dir="auto">2.6.10</p>
<h3 dir="auto">Reproduction link</h3>
<p dir="auto"><a href="https://codesandbox.io/s/vue-template-ptrum?fontsize=14" rel="nofollow">https://codesandbox.io/s/vue-template-ptrum?fontsize=14</a></p>
<h3 dir="auto">Steps to reproduce</h3>
<p dir="auto">When the parent style is scoped the <code class="notranslate"><slot></code> will lost the style of the first tag if other tags on component has a selector with v-if.</p>
<p dir="auto">Example:</p>
<p dir="auto">Main.vue:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="<template>
<Test>
<div class="test">
<div class="test2">
</div>
<div class="test2">
</div>
</div>
</Test>
</template>
<script>
import Test from './Test.vue'
export default {
components: {
Test
}
}
</script>
<style scoped>
.test {
display: flex;
}
.test2 {
width: 200px;
height: 200px;
background: black;
}
</style>"><pre class="notranslate"><code class="notranslate"><template>
<Test>
<div class="test">
<div class="test2">
</div>
<div class="test2">
</div>
</div>
</Test>
</template>
<script>
import Test from './Test.vue'
export default {
components: {
Test
}
}
</script>
<style scoped>
.test {
display: flex;
}
.test2 {
width: 200px;
height: 200px;
background: black;
}
</style>
</code></pre></div>
<p dir="auto">Test.vue</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="<template>
<div>
<div v-if="f" class="_test_style_class_name">
</div>
<slot v-else>
</slot>
</div>
</template>
<script>
export default {
data () {
return {
f: true
}
},
mounted () { this.f = false }
}
</script>"><pre class="notranslate"><code class="notranslate"><template>
<div>
<div v-if="f" class="_test_style_class_name">
</div>
<slot v-else>
</slot>
</div>
</template>
<script>
export default {
data () {
return {
f: true
}
},
mounted () { this.f = false }
}
</script>
</code></pre></div>
<p dir="auto">Open it on Chrome, and no style set on class <code class="notranslate">test</code> but I have set it on <code class="notranslate">Main.vue</code>.<br>
If I remove <code class="notranslate">class="..."</code> or remove <code class="notranslate">v-if="f"</code> on <code class="notranslate">Test.vue</code> then the class <code class="notranslate">test</code> will set..</p>
<p dir="auto">Is it that I lost something to know in using <code class="notranslate"><slot></code>?</p>
<p dir="auto">Thanks.</p>
<h3 dir="auto">What is expected?</h3>
<p dir="auto">No lost style.</p>
<h3 dir="auto">What is actually happening?</h3>
<p dir="auto">No Style set on the first tag.</p> | <h3 dir="auto">Version</h3>
<p dir="auto">2.6.10</p>
<h3 dir="auto">Reproduction link</h3>
<p dir="auto"><a href="https://jsfiddle.net/anrzf5uh/" rel="nofollow">https://jsfiddle.net/anrzf5uh/</a></p>
<h3 dir="auto">Steps to reproduce</h3>
<p dir="auto">Enter 'obj' in the text input and nothing gets printed to console. Enter <code class="notranslate">str</code> in the text input and <code class="notranslate">uncaught exception: message</code> gets printed to console. But it's wrong in both cases.</p>
<p dir="auto">If you remove <code class="notranslate">async</code> from the watch method and the call to the <code class="notranslate">await</code> method, then it works properly.</p>
<p dir="auto">Enter 'obj' in the text input and <code class="notranslate">Object { error: "message" }</code> gets printed to console. Enter <code class="notranslate">str</code> in the text input and <code class="notranslate">message</code> gets printed to console. It's right in both cases.</p>
<h3 dir="auto">What is expected?</h3>
<p dir="auto">Error handling should work the same in an async watcher as in a sync watcher.</p>
<h3 dir="auto">What is actually happening?</h3>
<p dir="auto">Error handling works correctly in a sync watcher but not async watcher.</p> | 0 |
<h1 dir="auto">Bug report</h1>
<p dir="auto"><strong>What is the current behavior?</strong><br>
Webpack builds have started failing in our automated deployments as of the 5.45.0 release a few hours ago</p>
<p dir="auto"><strong>If the current behavior is a bug, please provide the steps to reproduce.</strong></p>
<p dir="auto">In our project. ag-grid-community and GraphQL dependencies fail to compile (stack trace and webpack config file below).</p>
<p dir="auto">Our project is closed source unfortunately but here is what I suspect are repro steps:</p>
<ol dir="auto">
<li>Initialize an NPM project. Install ag-grid-community and/or GraphQL</li>
<li>Add an index.js which depends on these files in a way that requires them to be packed</li>
<li>execute webpack</li>
</ol>
<p dir="auto"><strong>What is the expected behavior?</strong><br>
Webpack should pack the files without error similar to the behavior of 5.44.0</p>
<p dir="auto"><strong>Other relevant information:</strong><br>
webpack version: 5.45.0<br>
Node.js version: 12.18.1<br>
Operating System: MACOS/Linux/Windows all reproduce<br>
Additional tools: Terser Plugin, Preamble Plugin</p>
<blockquote>
<blockquote>
<p dir="auto">Webpack Config: <a href="https://github.com/pdemro/webpack-config-5.45.0-suspected-bug/blob/main/webpack.config.js">https://github.com/pdemro/webpack-config-5.45.0-suspected-bug/blob/main/webpack.config.js</a></p>
</blockquote>
</blockquote>
<blockquote>
<blockquote>
<p dir="auto">Stack Trace:</p>
</blockquote>
</blockquote>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Entrypoint index 3.99 MiB = runtime-bundle.js 7.57 KiB vendor-bundle.js 2.14 MiB index-bundle.js 1.84 MiB
runtime modules 3.63 KiB 8 modules
modules by path ./src/ 1.43 MiB
javascript modules 1.31 MiB 319 modules
json modules 55.4 KiB 13 modules
asset modules 64.5 KiB
modules by path ./src/images/*.png 16.6 KiB 8 modules
3 modules
modules by path ./node_modules/ 4.17 MiB
modules by path ./node_modules/graphql/ 41.3 KiB 9 modules
modules by path ./node_modules/highcharts/ 346 KiB 7 modules
modules by path ./node_modules/graphql-request/ 16.6 KiB 4 modules
modules by path ./node_modules/extract-files/public/*.js 2.06 KiB 4 modules
modules by path ./node_modules/css-loader/dist/runtime/*.js 2.38 KiB
./node_modules/css-loader/dist/runtime/api.js 1.57 KiB [built] [code generated]
./node_modules/css-loader/dist/runtime/getUrl.js 830 bytes [built] [code generated]
ERROR in ./node_modules/ag-grid-community/dist/ag-grid-community.cjs.js 1530:19
Module parse failed: Unexpected token (1530:19)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
| modules.forEach(function (module) { return ModuleRegistry.register(module, moduleBased); });
| };
> ModuleRegistry.assertRegistered = function (moduleName, reason) {
| if (this.isRegistered(moduleName)) {
| return true;
@ ./src/components/agGridPopout/ag-grid-popout.ts 16:28-56
@ ./src/ sync (^.?|\.[^d]|[^.]d|[^.][^d])\.(j|t)sx?$ ./components/agGridPopout/ag-grid-popout.ts
@ ./src/index.ts 5:12-81
ERROR in ./node_modules/graphql/index.mjs 38:2
Module parse failed: Unexpected token (38:2)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
| , SchemaMetaFieldDef, TypeMetaFieldDef, TypeNameMetaFieldDef // Predicates
| , isSchema, isDirective, isType, isScalarType, isObjectType, isInterfaceType, isUnionType, isEnumType, isInputObjectType, isListType, isNonNullType, isInputType, isOutputType, isLeafType, isCompositeType, isAbstractType, isWrappingType, isNullableType, isNamedType, isRequiredArgument, isRequiredInputField, isSpecifiedScalarType, isIntrospectionType, isSpecifiedDirective // Assertions
> , assertSchema, assertDirective, assertType, assertScalarType, assertObjectType, assertInterfaceType, assertUnionType, assertEnumType, assertInputObjectType, assertListType, assertNonNullType, assertInputType, assertOutputType, assertLeafType, assertCompositeType, assertAbstractType, assertWrappingType, assertNullableType, assertNamedType // Un-modifiers
| , getNullableType, getNamedType // Validate GraphQL schema.
| , validateSchema, assertValidSchema } from "./type/index.mjs";
@ ./node_modules/graphql-tag/lib/index.js 2:0-32 65:21-26
@ ./src/generated/graphql.ts 7:38-60
@ ./src/ sync (^.?|\.[^d]|[^.]d|[^.][^d])\.(j|t)sx?$ ./generated/graphql.ts
@ ./src/index.ts 5:12-81
webpack 5.45.0 compiled with 2 errors in 31329 ms"><pre class="notranslate"><code class="notranslate">Entrypoint index 3.99 MiB = runtime-bundle.js 7.57 KiB vendor-bundle.js 2.14 MiB index-bundle.js 1.84 MiB
runtime modules 3.63 KiB 8 modules
modules by path ./src/ 1.43 MiB
javascript modules 1.31 MiB 319 modules
json modules 55.4 KiB 13 modules
asset modules 64.5 KiB
modules by path ./src/images/*.png 16.6 KiB 8 modules
3 modules
modules by path ./node_modules/ 4.17 MiB
modules by path ./node_modules/graphql/ 41.3 KiB 9 modules
modules by path ./node_modules/highcharts/ 346 KiB 7 modules
modules by path ./node_modules/graphql-request/ 16.6 KiB 4 modules
modules by path ./node_modules/extract-files/public/*.js 2.06 KiB 4 modules
modules by path ./node_modules/css-loader/dist/runtime/*.js 2.38 KiB
./node_modules/css-loader/dist/runtime/api.js 1.57 KiB [built] [code generated]
./node_modules/css-loader/dist/runtime/getUrl.js 830 bytes [built] [code generated]
ERROR in ./node_modules/ag-grid-community/dist/ag-grid-community.cjs.js 1530:19
Module parse failed: Unexpected token (1530:19)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
| modules.forEach(function (module) { return ModuleRegistry.register(module, moduleBased); });
| };
> ModuleRegistry.assertRegistered = function (moduleName, reason) {
| if (this.isRegistered(moduleName)) {
| return true;
@ ./src/components/agGridPopout/ag-grid-popout.ts 16:28-56
@ ./src/ sync (^.?|\.[^d]|[^.]d|[^.][^d])\.(j|t)sx?$ ./components/agGridPopout/ag-grid-popout.ts
@ ./src/index.ts 5:12-81
ERROR in ./node_modules/graphql/index.mjs 38:2
Module parse failed: Unexpected token (38:2)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
| , SchemaMetaFieldDef, TypeMetaFieldDef, TypeNameMetaFieldDef // Predicates
| , isSchema, isDirective, isType, isScalarType, isObjectType, isInterfaceType, isUnionType, isEnumType, isInputObjectType, isListType, isNonNullType, isInputType, isOutputType, isLeafType, isCompositeType, isAbstractType, isWrappingType, isNullableType, isNamedType, isRequiredArgument, isRequiredInputField, isSpecifiedScalarType, isIntrospectionType, isSpecifiedDirective // Assertions
> , assertSchema, assertDirective, assertType, assertScalarType, assertObjectType, assertInterfaceType, assertUnionType, assertEnumType, assertInputObjectType, assertListType, assertNonNullType, assertInputType, assertOutputType, assertLeafType, assertCompositeType, assertAbstractType, assertWrappingType, assertNullableType, assertNamedType // Un-modifiers
| , getNullableType, getNamedType // Validate GraphQL schema.
| , validateSchema, assertValidSchema } from "./type/index.mjs";
@ ./node_modules/graphql-tag/lib/index.js 2:0-32 65:21-26
@ ./src/generated/graphql.ts 7:38-60
@ ./src/ sync (^.?|\.[^d]|[^.]d|[^.][^d])\.(j|t)sx?$ ./generated/graphql.ts
@ ./src/index.ts 5:12-81
webpack 5.45.0 compiled with 2 errors in 31329 ms
</code></pre></div> | <p dir="auto"><strong>Do you want to request a <em>feature</em> or report a <em>bug</em>?</strong></p>
<p dir="auto"><strong>What is the current behavior?</strong></p>
<p dir="auto"><strong>If the current behavior is a bug, please provide the steps to reproduce.</strong></p>
<p dir="auto">Hello,<br>
When I build with NODE_ENV=production, React-Router does not render any routes. Otherwise, I works in developpment.</p>
<p dir="auto">build script</p>
<div class="highlight highlight-source-json notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content=""build": "rm -rf ./dist && NODE_ENV=production webpack --config build/webpack.config.js -p""><pre class="notranslate"><span class="pl-ent">"build"</span>: <span class="pl-s"><span class="pl-pds">"</span>rm -rf ./dist && NODE_ENV=production webpack --config build/webpack.config.js -p<span class="pl-pds">"</span></span></pre></div>
<p dir="auto">.babel-rc</p>
<div class="highlight highlight-source-json notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="{
"presets": [
["@babel/preset-env", {
"modules": false,
"targets": {
"browsers": ["last 2 versions"]
},
"development": {
"plugins": [
"babel-plugin-styled-components"
]
},
"production": {
"plugins": [
"babel-plugin-styled-components"
]
},
"exclude": ["transform-regenerator", "transform-async-to-generator"]
}]
],
"plugins": [
["@babel/plugin-transform-react-jsx", {"pragma": "h"}],
["@babel/plugin-proposal-object-rest-spread"],
["transform-react-remove-prop-types"],
["babel-plugin-styled-components"],
["syntax-dynamic-import"],
["module:fast-async", {
"compiler": {
"promises": true,
"generators": false
},
"runtimePattern": "home.js",
"spec": true
}]
]
}"><pre class="notranslate">{
<span class="pl-ent">"presets"</span>: [
[<span class="pl-s"><span class="pl-pds">"</span>@babel/preset-env<span class="pl-pds">"</span></span>, {
<span class="pl-ent">"modules"</span>: <span class="pl-c1">false</span>,
<span class="pl-ent">"targets"</span>: {
<span class="pl-ent">"browsers"</span>: [<span class="pl-s"><span class="pl-pds">"</span>last 2 versions<span class="pl-pds">"</span></span>]
},
<span class="pl-ent">"development"</span>: {
<span class="pl-ent">"plugins"</span>: [
<span class="pl-s"><span class="pl-pds">"</span>babel-plugin-styled-components<span class="pl-pds">"</span></span>
]
},
<span class="pl-ent">"production"</span>: {
<span class="pl-ent">"plugins"</span>: [
<span class="pl-s"><span class="pl-pds">"</span>babel-plugin-styled-components<span class="pl-pds">"</span></span>
]
},
<span class="pl-ent">"exclude"</span>: [<span class="pl-s"><span class="pl-pds">"</span>transform-regenerator<span class="pl-pds">"</span></span>, <span class="pl-s"><span class="pl-pds">"</span>transform-async-to-generator<span class="pl-pds">"</span></span>]
}]
],
<span class="pl-ent">"plugins"</span>: [
[<span class="pl-s"><span class="pl-pds">"</span>@babel/plugin-transform-react-jsx<span class="pl-pds">"</span></span>, {<span class="pl-ent">"pragma"</span>: <span class="pl-s"><span class="pl-pds">"</span>h<span class="pl-pds">"</span></span>}],
[<span class="pl-s"><span class="pl-pds">"</span>@babel/plugin-proposal-object-rest-spread<span class="pl-pds">"</span></span>],
[<span class="pl-s"><span class="pl-pds">"</span>transform-react-remove-prop-types<span class="pl-pds">"</span></span>],
[<span class="pl-s"><span class="pl-pds">"</span>babel-plugin-styled-components<span class="pl-pds">"</span></span>],
[<span class="pl-s"><span class="pl-pds">"</span>syntax-dynamic-import<span class="pl-pds">"</span></span>],
[<span class="pl-s"><span class="pl-pds">"</span>module:fast-async<span class="pl-pds">"</span></span>, {
<span class="pl-ent">"compiler"</span>: {
<span class="pl-ent">"promises"</span>: <span class="pl-c1">true</span>,
<span class="pl-ent">"generators"</span>: <span class="pl-c1">false</span>
},
<span class="pl-ent">"runtimePattern"</span>: <span class="pl-s"><span class="pl-pds">"</span>home.js<span class="pl-pds">"</span></span>,
<span class="pl-ent">"spec"</span>: <span class="pl-c1">true</span>
}]
]
}</pre></div>
<p dir="auto">webpack.config.js</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="const config = require('../config.js');
const path = require('path');
const webpack = require('webpack');
const htmlWebpackPlugin = require('html-webpack-plugin');
const TidyHtmlWebpackPlugin = require('tidy-html-webpack-plugin');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin');
const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin');
const PreloadWebpackPlugin = require('preload-webpack-plugin');
const { InjectManifest } = require('workbox-webpack-plugin');
const autoprefixer = require('autoprefixer');
const ProgressBarPlugin = require('progress-bar-webpack-plugin');
const MiniCSSExtractPlugin = require('mini-css-extract-plugin');
const UglifyJsPlugin = require('uglifyjs-webpack-plugin')
const production = process.env.NODE_ENV === 'production';
const sw = path.join(__dirname, '../src/sw.js');
const plugins = [
new MiniCSSExtractPlugin({
filename: '[name].[contenthash].css'
}),
ProgressBarPlugin()
];
const devServer = {
contentBase: config.contentBase,
hot: true,
hotOnly: true,
historyApiFallback: true,
port: config.port.front,
compress: production,
inline: !production,
hot: !production,
stats: {
assets: true,
children: false,
chunks: false,
hash: true,
modules: false,
publicPath: false,
timings: true,
version: false,
warnings: true
}
}
if (production) {
plugins.push(
new webpack.optimize.OccurrenceOrderPlugin(),
new htmlWebpackPlugin({
template: config.template,
minify: {
removeComments: true
},
//cache: true,
// make it work consistently with multiple chunks
chunksSortMode: 'dependency'
}),
// preload main bundles
// prefetch should be done with webpack
// when native support for prefetch will land
new PreloadWebpackPlugin({
rel: 'preload',
include: 'initial'
}),
// new TidyHtmlWebpackPlugin(),
new CopyWebpackPlugin([
{
from: path.resolve(__dirname, '../src/assets/'),
to: path.resolve(__dirname, '../dist/assets/')
},
{
from: path.resolve(__dirname, '../src/manifest.json'),
to: path.resolve(__dirname, '../dist/manifest.json')
},
{
from: path.resolve(__dirname, '../src/third_party/idb-keyval.min.js'),
to: path.resolve(__dirname, '../dist/third_party/idb-keyval.min.js')
}
]),
new InjectManifest({
swSrc: sw
})
);
} else {
plugins.push(
new webpack.HotModuleReplacementPlugin(), // hot reload
new htmlWebpackPlugin({ // generate index.html
template: config.template,
}),
new FriendlyErrorsPlugin()
);
};
const common = {
devtool: config.devtool,
mode: production ? 'production' : 'development',
// do not continue build if any errors
bail: true,
// watch mode
watch: !production,
entry: {
app: config.entry.front
},
output: {
path: path.resolve('dist'),
filename: production ? '[name].bundle.[hash].js' : '[name].bundle.js',
publicPath: '/'
},
resolve: {
extensions: ['.js', '.jsx', '.css', '.scss'],
alias: {
// in order to use css-transition-group
// you have to aliase react and react-dom
react: 'preact-compat',
'react-dom': 'preact-compat',
'react-addons-css-transition-group': 'preact-css-transition-group',
components: config.componentsPath,
routes: config.routesPath,
src: config.staticPath
}
},
module: {
rules: [{
test: /\.(css|scss)$/,
use: [
MiniCSSExtractPlugin.loader,
{
loader: 'css-loader', options: {minimize: true}
},
{
loader: 'sass-loader'
}
]
},{
test: /\.(js|jsx)$/,
exclude: /node_modules/,
include: path.resolve(__dirname, "../src"),
loader: 'babel-loader'
},
{
test: /\.(.png|svg)$/,
// compress images
loader: 'image-webpack-loader',
// Ensure this loader run before svg-loader or url-loader
enforce: 'pre'
},
// {
// test: /\.svg$/,
// loader: 'svg-url-loader',
// options: {
// // Inline image smaller than 10kb
// limit: 10 * 1024,
// // remove quotes from url
// // https://developers.google.com/web/fundamentals/performance/webpack/decrease-frontend-size
// noquotes: true
// }
// },
{
test: /\.(png|svg)$/,
loader: production ? 'file-loader' : 'url-loader',
query: {
limit: 10 * 1024,
name: '[name]-[hash:7].[ext]'
}
}]
},
optimization: {
concatenateModules: production,
nodeEnv: process.env.NODE_ENV,
minimize: production,
// optimization.minimizer overrides default optimization
// in webpack 4.
// plugin optimizer should be put here
// not in plugins anymore as before
minimizer: [
// minify js
new UglifyJsPlugin({
cache: true,
parallel: true,
sourceMap: false
}),
// Compress extracted CSS.
// Possible duplicated CSS from differents components can be deduped.
new OptimizeCSSPlugin({
cssProcessorOptions: {
safe: true
}
})
],
runtimeChunk: true,
splitChunks: {
chunks: 'all'
}
},
performance: {
hints: production ? 'warning' : false
},
plugins,
devServer
};
module.exports = common;"><pre class="notranslate"><span class="pl-k">const</span> <span class="pl-s1">config</span> <span class="pl-c1">=</span> <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">'../config.js'</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-k">const</span> <span class="pl-s1">path</span> <span class="pl-c1">=</span> <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">'path'</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-k">const</span> <span class="pl-s1">webpack</span> <span class="pl-c1">=</span> <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">'webpack'</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-k">const</span> <span class="pl-s1">htmlWebpackPlugin</span> <span class="pl-c1">=</span> <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">'html-webpack-plugin'</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-k">const</span> <span class="pl-v">TidyHtmlWebpackPlugin</span> <span class="pl-c1">=</span> <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">'tidy-html-webpack-plugin'</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-k">const</span> <span class="pl-v">CopyWebpackPlugin</span> <span class="pl-c1">=</span> <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">'copy-webpack-plugin'</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-k">const</span> <span class="pl-v">FriendlyErrorsPlugin</span> <span class="pl-c1">=</span> <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">'friendly-errors-webpack-plugin'</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-k">const</span> <span class="pl-v">OptimizeCSSPlugin</span> <span class="pl-c1">=</span> <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">'optimize-css-assets-webpack-plugin'</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-k">const</span> <span class="pl-v">PreloadWebpackPlugin</span> <span class="pl-c1">=</span> <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">'preload-webpack-plugin'</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-k">const</span> <span class="pl-kos">{</span> InjectManifest <span class="pl-kos">}</span> <span class="pl-c1">=</span> <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">'workbox-webpack-plugin'</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-k">const</span> <span class="pl-s1">autoprefixer</span> <span class="pl-c1">=</span> <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">'autoprefixer'</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-k">const</span> <span class="pl-v">ProgressBarPlugin</span> <span class="pl-c1">=</span> <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">'progress-bar-webpack-plugin'</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-k">const</span> <span class="pl-v">MiniCSSExtractPlugin</span> <span class="pl-c1">=</span> <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">'mini-css-extract-plugin'</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-k">const</span> <span class="pl-v">UglifyJsPlugin</span> <span class="pl-c1">=</span> <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">'uglifyjs-webpack-plugin'</span><span class="pl-kos">)</span>
<span class="pl-k">const</span> <span class="pl-s1">production</span> <span class="pl-c1">=</span> <span class="pl-s1">process</span><span class="pl-kos">.</span><span class="pl-c1">env</span><span class="pl-kos">.</span><span class="pl-c1">NODE_ENV</span> <span class="pl-c1">===</span> <span class="pl-s">'production'</span><span class="pl-kos">;</span>
<span class="pl-k">const</span> <span class="pl-s1">sw</span> <span class="pl-c1">=</span> <span class="pl-s1">path</span><span class="pl-kos">.</span><span class="pl-en">join</span><span class="pl-kos">(</span><span class="pl-s1">__dirname</span><span class="pl-kos">,</span> <span class="pl-s">'../src/sw.js'</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-k">const</span> <span class="pl-s1">plugins</span> <span class="pl-c1">=</span> <span class="pl-kos">[</span>
<span class="pl-k">new</span> <span class="pl-v">MiniCSSExtractPlugin</span><span class="pl-kos">(</span><span class="pl-kos">{</span>
<span class="pl-c1">filename</span>: <span class="pl-s">'[name].[contenthash].css'</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">,</span>
<span class="pl-v">ProgressBarPlugin</span><span class="pl-kos">(</span><span class="pl-kos">)</span>
<span class="pl-kos">]</span><span class="pl-kos">;</span>
<span class="pl-k">const</span> <span class="pl-s1">devServer</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span>
<span class="pl-c1">contentBase</span>: <span class="pl-s1">config</span><span class="pl-kos">.</span><span class="pl-c1">contentBase</span><span class="pl-kos">,</span>
<span class="pl-c1">hot</span>: <span class="pl-c1">true</span><span class="pl-kos">,</span>
<span class="pl-c1">hotOnly</span>: <span class="pl-c1">true</span><span class="pl-kos">,</span>
<span class="pl-c1">historyApiFallback</span>: <span class="pl-c1">true</span><span class="pl-kos">,</span>
<span class="pl-c1">port</span>: <span class="pl-s1">config</span><span class="pl-kos">.</span><span class="pl-c1">port</span><span class="pl-kos">.</span><span class="pl-c1">front</span><span class="pl-kos">,</span>
<span class="pl-c1">compress</span>: <span class="pl-s1">production</span><span class="pl-kos">,</span>
<span class="pl-c1">inline</span>: <span class="pl-c1">!</span><span class="pl-s1">production</span><span class="pl-kos">,</span>
<span class="pl-c1">hot</span>: <span class="pl-c1">!</span><span class="pl-s1">production</span><span class="pl-kos">,</span>
<span class="pl-c1">stats</span>: <span class="pl-kos">{</span>
<span class="pl-c1">assets</span>: <span class="pl-c1">true</span><span class="pl-kos">,</span>
<span class="pl-c1">children</span>: <span class="pl-c1">false</span><span class="pl-kos">,</span>
<span class="pl-c1">chunks</span>: <span class="pl-c1">false</span><span class="pl-kos">,</span>
<span class="pl-c1">hash</span>: <span class="pl-c1">true</span><span class="pl-kos">,</span>
<span class="pl-c1">modules</span>: <span class="pl-c1">false</span><span class="pl-kos">,</span>
<span class="pl-c1">publicPath</span>: <span class="pl-c1">false</span><span class="pl-kos">,</span>
<span class="pl-c1">timings</span>: <span class="pl-c1">true</span><span class="pl-kos">,</span>
<span class="pl-c1">version</span>: <span class="pl-c1">false</span><span class="pl-kos">,</span>
<span class="pl-c1">warnings</span>: <span class="pl-c1">true</span>
<span class="pl-kos">}</span>
<span class="pl-kos">}</span>
<span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-s1">production</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-s1">plugins</span><span class="pl-kos">.</span><span class="pl-en">push</span><span class="pl-kos">(</span>
<span class="pl-k">new</span> <span class="pl-s1">webpack</span><span class="pl-kos">.</span><span class="pl-c1">optimize</span><span class="pl-kos">.</span><span class="pl-c1">OccurrenceOrderPlugin</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">,</span>
<span class="pl-k">new</span> <span class="pl-s1">htmlWebpackPlugin</span><span class="pl-kos">(</span><span class="pl-kos">{</span>
<span class="pl-c1">template</span>: <span class="pl-s1">config</span><span class="pl-kos">.</span><span class="pl-c1">template</span><span class="pl-kos">,</span>
<span class="pl-c1">minify</span>: <span class="pl-kos">{</span>
<span class="pl-c1">removeComments</span>: <span class="pl-c1">true</span>
<span class="pl-kos">}</span><span class="pl-kos">,</span>
<span class="pl-c">//cache: true,</span>
<span class="pl-c">// make it work consistently with multiple chunks</span>
<span class="pl-c1">chunksSortMode</span>: <span class="pl-s">'dependency'</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">,</span>
<span class="pl-c">// preload main bundles</span>
<span class="pl-c">// prefetch should be done with webpack</span>
<span class="pl-c">// when native support for prefetch will land</span>
<span class="pl-k">new</span> <span class="pl-v">PreloadWebpackPlugin</span><span class="pl-kos">(</span><span class="pl-kos">{</span>
<span class="pl-c1">rel</span>: <span class="pl-s">'preload'</span><span class="pl-kos">,</span>
<span class="pl-c1">include</span>: <span class="pl-s">'initial'</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">,</span>
<span class="pl-c">// new TidyHtmlWebpackPlugin(),</span>
<span class="pl-k">new</span> <span class="pl-v">CopyWebpackPlugin</span><span class="pl-kos">(</span><span class="pl-kos">[</span>
<span class="pl-kos">{</span>
<span class="pl-c1">from</span>: <span class="pl-s1">path</span><span class="pl-kos">.</span><span class="pl-en">resolve</span><span class="pl-kos">(</span><span class="pl-s1">__dirname</span><span class="pl-kos">,</span> <span class="pl-s">'../src/assets/'</span><span class="pl-kos">)</span><span class="pl-kos">,</span>
<span class="pl-c1">to</span>: <span class="pl-s1">path</span><span class="pl-kos">.</span><span class="pl-en">resolve</span><span class="pl-kos">(</span><span class="pl-s1">__dirname</span><span class="pl-kos">,</span> <span class="pl-s">'../dist/assets/'</span><span class="pl-kos">)</span>
<span class="pl-kos">}</span><span class="pl-kos">,</span>
<span class="pl-kos">{</span>
<span class="pl-c1">from</span>: <span class="pl-s1">path</span><span class="pl-kos">.</span><span class="pl-en">resolve</span><span class="pl-kos">(</span><span class="pl-s1">__dirname</span><span class="pl-kos">,</span> <span class="pl-s">'../src/manifest.json'</span><span class="pl-kos">)</span><span class="pl-kos">,</span>
<span class="pl-c1">to</span>: <span class="pl-s1">path</span><span class="pl-kos">.</span><span class="pl-en">resolve</span><span class="pl-kos">(</span><span class="pl-s1">__dirname</span><span class="pl-kos">,</span> <span class="pl-s">'../dist/manifest.json'</span><span class="pl-kos">)</span>
<span class="pl-kos">}</span><span class="pl-kos">,</span>
<span class="pl-kos">{</span>
<span class="pl-c1">from</span>: <span class="pl-s1">path</span><span class="pl-kos">.</span><span class="pl-en">resolve</span><span class="pl-kos">(</span><span class="pl-s1">__dirname</span><span class="pl-kos">,</span> <span class="pl-s">'../src/third_party/idb-keyval.min.js'</span><span class="pl-kos">)</span><span class="pl-kos">,</span>
<span class="pl-c1">to</span>: <span class="pl-s1">path</span><span class="pl-kos">.</span><span class="pl-en">resolve</span><span class="pl-kos">(</span><span class="pl-s1">__dirname</span><span class="pl-kos">,</span> <span class="pl-s">'../dist/third_party/idb-keyval.min.js'</span><span class="pl-kos">)</span>
<span class="pl-kos">}</span>
<span class="pl-kos">]</span><span class="pl-kos">)</span><span class="pl-kos">,</span>
<span class="pl-k">new</span> <span class="pl-v">InjectManifest</span><span class="pl-kos">(</span><span class="pl-kos">{</span>
<span class="pl-c1">swSrc</span>: <span class="pl-s1">sw</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span>
<span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span> <span class="pl-k">else</span> <span class="pl-kos">{</span>
<span class="pl-s1">plugins</span><span class="pl-kos">.</span><span class="pl-en">push</span><span class="pl-kos">(</span>
<span class="pl-k">new</span> <span class="pl-s1">webpack</span><span class="pl-kos">.</span><span class="pl-c1">HotModuleReplacementPlugin</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">,</span> <span class="pl-c">// hot reload</span>
<span class="pl-k">new</span> <span class="pl-s1">htmlWebpackPlugin</span><span class="pl-kos">(</span><span class="pl-kos">{</span> <span class="pl-c">// generate index.html</span>
<span class="pl-c1">template</span>: <span class="pl-s1">config</span><span class="pl-kos">.</span><span class="pl-c1">template</span><span class="pl-kos">,</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">,</span>
<span class="pl-k">new</span> <span class="pl-v">FriendlyErrorsPlugin</span><span class="pl-kos">(</span><span class="pl-kos">)</span>
<span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span><span class="pl-kos">;</span>
<span class="pl-k">const</span> <span class="pl-s1">common</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span>
<span class="pl-c1">devtool</span>: <span class="pl-s1">config</span><span class="pl-kos">.</span><span class="pl-c1">devtool</span><span class="pl-kos">,</span>
<span class="pl-c1">mode</span>: <span class="pl-s1">production</span> ? <span class="pl-s">'production'</span> : <span class="pl-s">'development'</span><span class="pl-kos">,</span>
<span class="pl-c">// do not continue build if any errors</span>
<span class="pl-c1">bail</span>: <span class="pl-c1">true</span><span class="pl-kos">,</span>
<span class="pl-c">// watch mode</span>
<span class="pl-c1">watch</span>: <span class="pl-c1">!</span><span class="pl-s1">production</span><span class="pl-kos">,</span>
<span class="pl-c1">entry</span>: <span class="pl-kos">{</span>
<span class="pl-c1">app</span>: <span class="pl-s1">config</span><span class="pl-kos">.</span><span class="pl-c1">entry</span><span class="pl-kos">.</span><span class="pl-c1">front</span>
<span class="pl-kos">}</span><span class="pl-kos">,</span>
<span class="pl-c1">output</span>: <span class="pl-kos">{</span>
<span class="pl-c1">path</span>: <span class="pl-s1">path</span><span class="pl-kos">.</span><span class="pl-en">resolve</span><span class="pl-kos">(</span><span class="pl-s">'dist'</span><span class="pl-kos">)</span><span class="pl-kos">,</span>
<span class="pl-c1">filename</span>: <span class="pl-s1">production</span> ? <span class="pl-s">'[name].bundle.[hash].js'</span> : <span class="pl-s">'[name].bundle.js'</span><span class="pl-kos">,</span>
<span class="pl-c1">publicPath</span>: <span class="pl-s">'/'</span>
<span class="pl-kos">}</span><span class="pl-kos">,</span>
<span class="pl-c1">resolve</span>: <span class="pl-kos">{</span>
<span class="pl-c1">extensions</span>: <span class="pl-kos">[</span><span class="pl-s">'.js'</span><span class="pl-kos">,</span> <span class="pl-s">'.jsx'</span><span class="pl-kos">,</span> <span class="pl-s">'.css'</span><span class="pl-kos">,</span> <span class="pl-s">'.scss'</span><span class="pl-kos">]</span><span class="pl-kos">,</span>
<span class="pl-c1">alias</span>: <span class="pl-kos">{</span>
<span class="pl-c">// in order to use css-transition-group</span>
<span class="pl-c">// you have to aliase react and react-dom</span>
<span class="pl-c1">react</span>: <span class="pl-s">'preact-compat'</span><span class="pl-kos">,</span>
<span class="pl-s">'react-dom'</span>: <span class="pl-s">'preact-compat'</span><span class="pl-kos">,</span>
<span class="pl-s">'react-addons-css-transition-group'</span>: <span class="pl-s">'preact-css-transition-group'</span><span class="pl-kos">,</span>
<span class="pl-c1">components</span>: <span class="pl-s1">config</span><span class="pl-kos">.</span><span class="pl-c1">componentsPath</span><span class="pl-kos">,</span>
<span class="pl-c1">routes</span>: <span class="pl-s1">config</span><span class="pl-kos">.</span><span class="pl-c1">routesPath</span><span class="pl-kos">,</span>
<span class="pl-c1">src</span>: <span class="pl-s1">config</span><span class="pl-kos">.</span><span class="pl-c1">staticPath</span>
<span class="pl-kos">}</span>
<span class="pl-kos">}</span><span class="pl-kos">,</span>
<span class="pl-c1">module</span>: <span class="pl-kos">{</span>
<span class="pl-c1">rules</span>: <span class="pl-kos">[</span><span class="pl-kos">{</span>
<span class="pl-c1">test</span>: <span class="pl-pds"><span class="pl-c1">/</span><span class="pl-cce">\.</span><span class="pl-kos">(</span>css<span class="pl-c1">|</span>scss<span class="pl-kos">)</span><span class="pl-cce">$</span><span class="pl-c1">/</span></span><span class="pl-kos">,</span>
<span class="pl-c1">use</span>: <span class="pl-kos">[</span>
<span class="pl-v">MiniCSSExtractPlugin</span><span class="pl-kos">.</span><span class="pl-c1">loader</span><span class="pl-kos">,</span>
<span class="pl-kos">{</span>
<span class="pl-c1">loader</span>: <span class="pl-s">'css-loader'</span><span class="pl-kos">,</span> <span class="pl-c1">options</span>: <span class="pl-kos">{</span><span class="pl-c1">minimize</span>: <span class="pl-c1">true</span><span class="pl-kos">}</span>
<span class="pl-kos">}</span><span class="pl-kos">,</span>
<span class="pl-kos">{</span>
<span class="pl-c1">loader</span>: <span class="pl-s">'sass-loader'</span>
<span class="pl-kos">}</span>
<span class="pl-kos">]</span>
<span class="pl-kos">}</span><span class="pl-kos">,</span><span class="pl-kos">{</span>
<span class="pl-c1">test</span>: <span class="pl-pds"><span class="pl-c1">/</span><span class="pl-cce">\.</span><span class="pl-kos">(</span>js<span class="pl-c1">|</span>jsx<span class="pl-kos">)</span><span class="pl-cce">$</span><span class="pl-c1">/</span></span><span class="pl-kos">,</span>
<span class="pl-c1">exclude</span>: <span class="pl-pds"><span class="pl-c1">/</span>node_modules<span class="pl-c1">/</span></span><span class="pl-kos">,</span>
<span class="pl-c1">include</span>: <span class="pl-s1">path</span><span class="pl-kos">.</span><span class="pl-en">resolve</span><span class="pl-kos">(</span><span class="pl-s1">__dirname</span><span class="pl-kos">,</span> <span class="pl-s">"../src"</span><span class="pl-kos">)</span><span class="pl-kos">,</span>
<span class="pl-c1">loader</span>: <span class="pl-s">'babel-loader'</span>
<span class="pl-kos">}</span><span class="pl-kos">,</span>
<span class="pl-kos">{</span>
<span class="pl-c1">test</span>: <span class="pl-pds"><span class="pl-c1">/</span><span class="pl-cce">\.</span><span class="pl-kos">(</span>.png<span class="pl-c1">|</span>svg<span class="pl-kos">)</span><span class="pl-cce">$</span><span class="pl-c1">/</span></span><span class="pl-kos">,</span>
<span class="pl-c">// compress images</span>
<span class="pl-c1">loader</span>: <span class="pl-s">'image-webpack-loader'</span><span class="pl-kos">,</span>
<span class="pl-c">// Ensure this loader run before svg-loader or url-loader</span>
<span class="pl-c1">enforce</span>: <span class="pl-s">'pre'</span>
<span class="pl-kos">}</span><span class="pl-kos">,</span>
<span class="pl-c">// {</span>
<span class="pl-c">// test: /\.svg$/,</span>
<span class="pl-c">// loader: 'svg-url-loader',</span>
<span class="pl-c">// options: {</span>
<span class="pl-c">// // Inline image smaller than 10kb</span>
<span class="pl-c">// limit: 10 * 1024,</span>
<span class="pl-c">// // remove quotes from url</span>
<span class="pl-c">// // https://developers.google.com/web/fundamentals/performance/webpack/decrease-frontend-size</span>
<span class="pl-c">// noquotes: true</span>
<span class="pl-c">// }</span>
<span class="pl-c">// },</span>
<span class="pl-kos">{</span>
<span class="pl-c1">test</span>: <span class="pl-pds"><span class="pl-c1">/</span><span class="pl-cce">\.</span><span class="pl-kos">(</span>png<span class="pl-c1">|</span>svg<span class="pl-kos">)</span><span class="pl-cce">$</span><span class="pl-c1">/</span></span><span class="pl-kos">,</span>
<span class="pl-c1">loader</span>: <span class="pl-s1">production</span> ? <span class="pl-s">'file-loader'</span> : <span class="pl-s">'url-loader'</span><span class="pl-kos">,</span>
<span class="pl-c1">query</span>: <span class="pl-kos">{</span>
<span class="pl-c1">limit</span>: <span class="pl-c1">10</span> <span class="pl-c1">*</span> <span class="pl-c1">1024</span><span class="pl-kos">,</span>
<span class="pl-c1">name</span>: <span class="pl-s">'[name]-[hash:7].[ext]'</span>
<span class="pl-kos">}</span>
<span class="pl-kos">}</span><span class="pl-kos">]</span>
<span class="pl-kos">}</span><span class="pl-kos">,</span>
<span class="pl-c1">optimization</span>: <span class="pl-kos">{</span>
<span class="pl-c1">concatenateModules</span>: <span class="pl-s1">production</span><span class="pl-kos">,</span>
<span class="pl-c1">nodeEnv</span>: <span class="pl-s1">process</span><span class="pl-kos">.</span><span class="pl-c1">env</span><span class="pl-kos">.</span><span class="pl-c1">NODE_ENV</span><span class="pl-kos">,</span>
<span class="pl-c1">minimize</span>: <span class="pl-s1">production</span><span class="pl-kos">,</span>
<span class="pl-c">// optimization.minimizer overrides default optimization</span>
<span class="pl-c">// in webpack 4.</span>
<span class="pl-c">// plugin optimizer should be put here</span>
<span class="pl-c">// not in plugins anymore as before</span>
<span class="pl-c1">minimizer</span>: <span class="pl-kos">[</span>
<span class="pl-c">// minify js</span>
<span class="pl-k">new</span> <span class="pl-v">UglifyJsPlugin</span><span class="pl-kos">(</span><span class="pl-kos">{</span>
<span class="pl-c1">cache</span>: <span class="pl-c1">true</span><span class="pl-kos">,</span>
<span class="pl-c1">parallel</span>: <span class="pl-c1">true</span><span class="pl-kos">,</span>
<span class="pl-c1">sourceMap</span>: <span class="pl-c1">false</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">,</span>
<span class="pl-c">// Compress extracted CSS.</span>
<span class="pl-c">// Possible duplicated CSS from differents components can be deduped.</span>
<span class="pl-k">new</span> <span class="pl-v">OptimizeCSSPlugin</span><span class="pl-kos">(</span><span class="pl-kos">{</span>
<span class="pl-c1">cssProcessorOptions</span>: <span class="pl-kos">{</span>
<span class="pl-c1">safe</span>: <span class="pl-c1">true</span>
<span class="pl-kos">}</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span>
<span class="pl-kos">]</span><span class="pl-kos">,</span>
<span class="pl-c1">runtimeChunk</span>: <span class="pl-c1">true</span><span class="pl-kos">,</span>
<span class="pl-c1">splitChunks</span>: <span class="pl-kos">{</span>
<span class="pl-c1">chunks</span>: <span class="pl-s">'all'</span>
<span class="pl-kos">}</span>
<span class="pl-kos">}</span><span class="pl-kos">,</span>
<span class="pl-c1">performance</span>: <span class="pl-kos">{</span>
<span class="pl-c1">hints</span>: <span class="pl-s1">production</span> ? <span class="pl-s">'warning'</span> : <span class="pl-c1">false</span>
<span class="pl-kos">}</span><span class="pl-kos">,</span>
plugins<span class="pl-kos">,</span>
devServer
<span class="pl-kos">}</span><span class="pl-kos">;</span>
<span class="pl-smi">module</span><span class="pl-kos">.</span><span class="pl-c1">exports</span> <span class="pl-c1">=</span> <span class="pl-s1">common</span><span class="pl-kos">;</span></pre></div>
<p dir="auto"><strong>What is the expected behavior?</strong><br>
As it works in dev, it should work in prod.</p>
<p dir="auto"><strong>If this is a feature request, what is motivation or use case for changing the behavior?</strong></p>
<p dir="auto"><strong>Please mention other relevant information such as the browser version, Node.js version, webpack version, and Operating System.</strong></p> | 0 |
<p dir="auto">I have some prolem when i render script tag.<br>
Example when i click link on page A, i new render page B which i inluce demo.js file. In demo.js i console.log('Hello world'). But when i open google devtools i don't see that. What happen which that erros.</p> | <p dir="auto"><code class="notranslate">&lt;script></code> is a bit hard to use right now.</p>
<ul dir="auto">
<li>If you have a <code class="notranslate">{...}</code> then it's going to start interpolating. And you are bound to have whenever you use <code class="notranslate">if</code>, <code class="notranslate">function</code> ... Workaround: you can wrap it inside of an interpolated string <code class="notranslate">{'if (true) { ... }'}</code></li>
<li>If you have any <code class="notranslate">'</code> or <code class="notranslate">"</code> it's going to output the html encoded version and Javascript is going to throw a parsing exception.</li>
</ul>
<p dir="auto">In order to workaround those two issues the best way I found is to use dangerouslySetInnerHTML and use ES6 backtick in order to have multi-line strings.</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="<script dangerouslySetInnerHTML={{__html: `
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('send', 'pageview');
`}} />"><pre class="notranslate"><span class="pl-c1"><</span><span class="pl-ent">script</span> <span class="pl-c1">dangerouslySetInnerHTML</span><span class="pl-c1">=</span><span class="pl-kos">{</span><span class="pl-kos">{</span><span class="pl-c1">__html</span>: <span class="pl-s">`</span>
<span class="pl-s"> (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){</span>
<span class="pl-s"> (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),</span>
<span class="pl-s"> m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)</span>
<span class="pl-s"> })(window,document,'script','//www.google-analytics.com/analytics.js','ga');</span>
<span class="pl-s"> ga('send', 'pageview');</span>
<span class="pl-s">`</span><span class="pl-kos">}</span><span class="pl-kos">}</span> <span class="pl-c1">/</span><span class="pl-c1">></span></pre></div>
<p dir="auto">We should probably make it easier, it's quite a pain to use right now.</p> | 1 |
<p dir="auto">Maybe by design? Is there anyway it can work?</p> | <p dir="auto">RawKeyboardListener works for Android and other platforms, but not on iOS, because it isn't implemented in the <a href="https://github.com/flutter/flutter/blob/master/packages/flutter/lib/src/services/system_channels.dart#L158">engine</a></p>
<p dir="auto">See also <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="140066676" data-permission-text="Title is private" data-url="https://github.com/flutter/flutter/issues/2601" data-hovercard-type="issue" data-hovercard-url="/flutter/flutter/issues/2601/hovercard" href="https://github.com/flutter/flutter/issues/2601">#2601</a>, and discussion on <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="434280339" data-permission-text="Title is private" data-url="https://github.com/flutter/engine/issues/8606" data-hovercard-type="pull_request" data-hovercard-url="/flutter/engine/pull/8606/hovercard" href="https://github.com/flutter/engine/pull/8606">flutter/engine#8606</a></p> | 1 |
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have searched the <a href="https://github.com/mui-org/material-ui/issues">issues</a> of this repository and believe that this is not a duplicate.</li>
</ul>
<h2 dir="auto">Expected Behavior</h2>
<p dir="auto">When I tell a <code class="notranslate"><Tooltip /></code> to be <code class="notranslate">placement='right'</code> I expected to be placed to the right of the reference.</p>
<h2 dir="auto">Current Behavior</h2>
<p dir="auto">When I tell a <code class="notranslate"><Tooltip /></code> to be <code class="notranslate">placement='right'</code> it is placed to the left of the reference, even when visual space is available. However, it looks like when one of its parent element is positioned (via <code class="notranslate">overflow</code> css property) is causing this odd behavior.</p>
<h2 dir="auto">Steps to Reproduce (for bugs)</h2>
<ol dir="auto">
<li>Go to: <a href="https://codesandbox.io/s/x97mv2ljnq" rel="nofollow">https://codesandbox.io/s/x97mv2ljnq</a></li>
<li>Hover the button and observe the tooltip appearing on the left instead of the right.</li>
<li>Comment line 14 (<code class="notranslate">overflowX: 'auto'</code>).</li>
<li>Hover the button and observe the tooltip appearing on the right as expected.</li>
</ol>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/439839/35955846-68ce383c-0c68-11e8-881c-1be85d7d44f5.gif"><img src="https://user-images.githubusercontent.com/439839/35955846-68ce383c-0c68-11e8-881c-1be85d7d44f5.gif" alt="mui-issue" data-animated-image="" style="max-width: 100%;"></a></p>
<h2 dir="auto">Context</h2>
<p dir="auto">I need to wrap <code class="notranslate"><Table /></code>s inside <code class="notranslate">overflowX: 'auto'</code> elements to allow user to horizontal scroll the contents when the table is wider than the viewport. Therefore, I would like to be able to use the tooltip with my desired placement being in the right of the reference (which is the last column of the table).</p>
<h2 dir="auto">Your Environment</h2>
<table role="table">
<thead>
<tr>
<th>Tech</th>
<th>Version</th>
</tr>
</thead>
<tbody>
<tr>
<td>Material-UI</td>
<td>1.0.0-beta.32</td>
</tr>
<tr>
<td>React</td>
<td>16.2.0</td>
</tr>
<tr>
<td>browser</td>
<td>Chrome Version 64.0.3282.140 (Official Build) (64-bit)</td>
</tr>
</tbody>
</table>
<h2 dir="auto">Related:</h2>
<ul dir="auto">
<li><a href="https://github.com/FezVrasta/popper.js/issues/535" data-hovercard-type="issue" data-hovercard-url="/floating-ui/floating-ui/issues/535/hovercard">Wrong positioning when overflow-y:hidden is used on parent</a></li>
</ul> | <p dir="auto">I have a tooltip for a list item on collapsed drawer and it does not show up because of the overflow hidden of the drawer. I basically want a portaled version of the tooltip.<br>
I've hacked together this working example where I wrapped the popper inside a portal component from your internal folder.</p>
<h2 dir="auto">Current Behavior</h2>
<p dir="auto">tooltip is hidden and will not show up</p>
<table role="table">
<thead>
<tr>
<th>Tech</th>
<th>Version</th>
</tr>
</thead>
<tbody>
<tr>
<td>Material-UI</td>
<td>1.0.0-beta.22</td>
</tr>
<tr>
<td>React</td>
<td>16.2.0</td>
</tr>
</tbody>
</table>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import React, { Children } from 'react'
import { findDOMNode } from 'react-dom'
import EventListener from 'react-event-listener'
import debounce from 'lodash/debounce'
import warning from 'warning'
import classNames from 'classnames'
import { Manager, Target, Popper } from 'react-popper'
import { capitalizeFirstLetter } from 'material-ui/utils/helpers'
import common from 'material-ui/colors/common'
import grey from 'material-ui/colors/grey'
import withStyles from 'material-ui/styles/withStyles'
import Portal from 'material-ui/internal/Portal'
// Use a class component so we can get a reference.
class TargetChildren extends React.Component {
render() {
return this.props.element
}
}
export const styles = (theme: Object) => ({
root: {
display: 'inline',
flexDirection: 'inherit', // Makes the wrapper more transparent.
},
popper: {
zIndex: theme.zIndex.tooltip,
},
popperClose: {
pointerEvents: 'none',
},
tooltip: {
background: grey[700],
borderRadius: 2,
color: common.fullWhite,
fontFamily: theme.typography.fontFamily,
fontSize: theme.typography.pxToRem(14),
minHeight: theme.spacing.unit * 4,
lineHeight: '32px',
opacity: 0,
padding: `0 ${theme.spacing.unit}px`,
transform: 'scale(0)',
transition: theme.transitions.create(['opacity', 'transform'], {
duration: theme.transitions.duration.shortest,
}),
[theme.breakpoints.up('sm')]: {
minHeight: 22,
lineHeight: '22px',
padding: `0 ${theme.spacing.unit}px`,
fontSize: theme.typography.pxToRem(10),
},
},
tooltipLeft: {
transformOrigin: 'right center',
margin: `0 ${theme.spacing.unit * 3}px`,
[theme.breakpoints.up('sm')]: {
margin: '0 14px',
},
},
tooltipRight: {
transformOrigin: 'left center',
margin: `0 ${theme.spacing.unit * 3}px`,
[theme.breakpoints.up('sm')]: {
margin: '0 14px',
},
},
tooltipTop: {
transformOrigin: 'center bottom',
margin: `${theme.spacing.unit * 3}px 0`,
[theme.breakpoints.up('sm')]: {
margin: '14px 0',
},
},
tooltipBottom: {
transformOrigin: 'center top',
margin: `${theme.spacing.unit * 3}px 0`,
[theme.breakpoints.up('sm')]: {
margin: '14px 0',
},
},
tooltipOpen: {
opacity: 0.9,
transform: 'scale(1)',
},
})
function flipPlacement(placement) {
switch (placement) {
case 'bottom-end':
return 'bottom-start'
case 'bottom-start':
return 'bottom-end'
case 'top-end':
return 'top-start'
case 'top-start':
return 'top-end'
default:
return placement
}
}
class Tooltip extends React.Component {
static defaultProps = {
disableTriggerFocus: false,
disableTriggerHover: false,
disableTriggerTouch: false,
enterDelay: 0,
leaveDelay: 0,
placement: 'bottom',
}
state = {}
componentWillMount() {
const { props } = this
this.isControlled = props.open !== undefined
if (!this.isControlled) {
// not controlled, use internal state
this.setState({
open: false,
})
}
}
componentDidMount() {
warning(
!this.children ||
!this.children.disabled ||
// $FlowFixMe
!this.children.tagName.toLowerCase() === 'button',
[
'Material-UI: you are providing a disabled button children to the Tooltip component.',
'A disabled element do not fire events.',
'But the Tooltip needs to listen to the children element events to display the title.',
'',
'Place a `div` over top of the element.',
].join('\n')
)
}
componentWillUnmount() {
clearTimeout(this.enterTimer)
clearTimeout(this.leaveTimer)
this.handleResize.cancel()
}
enterTimer = null
leaveTimer = null
touchTimer = null
isControlled = null
popper = null
children = null
ignoreNonTouchEvents = false
handleResize = debounce(() => {
if (this.popper) {
this.popper._popper.scheduleUpdate()
}
}, 166)
handleRequestOpen = event => {
const { children } = this.props
if (typeof children !== 'string') {
const childrenProps = Children.only(children).props
if (event.type === 'focus' && childrenProps.onFocus) {
childrenProps.onFocus(event)
}
if (event.type === 'mouseover' && childrenProps.onMouseOver) {
childrenProps.onMouseOver(event)
}
}
if (this.ignoreNonTouchEvents && event.type !== 'touchstart') {
return
}
clearTimeout(this.leaveTimer)
if (this.props.enterDelay > 0) {
this.leaveTimer = setTimeout(() => {
this.requestOpen(event)
}, this.props.enterDelay)
} else {
this.requestOpen(event)
}
}
requestOpen = event => {
if (!this.isControlled) {
this.setState({ open: true })
}
if (this.props.onRequestOpen) {
this.props.onRequestOpen(event, true)
}
}
handleRequestClose = event => {
const { children } = this.props
if (typeof children !== 'string') {
const childrenProps = Children.only(children).props
if (event.type === 'blur' && childrenProps.onBlur) {
childrenProps.onBlur(event)
}
if (event.type === 'mouseleave' && childrenProps.onMouseLeave) {
childrenProps.onMouseLeave(event)
}
}
clearTimeout(this.leaveTimer)
if (this.props.leaveDelay) {
this.leaveTimer = setTimeout(() => {
this.requestClose(event)
}, this.props.leaveDelay)
} else {
this.requestClose(event)
}
}
requestClose = event => {
this.ignoreNonTouchEvents = false
if (!this.isControlled) {
this.setState({ open: false })
}
if (this.props.onRequestClose) {
this.props.onRequestClose(event, false)
}
}
handleTouchStart = event => {
this.ignoreNonTouchEvents = true
const { children } = this.props
if (typeof children !== 'string') {
const childrenProps = Children.only(children).props
if (childrenProps.onTouchStart) {
childrenProps.onTouchStart(event)
}
}
clearTimeout(this.touchTimer)
event.persist()
this.touchTimer = setTimeout(() => {
this.handleRequestOpen(event)
}, 1e3)
}
handleTouchEnd = event => {
const { children } = this.props
if (typeof children !== 'string') {
const childrenProps = Children.only(children).props
if (childrenProps.onTouchEnd) {
childrenProps.onTouchEnd(event)
}
}
clearTimeout(this.touchTimer)
clearTimeout(this.leaveTimer)
event.persist()
this.leaveTimer = setTimeout(() => {
this.requestClose(event)
}, 1500 + this.props.leaveDelay)
}
render() {
const {
children: childrenProp,
classes,
className,
disableTriggerFocus,
disableTriggerHover,
disableTriggerTouch,
enterDelay,
id,
leaveDelay,
open: openProp,
onRequestClose,
onRequestOpen,
theme,
title,
placement: rawPlacement,
PopperProps: { PopperClassName, ...PopperOther } = {},
...other
} = this.props
const themeDirection = theme && theme.direction
const placement = themeDirection === 'rtl' ? flipPlacement(rawPlacement) : rawPlacement
const open = this.isControlled ? openProp : this.state.open
const childrenProps = {}
childrenProps['aria-describedby'] = id
if (!disableTriggerTouch) {
childrenProps.onTouchStart = this.handleTouchStart
childrenProps.onTouchEnd = this.handleTouchEnd
}
if (!disableTriggerHover) {
childrenProps.onMouseOver = this.handleRequestOpen
childrenProps.onMouseLeave = this.handleRequestClose
}
if (!disableTriggerFocus) {
childrenProps.onFocus = this.handleRequestOpen
childrenProps.onBlur = this.handleRequestClose
}
if (typeof childrenProp !== 'string' && childrenProp.props) {
warning(
!childrenProp.props.title,
[
'Material-UI: you have been providing a `title` property to the child of <Tooltip />.',
`Remove this title property \`${childrenProp.props.title}\` or the Tooltip component.`,
].join('\n')
)
}
return (
<EventListener target="window" onResize={this.handleResize}>
<Manager className={classNames(classes.root, className)} {...other}>
<Target>
{({ targetProps }) => (
<TargetChildren
element={
typeof childrenProp !== 'string'
? React.cloneElement(childrenProp, childrenProps)
: childrenProp
}
ref={node => {
this.children = findDOMNode(node)
targetProps.ref(this.children)
}}
/>
)}
</Target>
<Portal open={open}>
<Popper
placement={placement}
eventsEnabled={open}
className={classNames(
classes.popper,
{ [classes.popperClose]: !open },
PopperClassName
)}
{...PopperOther}
ref={node => {
this.popper = node
}}>
{({ popperProps, restProps }) => (
<div
{...popperProps}
{...restProps}
style={{
...popperProps.style,
left: popperProps.style.left || 0,
...restProps.style,
}}>
<div
id={id}
role="tooltip"
aria-hidden={!open}
className={classNames(
classes.tooltip,
{ [classes.tooltipOpen]: open },
classes[`tooltip${capitalizeFirstLetter(placement.split('-')[0])}`]
)}>
{title}
</div>
</div>
)}
</Popper>
</Portal>
</Manager>
</EventListener>
)
}
}
export default withStyles(styles, { name: 'MuiTooltip', withTheme: true })(Tooltip)
"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-v">React</span><span class="pl-kos">,</span> <span class="pl-kos">{</span> <span class="pl-v">Children</span> <span class="pl-kos">}</span> <span class="pl-k">from</span> <span class="pl-s">'react'</span>
<span class="pl-k">import</span> <span class="pl-kos">{</span> <span class="pl-s1">findDOMNode</span> <span class="pl-kos">}</span> <span class="pl-k">from</span> <span class="pl-s">'react-dom'</span>
<span class="pl-k">import</span> <span class="pl-v">EventListener</span> <span class="pl-k">from</span> <span class="pl-s">'react-event-listener'</span>
<span class="pl-k">import</span> <span class="pl-s1">debounce</span> <span class="pl-k">from</span> <span class="pl-s">'lodash/debounce'</span>
<span class="pl-k">import</span> <span class="pl-s1">warning</span> <span class="pl-k">from</span> <span class="pl-s">'warning'</span>
<span class="pl-k">import</span> <span class="pl-s1">classNames</span> <span class="pl-k">from</span> <span class="pl-s">'classnames'</span>
<span class="pl-k">import</span> <span class="pl-kos">{</span> <span class="pl-v">Manager</span><span class="pl-kos">,</span> <span class="pl-v">Target</span><span class="pl-kos">,</span> <span class="pl-v">Popper</span> <span class="pl-kos">}</span> <span class="pl-k">from</span> <span class="pl-s">'react-popper'</span>
<span class="pl-k">import</span> <span class="pl-kos">{</span> <span class="pl-s1">capitalizeFirstLetter</span> <span class="pl-kos">}</span> <span class="pl-k">from</span> <span class="pl-s">'material-ui/utils/helpers'</span>
<span class="pl-k">import</span> <span class="pl-s1">common</span> <span class="pl-k">from</span> <span class="pl-s">'material-ui/colors/common'</span>
<span class="pl-k">import</span> <span class="pl-s1">grey</span> <span class="pl-k">from</span> <span class="pl-s">'material-ui/colors/grey'</span>
<span class="pl-k">import</span> <span class="pl-s1">withStyles</span> <span class="pl-k">from</span> <span class="pl-s">'material-ui/styles/withStyles'</span>
<span class="pl-k">import</span> <span class="pl-v">Portal</span> <span class="pl-k">from</span> <span class="pl-s">'material-ui/internal/Portal'</span>
<span class="pl-c">// Use a class component so we can get a reference.</span>
<span class="pl-k">class</span> <span class="pl-v">TargetChildren</span> <span class="pl-k">extends</span> <span class="pl-v">React</span><span class="pl-kos">.</span><span class="pl-c1">Component</span> <span class="pl-kos">{</span>
<span class="pl-en">render</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-k">return</span> <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">props</span><span class="pl-kos">.</span><span class="pl-c1">element</span>
<span class="pl-kos">}</span>
<span class="pl-kos">}</span>
<span class="pl-k">export</span> <span class="pl-k">const</span> <span class="pl-en">styles</span> <span class="pl-c1">=</span> <span class="pl-kos">(</span><span class="pl-s1">theme</span>: <span class="pl-v">Object</span><span class="pl-kos">)</span> <span class="pl-c1">=></span> <span class="pl-kos">(</span><span class="pl-kos">{</span>
<span class="pl-c1">root</span>: <span class="pl-kos">{</span>
<span class="pl-c1">display</span>: <span class="pl-s">'inline'</span><span class="pl-kos">,</span>
<span class="pl-c1">flexDirection</span>: <span class="pl-s">'inherit'</span><span class="pl-kos">,</span> <span class="pl-c">// Makes the wrapper more transparent.</span>
<span class="pl-kos">}</span><span class="pl-kos">,</span>
<span class="pl-c1">popper</span>: <span class="pl-kos">{</span>
<span class="pl-c1">zIndex</span>: <span class="pl-s1">theme</span><span class="pl-kos">.</span><span class="pl-c1">zIndex</span><span class="pl-kos">.</span><span class="pl-c1">tooltip</span><span class="pl-kos">,</span>
<span class="pl-kos">}</span><span class="pl-kos">,</span>
<span class="pl-c1">popperClose</span>: <span class="pl-kos">{</span>
<span class="pl-c1">pointerEvents</span>: <span class="pl-s">'none'</span><span class="pl-kos">,</span>
<span class="pl-kos">}</span><span class="pl-kos">,</span>
<span class="pl-c1">tooltip</span>: <span class="pl-kos">{</span>
<span class="pl-c1">background</span>: <span class="pl-s1">grey</span><span class="pl-kos">[</span><span class="pl-c1">700</span><span class="pl-kos">]</span><span class="pl-kos">,</span>
<span class="pl-c1">borderRadius</span>: <span class="pl-c1">2</span><span class="pl-kos">,</span>
<span class="pl-c1">color</span>: <span class="pl-s1">common</span><span class="pl-kos">.</span><span class="pl-c1">fullWhite</span><span class="pl-kos">,</span>
<span class="pl-c1">fontFamily</span>: <span class="pl-s1">theme</span><span class="pl-kos">.</span><span class="pl-c1">typography</span><span class="pl-kos">.</span><span class="pl-c1">fontFamily</span><span class="pl-kos">,</span>
<span class="pl-c1">fontSize</span>: <span class="pl-s1">theme</span><span class="pl-kos">.</span><span class="pl-c1">typography</span><span class="pl-kos">.</span><span class="pl-en">pxToRem</span><span class="pl-kos">(</span><span class="pl-c1">14</span><span class="pl-kos">)</span><span class="pl-kos">,</span>
<span class="pl-c1">minHeight</span>: <span class="pl-s1">theme</span><span class="pl-kos">.</span><span class="pl-c1">spacing</span><span class="pl-kos">.</span><span class="pl-c1">unit</span> <span class="pl-c1">*</span> <span class="pl-c1">4</span><span class="pl-kos">,</span>
<span class="pl-c1">lineHeight</span>: <span class="pl-s">'32px'</span><span class="pl-kos">,</span>
<span class="pl-c1">opacity</span>: <span class="pl-c1">0</span><span class="pl-kos">,</span>
<span class="pl-c1">padding</span>: <span class="pl-s">`0 <span class="pl-s1"><span class="pl-kos">${</span><span class="pl-s1">theme</span><span class="pl-kos">.</span><span class="pl-c1">spacing</span><span class="pl-kos">.</span><span class="pl-c1">unit</span><span class="pl-kos">}</span></span>px`</span><span class="pl-kos">,</span>
<span class="pl-c1">transform</span>: <span class="pl-s">'scale(0)'</span><span class="pl-kos">,</span>
<span class="pl-c1">transition</span>: <span class="pl-s1">theme</span><span class="pl-kos">.</span><span class="pl-c1">transitions</span><span class="pl-kos">.</span><span class="pl-en">create</span><span class="pl-kos">(</span><span class="pl-kos">[</span><span class="pl-s">'opacity'</span><span class="pl-kos">,</span> <span class="pl-s">'transform'</span><span class="pl-kos">]</span><span class="pl-kos">,</span> <span class="pl-kos">{</span>
<span class="pl-c1">duration</span>: <span class="pl-s1">theme</span><span class="pl-kos">.</span><span class="pl-c1">transitions</span><span class="pl-kos">.</span><span class="pl-c1">duration</span><span class="pl-kos">.</span><span class="pl-c1">shortest</span><span class="pl-kos">,</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">,</span>
<span class="pl-kos">[</span><span class="pl-s1">theme</span><span class="pl-kos">.</span><span class="pl-c1">breakpoints</span><span class="pl-kos">.</span><span class="pl-en">up</span><span class="pl-kos">(</span><span class="pl-s">'sm'</span><span class="pl-kos">)</span><span class="pl-kos">]</span>: <span class="pl-kos">{</span>
<span class="pl-c1">minHeight</span>: <span class="pl-c1">22</span><span class="pl-kos">,</span>
<span class="pl-c1">lineHeight</span>: <span class="pl-s">'22px'</span><span class="pl-kos">,</span>
<span class="pl-c1">padding</span>: <span class="pl-s">`0 <span class="pl-s1"><span class="pl-kos">${</span><span class="pl-s1">theme</span><span class="pl-kos">.</span><span class="pl-c1">spacing</span><span class="pl-kos">.</span><span class="pl-c1">unit</span><span class="pl-kos">}</span></span>px`</span><span class="pl-kos">,</span>
<span class="pl-c1">fontSize</span>: <span class="pl-s1">theme</span><span class="pl-kos">.</span><span class="pl-c1">typography</span><span class="pl-kos">.</span><span class="pl-en">pxToRem</span><span class="pl-kos">(</span><span class="pl-c1">10</span><span class="pl-kos">)</span><span class="pl-kos">,</span>
<span class="pl-kos">}</span><span class="pl-kos">,</span>
<span class="pl-kos">}</span><span class="pl-kos">,</span>
<span class="pl-c1">tooltipLeft</span>: <span class="pl-kos">{</span>
<span class="pl-c1">transformOrigin</span>: <span class="pl-s">'right center'</span><span class="pl-kos">,</span>
<span class="pl-c1">margin</span>: <span class="pl-s">`0 <span class="pl-s1"><span class="pl-kos">${</span><span class="pl-s1">theme</span><span class="pl-kos">.</span><span class="pl-c1">spacing</span><span class="pl-kos">.</span><span class="pl-c1">unit</span> <span class="pl-c1">*</span> <span class="pl-c1">3</span><span class="pl-kos">}</span></span>px`</span><span class="pl-kos">,</span>
<span class="pl-kos">[</span><span class="pl-s1">theme</span><span class="pl-kos">.</span><span class="pl-c1">breakpoints</span><span class="pl-kos">.</span><span class="pl-en">up</span><span class="pl-kos">(</span><span class="pl-s">'sm'</span><span class="pl-kos">)</span><span class="pl-kos">]</span>: <span class="pl-kos">{</span>
<span class="pl-c1">margin</span>: <span class="pl-s">'0 14px'</span><span class="pl-kos">,</span>
<span class="pl-kos">}</span><span class="pl-kos">,</span>
<span class="pl-kos">}</span><span class="pl-kos">,</span>
<span class="pl-c1">tooltipRight</span>: <span class="pl-kos">{</span>
<span class="pl-c1">transformOrigin</span>: <span class="pl-s">'left center'</span><span class="pl-kos">,</span>
<span class="pl-c1">margin</span>: <span class="pl-s">`0 <span class="pl-s1"><span class="pl-kos">${</span><span class="pl-s1">theme</span><span class="pl-kos">.</span><span class="pl-c1">spacing</span><span class="pl-kos">.</span><span class="pl-c1">unit</span> <span class="pl-c1">*</span> <span class="pl-c1">3</span><span class="pl-kos">}</span></span>px`</span><span class="pl-kos">,</span>
<span class="pl-kos">[</span><span class="pl-s1">theme</span><span class="pl-kos">.</span><span class="pl-c1">breakpoints</span><span class="pl-kos">.</span><span class="pl-en">up</span><span class="pl-kos">(</span><span class="pl-s">'sm'</span><span class="pl-kos">)</span><span class="pl-kos">]</span>: <span class="pl-kos">{</span>
<span class="pl-c1">margin</span>: <span class="pl-s">'0 14px'</span><span class="pl-kos">,</span>
<span class="pl-kos">}</span><span class="pl-kos">,</span>
<span class="pl-kos">}</span><span class="pl-kos">,</span>
<span class="pl-c1">tooltipTop</span>: <span class="pl-kos">{</span>
<span class="pl-c1">transformOrigin</span>: <span class="pl-s">'center bottom'</span><span class="pl-kos">,</span>
<span class="pl-c1">margin</span>: <span class="pl-s">`<span class="pl-s1"><span class="pl-kos">${</span><span class="pl-s1">theme</span><span class="pl-kos">.</span><span class="pl-c1">spacing</span><span class="pl-kos">.</span><span class="pl-c1">unit</span> <span class="pl-c1">*</span> <span class="pl-c1">3</span><span class="pl-kos">}</span></span>px 0`</span><span class="pl-kos">,</span>
<span class="pl-kos">[</span><span class="pl-s1">theme</span><span class="pl-kos">.</span><span class="pl-c1">breakpoints</span><span class="pl-kos">.</span><span class="pl-en">up</span><span class="pl-kos">(</span><span class="pl-s">'sm'</span><span class="pl-kos">)</span><span class="pl-kos">]</span>: <span class="pl-kos">{</span>
<span class="pl-c1">margin</span>: <span class="pl-s">'14px 0'</span><span class="pl-kos">,</span>
<span class="pl-kos">}</span><span class="pl-kos">,</span>
<span class="pl-kos">}</span><span class="pl-kos">,</span>
<span class="pl-c1">tooltipBottom</span>: <span class="pl-kos">{</span>
<span class="pl-c1">transformOrigin</span>: <span class="pl-s">'center top'</span><span class="pl-kos">,</span>
<span class="pl-c1">margin</span>: <span class="pl-s">`<span class="pl-s1"><span class="pl-kos">${</span><span class="pl-s1">theme</span><span class="pl-kos">.</span><span class="pl-c1">spacing</span><span class="pl-kos">.</span><span class="pl-c1">unit</span> <span class="pl-c1">*</span> <span class="pl-c1">3</span><span class="pl-kos">}</span></span>px 0`</span><span class="pl-kos">,</span>
<span class="pl-kos">[</span><span class="pl-s1">theme</span><span class="pl-kos">.</span><span class="pl-c1">breakpoints</span><span class="pl-kos">.</span><span class="pl-en">up</span><span class="pl-kos">(</span><span class="pl-s">'sm'</span><span class="pl-kos">)</span><span class="pl-kos">]</span>: <span class="pl-kos">{</span>
<span class="pl-c1">margin</span>: <span class="pl-s">'14px 0'</span><span class="pl-kos">,</span>
<span class="pl-kos">}</span><span class="pl-kos">,</span>
<span class="pl-kos">}</span><span class="pl-kos">,</span>
<span class="pl-c1">tooltipOpen</span>: <span class="pl-kos">{</span>
<span class="pl-c1">opacity</span>: <span class="pl-c1">0.9</span><span class="pl-kos">,</span>
<span class="pl-c1">transform</span>: <span class="pl-s">'scale(1)'</span><span class="pl-kos">,</span>
<span class="pl-kos">}</span><span class="pl-kos">,</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span>
<span class="pl-k">function</span> <span class="pl-en">flipPlacement</span><span class="pl-kos">(</span><span class="pl-s1">placement</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-k">switch</span> <span class="pl-kos">(</span><span class="pl-s1">placement</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-k">case</span> <span class="pl-s">'bottom-end'</span>:
<span class="pl-k">return</span> <span class="pl-s">'bottom-start'</span>
<span class="pl-k">case</span> <span class="pl-s">'bottom-start'</span>:
<span class="pl-k">return</span> <span class="pl-s">'bottom-end'</span>
<span class="pl-k">case</span> <span class="pl-s">'top-end'</span>:
<span class="pl-k">return</span> <span class="pl-s">'top-start'</span>
<span class="pl-k">case</span> <span class="pl-s">'top-start'</span>:
<span class="pl-k">return</span> <span class="pl-s">'top-end'</span>
<span class="pl-k">default</span>:
<span class="pl-k">return</span> <span class="pl-s1">placement</span>
<span class="pl-kos">}</span>
<span class="pl-kos">}</span>
<span class="pl-k">class</span> <span class="pl-v">Tooltip</span> <span class="pl-k">extends</span> <span class="pl-v">React</span><span class="pl-kos">.</span><span class="pl-c1">Component</span> <span class="pl-kos">{</span>
<span class="pl-k">static</span> <span class="pl-c1">defaultProps</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span>
<span class="pl-c1">disableTriggerFocus</span>: <span class="pl-c1">false</span><span class="pl-kos">,</span>
<span class="pl-c1">disableTriggerHover</span>: <span class="pl-c1">false</span><span class="pl-kos">,</span>
<span class="pl-c1">disableTriggerTouch</span>: <span class="pl-c1">false</span><span class="pl-kos">,</span>
<span class="pl-c1">enterDelay</span>: <span class="pl-c1">0</span><span class="pl-kos">,</span>
<span class="pl-c1">leaveDelay</span>: <span class="pl-c1">0</span><span class="pl-kos">,</span>
<span class="pl-c1">placement</span>: <span class="pl-s">'bottom'</span><span class="pl-kos">,</span>
<span class="pl-kos">}</span>
<span class="pl-c1">state</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span><span class="pl-kos">}</span>
<span class="pl-en">componentWillMount</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-k">const</span> <span class="pl-kos">{</span> props <span class="pl-kos">}</span> <span class="pl-c1">=</span> <span class="pl-smi">this</span>
<span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">isControlled</span> <span class="pl-c1">=</span> <span class="pl-s1">props</span><span class="pl-kos">.</span><span class="pl-c1">open</span> <span class="pl-c1">!==</span> <span class="pl-c1">undefined</span>
<span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-c1">!</span><span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">isControlled</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-c">// not controlled, use internal state</span>
<span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-en">setState</span><span class="pl-kos">(</span><span class="pl-kos">{</span>
<span class="pl-c1">open</span>: <span class="pl-c1">false</span><span class="pl-kos">,</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span>
<span class="pl-kos">}</span>
<span class="pl-kos">}</span>
<span class="pl-en">componentDidMount</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-en">warning</span><span class="pl-kos">(</span>
<span class="pl-c1">!</span><span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">children</span> <span class="pl-c1">||</span>
<span class="pl-c1">!</span><span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">children</span><span class="pl-kos">.</span><span class="pl-c1">disabled</span> <span class="pl-c1">||</span>
<span class="pl-c">// $FlowFixMe</span>
<span class="pl-c1">!</span><span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">children</span><span class="pl-kos">.</span><span class="pl-c1">tagName</span><span class="pl-kos">.</span><span class="pl-en">toLowerCase</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">===</span> <span class="pl-s">'button'</span><span class="pl-kos">,</span>
<span class="pl-kos">[</span>
<span class="pl-s">'Material-UI: you are providing a disabled button children to the Tooltip component.'</span><span class="pl-kos">,</span>
<span class="pl-s">'A disabled element do not fire events.'</span><span class="pl-kos">,</span>
<span class="pl-s">'But the Tooltip needs to listen to the children element events to display the title.'</span><span class="pl-kos">,</span>
<span class="pl-s">''</span><span class="pl-kos">,</span>
<span class="pl-s">'Place a `div` over top of the element.'</span><span class="pl-kos">,</span>
<span class="pl-kos">]</span><span class="pl-kos">.</span><span class="pl-en">join</span><span class="pl-kos">(</span><span class="pl-s">'\n'</span><span class="pl-kos">)</span>
<span class="pl-kos">)</span>
<span class="pl-kos">}</span>
<span class="pl-en">componentWillUnmount</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-en">clearTimeout</span><span class="pl-kos">(</span><span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">enterTimer</span><span class="pl-kos">)</span>
<span class="pl-en">clearTimeout</span><span class="pl-kos">(</span><span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">leaveTimer</span><span class="pl-kos">)</span>
<span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">handleResize</span><span class="pl-kos">.</span><span class="pl-en">cancel</span><span class="pl-kos">(</span><span class="pl-kos">)</span>
<span class="pl-kos">}</span>
<span class="pl-c1">enterTimer</span> <span class="pl-c1">=</span> <span class="pl-c1">null</span>
<span class="pl-c1">leaveTimer</span> <span class="pl-c1">=</span> <span class="pl-c1">null</span>
<span class="pl-c1">touchTimer</span> <span class="pl-c1">=</span> <span class="pl-c1">null</span>
<span class="pl-c1">isControlled</span> <span class="pl-c1">=</span> <span class="pl-c1">null</span>
<span class="pl-c1">popper</span> <span class="pl-c1">=</span> <span class="pl-c1">null</span>
<span class="pl-c1">children</span> <span class="pl-c1">=</span> <span class="pl-c1">null</span>
<span class="pl-c1">ignoreNonTouchEvents</span> <span class="pl-c1">=</span> <span class="pl-c1">false</span>
<span class="pl-c1">handleResize</span> <span class="pl-c1">=</span> <span class="pl-en">debounce</span><span class="pl-kos">(</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">=></span> <span class="pl-kos">{</span>
<span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">popper</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">popper</span><span class="pl-kos">.</span><span class="pl-c1">_popper</span><span class="pl-kos">.</span><span class="pl-en">scheduleUpdate</span><span class="pl-kos">(</span><span class="pl-kos">)</span>
<span class="pl-kos">}</span>
<span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-c1">166</span><span class="pl-kos">)</span>
<span class="pl-c1">handleRequestOpen</span> <span class="pl-c1">=</span> <span class="pl-s1">event</span> <span class="pl-c1">=></span> <span class="pl-kos">{</span>
<span class="pl-k">const</span> <span class="pl-kos">{</span> children <span class="pl-kos">}</span> <span class="pl-c1">=</span> <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">props</span>
<span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-k">typeof</span> <span class="pl-s1">children</span> <span class="pl-c1">!==</span> <span class="pl-s">'string'</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-k">const</span> <span class="pl-s1">childrenProps</span> <span class="pl-c1">=</span> <span class="pl-v">Children</span><span class="pl-kos">.</span><span class="pl-en">only</span><span class="pl-kos">(</span><span class="pl-s1">children</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">props</span>
<span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-s1">event</span><span class="pl-kos">.</span><span class="pl-c1">type</span> <span class="pl-c1">===</span> <span class="pl-s">'focus'</span> <span class="pl-c1">&&</span> <span class="pl-s1">childrenProps</span><span class="pl-kos">.</span><span class="pl-c1">onFocus</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-s1">childrenProps</span><span class="pl-kos">.</span><span class="pl-en">onFocus</span><span class="pl-kos">(</span><span class="pl-s1">event</span><span class="pl-kos">)</span>
<span class="pl-kos">}</span>
<span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-s1">event</span><span class="pl-kos">.</span><span class="pl-c1">type</span> <span class="pl-c1">===</span> <span class="pl-s">'mouseover'</span> <span class="pl-c1">&&</span> <span class="pl-s1">childrenProps</span><span class="pl-kos">.</span><span class="pl-c1">onMouseOver</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-s1">childrenProps</span><span class="pl-kos">.</span><span class="pl-en">onMouseOver</span><span class="pl-kos">(</span><span class="pl-s1">event</span><span class="pl-kos">)</span>
<span class="pl-kos">}</span>
<span class="pl-kos">}</span>
<span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">ignoreNonTouchEvents</span> <span class="pl-c1">&&</span> <span class="pl-s1">event</span><span class="pl-kos">.</span><span class="pl-c1">type</span> <span class="pl-c1">!==</span> <span class="pl-s">'touchstart'</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-k">return</span>
<span class="pl-kos">}</span>
<span class="pl-en">clearTimeout</span><span class="pl-kos">(</span><span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">leaveTimer</span><span class="pl-kos">)</span>
<span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">props</span><span class="pl-kos">.</span><span class="pl-c1">enterDelay</span> <span class="pl-c1">></span> <span class="pl-c1">0</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">leaveTimer</span> <span class="pl-c1">=</span> <span class="pl-en">setTimeout</span><span class="pl-kos">(</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">=></span> <span class="pl-kos">{</span>
<span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-en">requestOpen</span><span class="pl-kos">(</span><span class="pl-s1">event</span><span class="pl-kos">)</span>
<span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">props</span><span class="pl-kos">.</span><span class="pl-c1">enterDelay</span><span class="pl-kos">)</span>
<span class="pl-kos">}</span> <span class="pl-k">else</span> <span class="pl-kos">{</span>
<span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-en">requestOpen</span><span class="pl-kos">(</span><span class="pl-s1">event</span><span class="pl-kos">)</span>
<span class="pl-kos">}</span>
<span class="pl-kos">}</span>
<span class="pl-c1">requestOpen</span> <span class="pl-c1">=</span> <span class="pl-s1">event</span> <span class="pl-c1">=></span> <span class="pl-kos">{</span>
<span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-c1">!</span><span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">isControlled</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-en">setState</span><span class="pl-kos">(</span><span class="pl-kos">{</span> <span class="pl-c1">open</span>: <span class="pl-c1">true</span> <span class="pl-kos">}</span><span class="pl-kos">)</span>
<span class="pl-kos">}</span>
<span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">props</span><span class="pl-kos">.</span><span class="pl-c1">onRequestOpen</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">props</span><span class="pl-kos">.</span><span class="pl-en">onRequestOpen</span><span class="pl-kos">(</span><span class="pl-s1">event</span><span class="pl-kos">,</span> <span class="pl-c1">true</span><span class="pl-kos">)</span>
<span class="pl-kos">}</span>
<span class="pl-kos">}</span>
<span class="pl-c1">handleRequestClose</span> <span class="pl-c1">=</span> <span class="pl-s1">event</span> <span class="pl-c1">=></span> <span class="pl-kos">{</span>
<span class="pl-k">const</span> <span class="pl-kos">{</span> children <span class="pl-kos">}</span> <span class="pl-c1">=</span> <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">props</span>
<span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-k">typeof</span> <span class="pl-s1">children</span> <span class="pl-c1">!==</span> <span class="pl-s">'string'</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-k">const</span> <span class="pl-s1">childrenProps</span> <span class="pl-c1">=</span> <span class="pl-v">Children</span><span class="pl-kos">.</span><span class="pl-en">only</span><span class="pl-kos">(</span><span class="pl-s1">children</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">props</span>
<span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-s1">event</span><span class="pl-kos">.</span><span class="pl-c1">type</span> <span class="pl-c1">===</span> <span class="pl-s">'blur'</span> <span class="pl-c1">&&</span> <span class="pl-s1">childrenProps</span><span class="pl-kos">.</span><span class="pl-c1">onBlur</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-s1">childrenProps</span><span class="pl-kos">.</span><span class="pl-en">onBlur</span><span class="pl-kos">(</span><span class="pl-s1">event</span><span class="pl-kos">)</span>
<span class="pl-kos">}</span>
<span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-s1">event</span><span class="pl-kos">.</span><span class="pl-c1">type</span> <span class="pl-c1">===</span> <span class="pl-s">'mouseleave'</span> <span class="pl-c1">&&</span> <span class="pl-s1">childrenProps</span><span class="pl-kos">.</span><span class="pl-c1">onMouseLeave</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-s1">childrenProps</span><span class="pl-kos">.</span><span class="pl-en">onMouseLeave</span><span class="pl-kos">(</span><span class="pl-s1">event</span><span class="pl-kos">)</span>
<span class="pl-kos">}</span>
<span class="pl-kos">}</span>
<span class="pl-en">clearTimeout</span><span class="pl-kos">(</span><span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">leaveTimer</span><span class="pl-kos">)</span>
<span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">props</span><span class="pl-kos">.</span><span class="pl-c1">leaveDelay</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">leaveTimer</span> <span class="pl-c1">=</span> <span class="pl-en">setTimeout</span><span class="pl-kos">(</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">=></span> <span class="pl-kos">{</span>
<span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-en">requestClose</span><span class="pl-kos">(</span><span class="pl-s1">event</span><span class="pl-kos">)</span>
<span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">props</span><span class="pl-kos">.</span><span class="pl-c1">leaveDelay</span><span class="pl-kos">)</span>
<span class="pl-kos">}</span> <span class="pl-k">else</span> <span class="pl-kos">{</span>
<span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-en">requestClose</span><span class="pl-kos">(</span><span class="pl-s1">event</span><span class="pl-kos">)</span>
<span class="pl-kos">}</span>
<span class="pl-kos">}</span>
<span class="pl-c1">requestClose</span> <span class="pl-c1">=</span> <span class="pl-s1">event</span> <span class="pl-c1">=></span> <span class="pl-kos">{</span>
<span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">ignoreNonTouchEvents</span> <span class="pl-c1">=</span> <span class="pl-c1">false</span>
<span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-c1">!</span><span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">isControlled</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-en">setState</span><span class="pl-kos">(</span><span class="pl-kos">{</span> <span class="pl-c1">open</span>: <span class="pl-c1">false</span> <span class="pl-kos">}</span><span class="pl-kos">)</span>
<span class="pl-kos">}</span>
<span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">props</span><span class="pl-kos">.</span><span class="pl-c1">onRequestClose</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">props</span><span class="pl-kos">.</span><span class="pl-en">onRequestClose</span><span class="pl-kos">(</span><span class="pl-s1">event</span><span class="pl-kos">,</span> <span class="pl-c1">false</span><span class="pl-kos">)</span>
<span class="pl-kos">}</span>
<span class="pl-kos">}</span>
<span class="pl-c1">handleTouchStart</span> <span class="pl-c1">=</span> <span class="pl-s1">event</span> <span class="pl-c1">=></span> <span class="pl-kos">{</span>
<span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">ignoreNonTouchEvents</span> <span class="pl-c1">=</span> <span class="pl-c1">true</span>
<span class="pl-k">const</span> <span class="pl-kos">{</span> children <span class="pl-kos">}</span> <span class="pl-c1">=</span> <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">props</span>
<span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-k">typeof</span> <span class="pl-s1">children</span> <span class="pl-c1">!==</span> <span class="pl-s">'string'</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-k">const</span> <span class="pl-s1">childrenProps</span> <span class="pl-c1">=</span> <span class="pl-v">Children</span><span class="pl-kos">.</span><span class="pl-en">only</span><span class="pl-kos">(</span><span class="pl-s1">children</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">props</span>
<span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-s1">childrenProps</span><span class="pl-kos">.</span><span class="pl-c1">onTouchStart</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-s1">childrenProps</span><span class="pl-kos">.</span><span class="pl-en">onTouchStart</span><span class="pl-kos">(</span><span class="pl-s1">event</span><span class="pl-kos">)</span>
<span class="pl-kos">}</span>
<span class="pl-kos">}</span>
<span class="pl-en">clearTimeout</span><span class="pl-kos">(</span><span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">touchTimer</span><span class="pl-kos">)</span>
<span class="pl-s1">event</span><span class="pl-kos">.</span><span class="pl-en">persist</span><span class="pl-kos">(</span><span class="pl-kos">)</span>
<span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">touchTimer</span> <span class="pl-c1">=</span> <span class="pl-en">setTimeout</span><span class="pl-kos">(</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">=></span> <span class="pl-kos">{</span>
<span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-en">handleRequestOpen</span><span class="pl-kos">(</span><span class="pl-s1">event</span><span class="pl-kos">)</span>
<span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-c1">1e3</span><span class="pl-kos">)</span>
<span class="pl-kos">}</span>
<span class="pl-c1">handleTouchEnd</span> <span class="pl-c1">=</span> <span class="pl-s1">event</span> <span class="pl-c1">=></span> <span class="pl-kos">{</span>
<span class="pl-k">const</span> <span class="pl-kos">{</span> children <span class="pl-kos">}</span> <span class="pl-c1">=</span> <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">props</span>
<span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-k">typeof</span> <span class="pl-s1">children</span> <span class="pl-c1">!==</span> <span class="pl-s">'string'</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-k">const</span> <span class="pl-s1">childrenProps</span> <span class="pl-c1">=</span> <span class="pl-v">Children</span><span class="pl-kos">.</span><span class="pl-en">only</span><span class="pl-kos">(</span><span class="pl-s1">children</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">props</span>
<span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-s1">childrenProps</span><span class="pl-kos">.</span><span class="pl-c1">onTouchEnd</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-s1">childrenProps</span><span class="pl-kos">.</span><span class="pl-en">onTouchEnd</span><span class="pl-kos">(</span><span class="pl-s1">event</span><span class="pl-kos">)</span>
<span class="pl-kos">}</span>
<span class="pl-kos">}</span>
<span class="pl-en">clearTimeout</span><span class="pl-kos">(</span><span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">touchTimer</span><span class="pl-kos">)</span>
<span class="pl-en">clearTimeout</span><span class="pl-kos">(</span><span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">leaveTimer</span><span class="pl-kos">)</span>
<span class="pl-s1">event</span><span class="pl-kos">.</span><span class="pl-en">persist</span><span class="pl-kos">(</span><span class="pl-kos">)</span>
<span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">leaveTimer</span> <span class="pl-c1">=</span> <span class="pl-en">setTimeout</span><span class="pl-kos">(</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">=></span> <span class="pl-kos">{</span>
<span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-en">requestClose</span><span class="pl-kos">(</span><span class="pl-s1">event</span><span class="pl-kos">)</span>
<span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-c1">1500</span> <span class="pl-c1">+</span> <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">props</span><span class="pl-kos">.</span><span class="pl-c1">leaveDelay</span><span class="pl-kos">)</span>
<span class="pl-kos">}</span>
<span class="pl-en">render</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-k">const</span> <span class="pl-kos">{</span>
<span class="pl-c1">children</span>: <span class="pl-s1">childrenProp</span><span class="pl-kos">,</span>
classes<span class="pl-kos">,</span>
className<span class="pl-kos">,</span>
disableTriggerFocus<span class="pl-kos">,</span>
disableTriggerHover<span class="pl-kos">,</span>
disableTriggerTouch<span class="pl-kos">,</span>
enterDelay<span class="pl-kos">,</span>
id<span class="pl-kos">,</span>
leaveDelay<span class="pl-kos">,</span>
<span class="pl-c1">open</span>: <span class="pl-s1">openProp</span><span class="pl-kos">,</span>
onRequestClose<span class="pl-kos">,</span>
onRequestOpen<span class="pl-kos">,</span>
theme<span class="pl-kos">,</span>
title<span class="pl-kos">,</span>
<span class="pl-c1">placement</span>: <span class="pl-s1">rawPlacement</span><span class="pl-kos">,</span>
<span class="pl-c1">PopperProps</span>: <span class="pl-kos">{</span> PopperClassName<span class="pl-kos">,</span> ...<span class="pl-v">PopperOther</span> <span class="pl-kos">}</span><span class="pl-kos"></span> <span class="pl-c1">=</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">,</span>
...<span class="pl-s1">other</span>
<span class="pl-kos">}</span><span class="pl-c1"></span> <span class="pl-c1">=</span> <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">props</span>
<span class="pl-c1">const</span><span class="pl-kos"></span> <span class="pl-c1">themeDirection</span> <span class="pl-c1">=</span> <span class="pl-s1">theme</span> <span class="pl-c1">&&</span> <span class="pl-s1">theme</span><span class="pl-kos">.</span><span class="pl-c1">direction</span>
<span class="pl-c1">const</span> <span class="pl-s1">placement</span> <span class="pl-c1">=</span> <span class="pl-s1">themeDirection</span> <span class="pl-c1">===</span> <span class="pl-s">'rtl'</span> ? <span class="pl-en">flipPlacement</span><span class="pl-kos">(</span><span class="pl-s1">rawPlacement</span><span class="pl-kos">)</span> : <span class="pl-s1">rawPlacement</span>
<span class="pl-c1">const</span> <span class="pl-s1">open</span> <span class="pl-c1">=</span> <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">isControlled</span> ? <span class="pl-s1">openProp</span> : <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">state</span><span class="pl-kos">.</span><span class="pl-c1">open</span>
<span class="pl-c1">const</span><span class="pl-kos"></span> <span class="pl-c1">childrenProps</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span><span class="pl-kos">}</span>
<span class="pl-c1">childrenProps</span><span class="pl-kos"></span><span class="pl-kos">[</span><span class="pl-s">'aria-describedby'</span><span class="pl-kos">]</span> <span class="pl-c1">=</span> <span class="pl-s1">id</span>
<span class="pl-en">if</span> <span class="pl-kos">(</span><span class="pl-c1">!</span><span class="pl-s1">disableTriggerTouch</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-s1">childrenProps</span><span class="pl-kos">.</span><span class="pl-c1">onTouchStart</span> <span class="pl-c1">=</span> <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">handleTouchStart</span>
<span class="pl-s1">childrenProps</span><span class="pl-kos">.</span><span class="pl-c1">onTouchEnd</span> <span class="pl-c1">=</span> <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">handleTouchEnd</span>
<span class="pl-kos">}</span>
<span class="pl-en">if</span> <span class="pl-kos">(</span><span class="pl-c1">!</span><span class="pl-s1">disableTriggerHover</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-s1">childrenProps</span><span class="pl-kos">.</span><span class="pl-c1">onMouseOver</span> <span class="pl-c1">=</span> <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">handleRequestOpen</span>
<span class="pl-s1">childrenProps</span><span class="pl-kos">.</span><span class="pl-c1">onMouseLeave</span> <span class="pl-c1">=</span> <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">handleRequestClose</span>
<span class="pl-kos">}</span>
<span class="pl-en">if</span> <span class="pl-kos">(</span><span class="pl-c1">!</span><span class="pl-s1">disableTriggerFocus</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-s1">childrenProps</span><span class="pl-kos">.</span><span class="pl-c1">onFocus</span> <span class="pl-c1">=</span> <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">handleRequestOpen</span>
<span class="pl-s1">childrenProps</span><span class="pl-kos">.</span><span class="pl-c1">onBlur</span> <span class="pl-c1">=</span> <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">handleRequestClose</span>
<span class="pl-kos">}</span>
<span class="pl-en">if</span> <span class="pl-kos">(</span><span class="pl-s1">typeof</span> <span class="pl-s1">childrenProp</span> <span class="pl-c1">!==</span> '<span class="pl-s1">string</span>' <span class="pl-c1">&&</span> <span class="pl-s1">childrenProp</span><span class="pl-kos">.</span><span class="pl-s1">props</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-en">warning</span><span class="pl-kos">(</span>
<span class="pl-c1">!</span><span class="pl-s1">childrenProp</span><span class="pl-kos">.</span><span class="pl-c1">props</span><span class="pl-kos">.</span><span class="pl-c1">title</span><span class="pl-kos">,</span>
<span class="pl-kos">[</span>
<span class="pl-s">'Material-UI: you have been providing a `title` property to the child of <Tooltip />.'</span><span class="pl-kos">,</span>
<span class="pl-s">`Remove this title property \`<span class="pl-s1"><span class="pl-kos">${</span><span class="pl-s1">childrenProp</span><span class="pl-kos">.</span><span class="pl-c1">props</span><span class="pl-kos">.</span><span class="pl-c1">title</span><span class="pl-kos">}</span></span>\` or the Tooltip component.`</span><span class="pl-kos">,</span>
<span class="pl-kos">]</span><span class="pl-kos">.</span><span class="pl-en">join</span><span class="pl-kos">(</span><span class="pl-s">'\n'</span><span class="pl-kos">)</span>
<span class="pl-kos">)</span>
<span class="pl-kos">}</span>
<span class="pl-c1">return</span> <span class="pl-kos">(</span>
<span class="pl-c1"><</span><span class="pl-v">EventListener</span> <span class="pl-s1">target</span><span class="pl-c1">=</span><span class="pl-s">"window"</span> <span class="pl-s1">onResize</span><span class="pl-c1">=</span><span class="pl-kos">{</span><span class="pl-s1">this</span><span class="pl-kos">.</span>handleResize<span class="pl-kos">}</span><span class="pl-c1">></span>
<span class="pl-c1"><</span><span class="pl-ent">Manager</span> <span class="pl-c1">className</span><span class="pl-c1">=</span><span class="pl-kos">{</span><span class="pl-en">classNames</span><span class="pl-kos">(</span><span class="pl-s1">classes</span><span class="pl-kos">.</span><span class="pl-c1">root</span><span class="pl-kos">,</span> <span class="pl-s1">className</span><span class="pl-kos">)</span><span class="pl-kos">}</span> <span class="pl-kos">{</span>...<span class="pl-s1">other</span><span class="pl-kos">}</span><span class="pl-c1">></span>
<span class="pl-c1"><</span><span class="pl-ent">Target</span><span class="pl-c1">></span>
<span class="pl-kos">{</span><span class="pl-kos">(</span><span class="pl-kos">{</span> targetProps <span class="pl-kos">}</span><span class="pl-kos">)</span> <span class="pl-c1">=></span> <span class="pl-kos">(</span>
<span class="pl-c1"><</span><span class="pl-ent">TargetChildren</span>
<span class="pl-c1">element</span><span class="pl-c1">=</span><span class="pl-kos">{</span>
<span class="pl-k">typeof</span> <span class="pl-s1">childrenProp</span> <span class="pl-c1">!==</span> <span class="pl-s">'string'</span>
? <span class="pl-v">React</span><span class="pl-kos">.</span><span class="pl-en">cloneElement</span><span class="pl-kos">(</span><span class="pl-s1">childrenProp</span><span class="pl-kos">,</span> <span class="pl-s1">childrenProps</span><span class="pl-kos">)</span>
: <span class="pl-s1">childrenProp</span>
<span class="pl-kos">}</span>
<span class="pl-c1">ref</span><span class="pl-c1">=</span><span class="pl-kos">{</span><span class="pl-s1">node</span> <span class="pl-c1">=></span> <span class="pl-kos">{</span>
<span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">children</span> <span class="pl-c1">=</span> <span class="pl-en">findDOMNode</span><span class="pl-kos">(</span><span class="pl-s1">node</span><span class="pl-kos">)</span>
<span class="pl-s1">targetProps</span><span class="pl-kos">.</span><span class="pl-en">ref</span><span class="pl-kos">(</span><span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">children</span><span class="pl-kos">)</span>
<span class="pl-kos">}</span><span class="pl-kos">}</span>
<span class="pl-c1">/</span><span class="pl-c1">></span>
<span class="pl-kos">)</span><span class="pl-kos">}</span>
<span class="pl-c1"><</span><span class="pl-c1">/</span><span class="pl-ent">Target</span><span class="pl-c1">></span>
<span class="pl-c1"><</span><span class="pl-ent">Portal</span> <span class="pl-c1">open</span><span class="pl-c1">=</span><span class="pl-kos">{</span><span class="pl-s1">open</span><span class="pl-kos">}</span><span class="pl-c1">></span>
<span class="pl-c1"><</span><span class="pl-ent">Popper</span>
<span class="pl-c1">placement</span><span class="pl-c1">=</span><span class="pl-kos">{</span><span class="pl-s1">placement</span><span class="pl-kos">}</span>
<span class="pl-c1">eventsEnabled</span><span class="pl-c1">=</span><span class="pl-kos">{</span><span class="pl-s1">open</span><span class="pl-kos">}</span>
<span class="pl-c1">className</span><span class="pl-c1">=</span><span class="pl-kos">{</span><span class="pl-en">classNames</span><span class="pl-kos">(</span>
<span class="pl-s1">classes</span><span class="pl-kos">.</span><span class="pl-c1">popper</span><span class="pl-kos">,</span>
<span class="pl-kos">{</span> <span class="pl-kos">[</span><span class="pl-s1">classes</span><span class="pl-kos">.</span><span class="pl-c1">popperClose</span><span class="pl-kos">]</span>: <span class="pl-c1">!</span><span class="pl-s1">open</span> <span class="pl-kos">}</span><span class="pl-kos">,</span>
<span class="pl-v">PopperClassName</span>
<span class="pl-kos">)</span><span class="pl-kos">}</span>
<span class="pl-kos">{</span>...<span class="pl-v">PopperOther</span><span class="pl-kos">}</span>
<span class="pl-c1">ref</span><span class="pl-c1">=</span><span class="pl-kos">{</span><span class="pl-s1">node</span> <span class="pl-c1">=></span> <span class="pl-kos">{</span>
<span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">popper</span> <span class="pl-c1">=</span> <span class="pl-s1">node</span>
<span class="pl-kos">}</span><span class="pl-kos">}</span><span class="pl-c1">></span>
<span class="pl-kos">{</span><span class="pl-kos">(</span><span class="pl-kos">{</span> popperProps<span class="pl-kos">,</span> restProps <span class="pl-kos">}</span><span class="pl-kos">)</span> <span class="pl-c1">=></span> <span class="pl-kos">(</span>
<span class="pl-c1"><</span><span class="pl-ent">div</span>
<span class="pl-kos">{</span>...<span class="pl-s1">popperProps</span><span class="pl-kos">}</span>
<span class="pl-kos">{</span>...<span class="pl-s1">restProps</span><span class="pl-kos">}</span>
<span class="pl-c1">style</span><span class="pl-c1">=</span><span class="pl-kos">{</span><span class="pl-kos">{</span>
...<span class="pl-s1">popperProps</span><span class="pl-kos">.</span><span class="pl-c1">style</span><span class="pl-kos">,</span>
<span class="pl-c1">left</span>: <span class="pl-s1">popperProps</span><span class="pl-kos">.</span><span class="pl-c1">style</span><span class="pl-kos">.</span><span class="pl-c1">left</span> <span class="pl-c1">||</span> <span class="pl-c1">0</span><span class="pl-kos">,</span>
...<span class="pl-s1">restProps</span><span class="pl-kos">.</span><span class="pl-c1">style</span><span class="pl-kos">,</span>
<span class="pl-kos">}</span><span class="pl-kos">}</span><span class="pl-c1">></span>
<span class="pl-c1"><</span><span class="pl-ent">div</span>
<span class="pl-c1">id</span><span class="pl-c1">=</span><span class="pl-kos">{</span><span class="pl-s1">id</span><span class="pl-kos">}</span>
<span class="pl-c1">role</span><span class="pl-c1">=</span><span class="pl-s">"tooltip"</span>
<span class="pl-c1">aria-hidden</span><span class="pl-c1">=</span><span class="pl-kos">{</span><span class="pl-c1">!</span><span class="pl-s1">open</span><span class="pl-kos">}</span>
<span class="pl-c1">className</span><span class="pl-c1">=</span><span class="pl-kos">{</span><span class="pl-en">classNames</span><span class="pl-kos">(</span>
<span class="pl-s1">classes</span><span class="pl-kos">.</span><span class="pl-c1">tooltip</span><span class="pl-kos">,</span>
<span class="pl-kos">{</span> <span class="pl-kos">[</span><span class="pl-s1">classes</span><span class="pl-kos">.</span><span class="pl-c1">tooltipOpen</span><span class="pl-kos">]</span>: <span class="pl-s1">open</span> <span class="pl-kos">}</span><span class="pl-kos">,</span>
<span class="pl-s1">classes</span><span class="pl-kos">[</span><span class="pl-s">`tooltip<span class="pl-s1"><span class="pl-kos">${</span><span class="pl-en">capitalizeFirstLetter</span><span class="pl-kos">(</span><span class="pl-s1">placement</span><span class="pl-kos">.</span><span class="pl-en">split</span><span class="pl-kos">(</span><span class="pl-s">'-'</span><span class="pl-kos">)</span><span class="pl-kos">[</span><span class="pl-c1">0</span><span class="pl-kos">]</span><span class="pl-kos">)</span><span class="pl-kos">}</span></span>`</span><span class="pl-kos">]</span>
<span class="pl-kos">)</span><span class="pl-kos">}</span><span class="pl-c1">></span>
<span class="pl-kos">{</span><span class="pl-s1">title</span><span class="pl-kos">}</span>
<span class="pl-c1"><</span><span class="pl-c1">/</span><span class="pl-ent">div</span><span class="pl-c1">></span>
<span class="pl-c1"><</span><span class="pl-c1">/</span><span class="pl-ent">div</span><span class="pl-c1">></span>
<span class="pl-kos">)</span><span class="pl-kos">}</span>
<span class="pl-c1"><</span><span class="pl-c1">/</span><span class="pl-ent">Popper</span><span class="pl-c1">></span>
<span class="pl-c1"><</span><span class="pl-c1">/</span><span class="pl-ent">Portal</span><span class="pl-c1">></span>
<span class="pl-c1"><</span><span class="pl-c1">/</span><span class="pl-ent">Manager</span><span class="pl-c1">></span>
<span class="pl-c1"><</span><span class="pl-c1">/</span>EventListener>
<span class="pl-kos">)</span>
<span class="pl-kos">}</span>
<span class="pl-kos">}</span>
<span class="pl-k">export</span> <span class="pl-k">default</span> <span class="pl-en">withStyles</span><span class="pl-kos">(</span><span class="pl-en">styles</span><span class="pl-kos">,</span> <span class="pl-kos">{</span> <span class="pl-c1">name</span>: <span class="pl-s">'MuiTooltip'</span><span class="pl-kos">,</span> <span class="pl-c1">withTheme</span>: <span class="pl-c1">true</span> <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">(</span><span class="pl-v">Tooltip</span><span class="pl-kos">)</span></pre></div> | 1 |
<p dir="auto">After reading this blog post on <a href="https://blogs.msdn.microsoft.com/commandline/2018/12/10/new-experimental-console-features/" rel="nofollow">New Experimental Console Features</a>, I thought this was the right time to ask for a feature request, that could be added to the terminal options. (Or maybe even made as default behaviour?)</p>
<p dir="auto">When cycling previously run commands with the up-arrow, it will take 8 key-presses to reach the <code class="notranslate">ls</code> command in the example below<br>
(read from bottom to top)</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$ ls
$ java main.
$ javac main.java
$ java main
$ javac main.java
$ java main
$ javac main.java
$ java main"><pre class="notranslate"><code class="notranslate">$ ls
$ java main.
$ javac main.java
$ java main
$ javac main.java
$ java main
$ javac main.java
$ java main
</code></pre></div>
<p dir="auto">But I want an option to remove duplicate commands, when cycling through them, so in the example, it would only take 3 key-presses<br>
(read from bottom to top)</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$ ls
$ javac main.java
$ java main"><pre class="notranslate"><code class="notranslate">$ ls
$ javac main.java
$ java main
</code></pre></div> | <p dir="auto"><strong>Windows build number:</strong> [Version 10.0.16299.248]</p>
<p dir="auto">If I use an ANSI sequence to set the background color attribute, then move to the bottom of the screen and output some newlines so the screen scrolls up, I'd expect the newly revealed lines to have the background color that I just set.</p>
<p dir="auto">Similarly, if I move to the top of the screen, and output the reverse feed sequence (<code class="notranslate">\033M</code>) so the screen scrolls down, I'd again expect the new revealed lines to use the current background color.</p>
<p dir="auto">The later case (scrolling down) works as expected, but scrolling up does not.</p>
<p dir="auto"><strong>Test case (from a bash shell):</strong><br>
<code class="notranslate">printf "\033[44m\033[200B\n\n\033[200A\033M\033[m"</code></p>
<p dir="auto">I'd expect the above sequence to result in both the top and bottom lines of the screen having a blue background (which is what I see in a Linux console), but in the Windows 10 console, only the top line is blue.</p>
<p dir="auto">Note that the scroll up sequence (<code class="notranslate">\033[S</code>) has similar problems, although it's a little more complicated. The first line that's revealed when scrolling up will have the wrong background color, but subsequent lines will be correct. Scrolling down (like reverse feed) always seems to work as expected.</p>
<p dir="auto">I suspect this may be related to issue <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="297650054" data-permission-text="Title is private" data-url="https://github.com/microsoft/terminal/issues/70" data-hovercard-type="issue" data-hovercard-url="/microsoft/terminal/issues/70/hovercard" href="https://github.com/microsoft/terminal/issues/70">#70</a>. I apologise if it's just a duplicate.</p> | 0 |
<p dir="auto">Not sure if this is a bug or just a feature that has not been implemented (yet), but given the following:</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="interface Foo {
member1: number;
member2: boolean;
}
function bar(foo: Foo, member: "member1" | "member2") {
return foo[member]; // return type is inferred as any, whereas it should be number | boolean
}"><pre class="notranslate"><span class="pl-k">interface</span> <span class="pl-smi">Foo</span> <span class="pl-kos">{</span>
<span class="pl-c1">member1</span>: <span class="pl-smi">number</span><span class="pl-kos">;</span>
<span class="pl-c1">member2</span>: <span class="pl-smi">boolean</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span>
<span class="pl-k">function</span> <span class="pl-en">bar</span><span class="pl-kos">(</span><span class="pl-s1">foo</span>: <span class="pl-smi">Foo</span><span class="pl-kos">,</span> <span class="pl-s1">member</span>: <span class="pl-s">"member1"</span> <span class="pl-c1">|</span> <span class="pl-s">"member2"</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-k">return</span> <span class="pl-s1">foo</span><span class="pl-kos">[</span><span class="pl-s1">member</span><span class="pl-kos">]</span><span class="pl-kos">;</span> <span class="pl-c">// return type is inferred as any, whereas it should be number | boolean</span>
<span class="pl-kos">}</span></pre></div>
<p dir="auto">I would expect the return type of <code class="notranslate">Foo</code> to be <code class="notranslate">number | boolean</code> instead of <code class="notranslate">any</code>. I see the same issue with function overloads:</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="declare function bar2(field: "field1"): string;
declare function bar2(field: "field2"): number;
declare function bar2(field: string): any;
var field: "field1" | "field2" = "field1";
var result = bar2(field); // inferred type of result is any, whereas it should be string | number"><pre class="notranslate"><span class="pl-k">declare</span> <span class="pl-k">function</span> <span class="pl-s1">bar2</span><span class="pl-kos">(</span><span class="pl-s1">field</span>: <span class="pl-s">"field1"</span><span class="pl-kos">)</span>: <span class="pl-smi">string</span><span class="pl-kos">;</span>
<span class="pl-k">declare</span> <span class="pl-k">function</span> <span class="pl-s1">bar2</span><span class="pl-kos">(</span><span class="pl-s1">field</span>: <span class="pl-s">"field2"</span><span class="pl-kos">)</span>: <span class="pl-smi">number</span><span class="pl-kos">;</span>
<span class="pl-k">declare</span> <span class="pl-k">function</span> <span class="pl-s1">bar2</span><span class="pl-kos">(</span><span class="pl-s1">field</span>: <span class="pl-smi">string</span><span class="pl-kos">)</span>: <span class="pl-smi">any</span><span class="pl-kos">;</span>
<span class="pl-k">var</span> <span class="pl-s1">field</span>: <span class="pl-s">"field1"</span> <span class="pl-c1">|</span> <span class="pl-s">"field2"</span> <span class="pl-c1">=</span> <span class="pl-s">"field1"</span><span class="pl-kos">;</span>
<span class="pl-k">var</span> <span class="pl-s1">result</span> <span class="pl-c1">=</span> <span class="pl-en">bar2</span><span class="pl-kos">(</span><span class="pl-s1">field</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// inferred type of result is any, whereas it should be string | number</span></pre></div>
<p dir="auto">Note that his behavior is not limited to string literals; it also happens when overloading on type:</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="declare function bar3(field: Date): string;
declare function bar3(field: number): number;
declare function bar3(field: any): any;
var field2: Date | number = 6;
var result2 = bar3(field2); // inferred type of result2 is any, whereas it should be string | number"><pre class="notranslate"><span class="pl-k">declare</span> <span class="pl-k">function</span> <span class="pl-s1">bar3</span><span class="pl-kos">(</span><span class="pl-s1">field</span>: <span class="pl-smi">Date</span><span class="pl-kos">)</span>: <span class="pl-smi">string</span><span class="pl-kos">;</span>
<span class="pl-k">declare</span> <span class="pl-k">function</span> <span class="pl-s1">bar3</span><span class="pl-kos">(</span><span class="pl-s1">field</span>: <span class="pl-smi">number</span><span class="pl-kos">)</span>: <span class="pl-smi">number</span><span class="pl-kos">;</span>
<span class="pl-k">declare</span> <span class="pl-k">function</span> <span class="pl-s1">bar3</span><span class="pl-kos">(</span><span class="pl-s1">field</span>: <span class="pl-smi">any</span><span class="pl-kos">)</span>: <span class="pl-smi">any</span><span class="pl-kos">;</span>
<span class="pl-k">var</span> <span class="pl-s1">field2</span>: <span class="pl-smi">Date</span> <span class="pl-c1">|</span> <span class="pl-smi">number</span> <span class="pl-c1">=</span> <span class="pl-c1">6</span><span class="pl-kos">;</span>
<span class="pl-k">var</span> <span class="pl-s1">result2</span> <span class="pl-c1">=</span> <span class="pl-en">bar3</span><span class="pl-kos">(</span><span class="pl-s1">field2</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// inferred type of result2 is any, whereas it should be string | number</span></pre></div>
<p dir="auto">This is with typescript 1.8.2</p> | <p dir="auto"><em>(This seems to have some things in common with <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="121849248" data-permission-text="Title is private" data-url="https://github.com/microsoft/TypeScript/issues/6080" data-hovercard-type="issue" data-hovercard-url="/microsoft/TypeScript/issues/6080/hovercard" href="https://github.com/microsoft/TypeScript/issues/6080">#6080</a> and is strongly related to <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="50384290" data-permission-text="Title is private" data-url="https://github.com/microsoft/TypeScript/issues/1295" data-hovercard-type="issue" data-hovercard-url="/microsoft/TypeScript/issues/1295/hovercard" href="https://github.com/microsoft/TypeScript/issues/1295">#1295</a> as <a href="https://github.com/Microsoft/TypeScript/issues/1295#issuecomment-202388214" data-hovercard-type="issue" data-hovercard-url="/microsoft/TypeScript/issues/1295/hovercard">it can be used to provide an alternative solution to it</a> but l opened this separately since I did not feel it was appropriate to continue discussing it there and wanted to approach it in a more generalized way)</em></p>
<p dir="auto">This would provide improved type safety for cases where an interface property is referenced through a string having a value that's known at compile time:</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="type MyType = { "ABC": number };
let x: MyType = { ABC: 42 };
const propName = "ABC"; // 'propName' received the literal type "ABC" (not string)
let y = x[propName]; // 'y' received the type MyType["ABC"] which resolved to 'number'"><pre class="notranslate"><span class="pl-k">type</span> <span class="pl-smi">MyType</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span> <span class="pl-s">"ABC"</span>: <span class="pl-smi">number</span> <span class="pl-kos">}</span><span class="pl-kos">;</span>
<span class="pl-k">let</span> <span class="pl-s1">x</span>: <span class="pl-smi">MyType</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span> <span class="pl-c1">ABC</span>: <span class="pl-c1">42</span> <span class="pl-kos">}</span><span class="pl-kos">;</span>
<span class="pl-k">const</span> <span class="pl-s1">propName</span> <span class="pl-c1">=</span> <span class="pl-s">"ABC"</span><span class="pl-kos">;</span> <span class="pl-c">// 'propName' received the literal type "ABC" (not string)</span>
<span class="pl-k">let</span> <span class="pl-s1">y</span> <span class="pl-c1">=</span> <span class="pl-s1">x</span><span class="pl-kos">[</span><span class="pl-s1">propName</span><span class="pl-kos">]</span><span class="pl-kos">;</span> <span class="pl-c">// 'y' received the type MyType["ABC"] which resolved to 'number'</span></pre></div>
<p dir="auto">And with support for generic types added, this could work similarly, but resolve to an intermediate type of the form <code class="notranslate">T[S]</code> where <code class="notranslate">T</code> is an object type and <code class="notranslate">S</code> is a string literal type:</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="function func<T extends object>() {
let x: T;
const propName = "ABC"; // 'propName' received the literal type "ABC"
let y = x[propName]; // 'y' would receive the type T["ABC"]
}"><pre class="notranslate"><span class="pl-k">function</span> <span class="pl-en">func</span><span class="pl-c1"><</span><span class="pl-smi">T</span> <span class="pl-k">extends</span> <span class="pl-smi">object</span><span class="pl-c1">></span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-k">let</span> <span class="pl-s1">x</span>: <span class="pl-smi">T</span><span class="pl-kos">;</span>
<span class="pl-k">const</span> <span class="pl-s1">propName</span> <span class="pl-c1">=</span> <span class="pl-s">"ABC"</span><span class="pl-kos">;</span> <span class="pl-c">// 'propName' received the literal type "ABC"</span>
<span class="pl-k">let</span> <span class="pl-s1">y</span> <span class="pl-c1">=</span> <span class="pl-s1">x</span><span class="pl-kos">[</span><span class="pl-s1">propName</span><span class="pl-kos">]</span><span class="pl-kos">;</span> <span class="pl-c">// 'y' would receive the type T["ABC"]</span>
<span class="pl-kos">}</span></pre></div>
<p dir="auto">This could combine with <code class="notranslate">readonly</code> function parameters to provide an alternative solution for <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="50384290" data-permission-text="Title is private" data-url="https://github.com/microsoft/TypeScript/issues/1295" data-hovercard-type="issue" data-hovercard-url="/microsoft/TypeScript/issues/1295/hovercard" href="https://github.com/microsoft/TypeScript/issues/1295">#1295</a> (which was actually <a href="https://github.com/Microsoft/TypeScript/issues/1295#issuecomment-202388214" data-hovercard-type="issue" data-hovercard-url="/microsoft/TypeScript/issues/1295/hovercard">where the idea was initially proposed</a>):</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="function getProperty<T extends object, S extends string>(obj: T, readonly propName: S): T[S] {
return obj[propName];
}
// Here T resolves to { ABC: number }, S resolves to the literal type "ABC",
// and T[S] resolves to number
let x = getProperty({ABC: 42}, "ABC"); // Type of 'x' is number
// Here T resolves to { ABC: number }, S resolves to the literal type "CBA"
// and T[S] resolves to any
let x = getProperty({ABC: 42}, "CBA"); // Type of 'x' is any
// Here T resolves to { ABC: number }, S resolves to string
// and T[S] resolves to any
let x = getProperty({ABC: 42}, getRandomString()); // Type of 'x' is any"><pre class="notranslate"><span class="pl-k">function</span> <span class="pl-en">getProperty</span><span class="pl-c1"><</span><span class="pl-smi">T</span> <span class="pl-k">extends</span> <span class="pl-smi">object</span><span class="pl-kos">,</span> <span class="pl-smi">S</span> <span class="pl-k">extends</span> <span class="pl-smi">string</span><span class="pl-c1">></span><span class="pl-kos">(</span><span class="pl-s1">obj</span>: <span class="pl-smi">T</span><span class="pl-kos">,</span> <span class="pl-k">readonly</span> <span class="pl-s1">propName</span>: <span class="pl-smi">S</span><span class="pl-kos">)</span>: <span class="pl-smi">T</span><span class="pl-kos">[</span><span class="pl-smi">S</span><span class="pl-kos">]</span> <span class="pl-kos">{</span>
<span class="pl-k">return</span> <span class="pl-s1">obj</span><span class="pl-kos">[</span><span class="pl-s1">propName</span><span class="pl-kos">]</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span>
<span class="pl-c">// Here T resolves to { ABC: number }, S resolves to the literal type "ABC", </span>
<span class="pl-c">// and T[S] resolves to number</span>
<span class="pl-k">let</span> <span class="pl-s1">x</span> <span class="pl-c1">=</span> <span class="pl-en">getProperty</span><span class="pl-kos">(</span><span class="pl-kos">{</span><span class="pl-c1">ABC</span>: <span class="pl-c1">42</span><span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-s">"ABC"</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// Type of 'x' is number</span>
<span class="pl-c">// Here T resolves to { ABC: number }, S resolves to the literal type "CBA" </span>
<span class="pl-c">// and T[S] resolves to any</span>
<span class="pl-k">let</span> <span class="pl-s1">x</span> <span class="pl-c1">=</span> <span class="pl-en">getProperty</span><span class="pl-kos">(</span><span class="pl-kos">{</span><span class="pl-c1">ABC</span>: <span class="pl-c1">42</span><span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-s">"CBA"</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// Type of 'x' is any</span>
<span class="pl-c">// Here T resolves to { ABC: number }, S resolves to string</span>
<span class="pl-c">// and T[S] resolves to any</span>
<span class="pl-k">let</span> <span class="pl-s1">x</span> <span class="pl-c1">=</span> <span class="pl-en">getProperty</span><span class="pl-kos">(</span><span class="pl-kos">{</span><span class="pl-c1">ABC</span>: <span class="pl-c1">42</span><span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-en">getRandomString</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// Type of 'x' is any</span></pre></div>
<p dir="auto">This may similarly extend to <a href="https://github.com/Microsoft/TypeScript/pull/7480" data-hovercard-type="pull_request" data-hovercard-url="/microsoft/TypeScript/pull/7480/hovercard">numeric literal types</a>, for tuples:</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="type MyTupleType = [number, string, boolean];
let x: MyTupleType;
const index = 1; // 'index' received the literal type 1;
let y = x[index]; // 'y' received the type MyTupleType[1] which resolved to 'string'"><pre class="notranslate"><span class="pl-k">type</span> <span class="pl-smi">MyTupleType</span> <span class="pl-c1">=</span> <span class="pl-kos">[</span><span class="pl-smi">number</span><span class="pl-kos">,</span> <span class="pl-smi">string</span><span class="pl-kos">,</span> <span class="pl-smi">boolean</span><span class="pl-kos">]</span><span class="pl-kos">;</span>
<span class="pl-k">let</span> <span class="pl-s1">x</span>: <span class="pl-smi">MyTupleType</span><span class="pl-kos">;</span>
<span class="pl-k">const</span> <span class="pl-s1">index</span> <span class="pl-c1">=</span> <span class="pl-c1">1</span><span class="pl-kos">;</span> <span class="pl-c">// 'index' received the literal type 1;</span>
<span class="pl-k">let</span> <span class="pl-s1">y</span> <span class="pl-c1">=</span> <span class="pl-s1">x</span><span class="pl-kos">[</span><span class="pl-s1">index</span><span class="pl-kos">]</span><span class="pl-kos">;</span> <span class="pl-c">// 'y' received the type MyTupleType[1] which resolved to 'string'</span></pre></div>
<p dir="auto">And work with generic tuples as well:</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="function getTupleElement<T extends Array<any>, N extends number>(tuple: T, readonly index: N): T[N] {
return tuple[index];
}"><pre class="notranslate"><span class="pl-k">function</span> <span class="pl-en">getTupleElement</span><span class="pl-c1"><</span><span class="pl-smi">T</span> <span class="pl-k">extends</span> <span class="pl-smi">Array</span><span class="pl-kos"><</span><span class="pl-smi">any</span><span class="pl-kos">></span><span class="pl-kos">,</span> <span class="pl-smi">N</span> <span class="pl-k">extends</span> <span class="pl-smi">number</span><span class="pl-c1">></span><span class="pl-kos">(</span><span class="pl-s1">tuple</span>: <span class="pl-smi">T</span><span class="pl-kos">,</span> <span class="pl-k">readonly</span> <span class="pl-s1">index</span>: <span class="pl-smi">N</span><span class="pl-kos">)</span>: <span class="pl-smi">T</span><span class="pl-kos">[</span><span class="pl-smi">N</span><span class="pl-kos">]</span> <span class="pl-kos">{</span>
<span class="pl-k">return</span> <span class="pl-s1">tuple</span><span class="pl-kos">[</span><span class="pl-s1">index</span><span class="pl-kos">]</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span></pre></div>
<p dir="auto">Same can be done with symbol literal types (haven't thought about that much though):</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="function getSymbolProperty<T extends object, S extends symbol>(obj: T, readonly sym: S): T[S] {
return obj[sym];
}"><pre class="notranslate"><span class="pl-k">function</span> <span class="pl-en">getSymbolProperty</span><span class="pl-c1"><</span><span class="pl-smi">T</span> <span class="pl-k">extends</span> <span class="pl-smi">object</span><span class="pl-kos">,</span> <span class="pl-smi">S</span> <span class="pl-k">extends</span> <span class="pl-smi">symbol</span><span class="pl-c1">></span><span class="pl-kos">(</span><span class="pl-s1">obj</span>: <span class="pl-smi">T</span><span class="pl-kos">,</span> <span class="pl-k">readonly</span> <span class="pl-s1">sym</span>: <span class="pl-smi">S</span><span class="pl-kos">)</span>: <span class="pl-smi">T</span><span class="pl-kos">[</span><span class="pl-smi">S</span><span class="pl-kos">]</span> <span class="pl-kos">{</span>
<span class="pl-k">return</span> <span class="pl-s1">obj</span><span class="pl-kos">[</span><span class="pl-s1">sym</span><span class="pl-kos">]</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span></pre></div> | 1 |
<p dir="auto">Use UTF-8 as source and executable encodings for C++ projects that<br>
contain UTF-8 source files.</p>
<p dir="auto">Tree <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/microsoft/terminal/commit/35229a775d9e9908a8dfb102e01f49b494b29194/hovercard" href="https://github.com/microsoft/terminal/commit/35229a775d9e9908a8dfb102e01f49b494b29194"><tt>35229a7</tt></a> fails to build where the<br>
default code page is 936 (GBK), due to multiple files containing UTF-8<br>
encoded strings and/or comments, and these projects set to<br>
fail-on-warning mode. Additionally,<br>
src/host/ut_host/UnicodeLiteral.hpp contains a Windows-1252 encoded<br>
string. This commit adds the /utf-8 option to the affected projects,<br>
and converts src/host/ut_host/UnicodeLiteral.hpp to UTF-8.</p> | <p dir="auto">win10 1903<br>
vs2019 (but I have follow this : <a href="https://devblogs.microsoft.com/setup/configure-visual-studio-across-your-organization-with-vsconfig/" rel="nofollow">https://devblogs.microsoft.com/setup/configure-visual-studio-across-your-organization-with-vsconfig/</a>)<br>
result:<br>
_GenerateProjectPriFileCore:<br>
C:\Program Files (x86)\Windows Kits\10\bin\10.0.17763.0\x64\MakePri.exe New -ProjectRoot C:\Users\a5566\terminal\src<br>
cascadia\TerminalConnection\ -ConfigXml x64\Debug\priconfig.xml -OutputFile C:\Users\a5566\terminal\x64\Debug\Termina<br>
lConnection\Microsoft.Terminal.TerminalConnection.pri -IndexName Microsoft.Terminal.TerminalConnection -Verbose -Over<br>
write<br>
TerminalConnection -> Microsoft.Terminal.TerminalConnection.pri<br>
PostBuildEvent:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" echo OutDir=C:\Users\a5566\terminal\x64\Debug\TerminalConnection\
(xcopy /Y "C:\Users\a5566\terminal\x64\Debug\TerminalConnection\TerminalConnection.dll" "C:\Users\a5566\termi"><pre class="notranslate"><code class="notranslate"> echo OutDir=C:\Users\a5566\terminal\x64\Debug\TerminalConnection\
(xcopy /Y "C:\Users\a5566\terminal\x64\Debug\TerminalConnection\TerminalConnection.dll" "C:\Users\a5566\termi
</code></pre></div>
<p dir="auto">nal\x64\Debug\TerminalConnection.dll*" )<br>
(xcopy /Y "C:\Users\a5566\terminal\x64\Debug\TerminalConnection\TerminalConnection.pdb" "C:\Users\a5566\termi<br>
nal\x64\Debug\TerminalConnection.pdb*" )</p>
<p dir="auto">:VCEnd<br>
OutDir=C:\Users\a5566\terminal\x64\Debug\TerminalConnection<br>
C:\Users\a5566\terminal\x64\Debug\TerminalConnection\TerminalConnection.dll<br>
1 File(s) copied<br>
C:\Users\a5566\terminal\x64\Debug\TerminalConnection\TerminalConnection.pdb<br>
1 File(s) copied<br>
FinalizeBuildStatus:<br>
Deleting file "x64\Debug\Terminal.CA5CAD1A.tlog\unsuccessfulbuild".<br>
Touching "x64\Debug\Terminal.CA5CAD1A.tlog\TerminalConnection.lastbuildstate".<br>
Done Building Project "C:\Users\a5566\terminal\src\cascadia\TerminalConnection\TerminalConnection.vcxproj" (default tar<br>
gets).</p>
<p dir="auto">Done Building Project "C:\Users\a5566\terminal\src\cascadia\TerminalControl\TerminalControl.vcxproj.metaproj" (default<br>
targets) -- FAILED.</p>
<p dir="auto">Done Building Project "C:\Users\a5566\terminal\OpenConsole.sln" (default targets) -- FAILED.</p>
<p dir="auto">Build FAILED.</p>
<p dir="auto">"C:\Users\a5566\terminal\OpenConsole.sln" (default target) (1) -><br>
"C:\Users\a5566\terminal\src\host\exe\Host.EXE.vcxproj.metaproj" (default target) (2) -><br>
"C:\Users\a5566\terminal\src\host\exe\Host.EXE.vcxproj" (default target) (4) -><br>
"C:\Users\a5566\terminal\src\interactivity\win32\lib\win32.LIB.vcxproj" (default target) (6) -><br>
"C:\Users\a5566\terminal\src\renderer\base\lib\base.vcxproj" (default target) (9) -><br>
(ClCompile target) -><br>
C:\Users\a5566\terminal\src\renderer\base\thread.cpp(1): warning C4819: The file contains a character that cannot be<br>
represented in the current code page (950). Save the file in Unicode format to prevent data loss [C:\Users\a5566\termin<br>
al\src\renderer\base\lib\base.vcxproj]</p>
<p dir="auto">"C:\Users\a5566\terminal\OpenConsole.sln" (default target) (1) -><br>
"C:\Users\a5566\terminal\src\host\exe\Host.EXE.vcxproj.metaproj" (default target) (2) -><br>
"C:\Users\a5566\terminal\src\host\exe\Host.EXE.vcxproj" (default target) (4) -><br>
"C:\Users\a5566\terminal\src\interactivity\win32\lib\win32.LIB.vcxproj" (default target) (6) -><br>
"C:\Users\a5566\terminal\src\renderer\base\lib\base.vcxproj" (default target) (9) -><br>
(ClCompile target) -><br>
C:\Users\a5566\terminal\src\renderer\base\thread.cpp(1): error C2220: warning treated as error - no 'object' file gen<br>
erated [C:\Users\a5566\terminal\src\renderer\base\lib\base.vcxproj]</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="1 Warning(s)
1 Error(s)"><pre class="notranslate"><code class="notranslate">1 Warning(s)
1 Error(s)
</code></pre></div>
<p dir="auto">Time Elapsed 00:04:07.43</p> | 1 |
<h1 dir="auto">Checklist</h1>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have checked the <a href="https://github.com/celery/celery/issues?utf8=%E2%9C%93&q=is%3Aissue+label%3A%22Category%3A+Documentation%22+">issues list</a><br>
for similar or identical bug reports.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have checked the <a href="https://github.com/celery/celery/pulls?q=is%3Apr+label%3A%22Category%3A+Documentation%22">pull requests list</a><br>
for existing proposed fixes.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have checked the <a href="https://github.com/celery/celery/commits/master">commit log</a><br>
to find out if the bug was already fixed in the master branch.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have included all related issues and possible duplicate issues in this issue<br>
(If there are none, check this box anyway).</li>
</ul>
<h2 dir="auto">Related Issues and Possible Duplicates</h2>
<h4 dir="auto">Related Issues</h4>
<ul dir="auto">
<li>None</li>
</ul>
<h4 dir="auto">Possible Duplicates</h4>
<ul dir="auto">
<li>None</li>
</ul>
<h1 dir="auto">Description</h1>
<p dir="auto">In the latest version of the documentation about <a href="http://docs.celeryproject.org/en/latest/userguide/configuration.html?highlight=task_reject_on_worker_lost" rel="nofollow">task_reject_on_worker_lost</a>, it says <code class="notranslate">Enabling this can cause message loops</code></p>
<p dir="auto">But actually, enabling this will not cause message loops, tasks only execute twice.Tasks that have been redelivered will not be redelivered again, <a href="https://github.com/celery/celery/blob/master/celery/worker/request.py#L518">source code</a></p>
<h1 dir="auto">Suggestions</h1>
<p dir="auto">If it is a documentation error, it is best to remove the warning from the document.<br>
If the document is ok, it is need to modify the code.<br>
I can help modify the document or code.</p> | <h1 dir="auto">Checklist</h1>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have verified that the issue exists against the <code class="notranslate">master</code> branch of Celery.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> This has already been asked to the <a href="https://groups.google.com/forum/#!forum/celery-users" rel="nofollow">discussion group</a> first.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have read the relevant section in the<br>
<a href="http://docs.celeryproject.org/en/latest/contributing.html#other-bugs" rel="nofollow">contribution guide</a><br>
on reporting bugs.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have checked the <a href="https://github.com/celery/celery/issues?q=is%3Aissue+label%3A%22Issue+Type%3A+Bug+Report%22+-label%3A%22Category%3A+Documentation%22">issues list</a><br>
for similar or identical bug reports.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have checked the <a href="https://github.com/celery/celery/pulls?q=is%3Apr+label%3A%22PR+Type%3A+Bugfix%22+-label%3A%22Category%3A+Documentation%22">pull requests list</a><br>
for existing proposed fixes.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have checked the <a href="https://github.com/celery/celery/commits/master">commit log</a><br>
to find out if the bug was already fixed in the master branch.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have included all related issues and possible duplicate issues<br>
in this issue (If there are none, check this box anyway).</li>
</ul>
<h2 dir="auto">Mandatory Debugging Information</h2>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have included the output of <code class="notranslate">celery -A proj report</code> in the issue.<br>
(if you are not able to do this, then at least specify the Celery<br>
version affected).</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have verified that the issue exists against the <code class="notranslate">master</code> branch of Celery.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have included the contents of <code class="notranslate">pip freeze</code> in the issue.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have included all the versions of all the external dependencies required<br>
to reproduce this bug.</li>
</ul>
<h2 dir="auto">Optional Debugging Information</h2>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have tried reproducing the issue on more than one Python version<br>
and/or implementation.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have tried reproducing the issue on more than one message broker and/or<br>
result backend.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have tried reproducing the issue on more than one version of the message<br>
broker and/or result backend.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have tried reproducing the issue on more than one operating system.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have tried reproducing the issue on more than one workers pool.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have tried reproducing the issue with autoscaling, retries,<br>
ETA/Countdown & rate limits disabled.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have tried reproducing the issue after downgrading<br>
and/or upgrading Celery and its dependencies.</li>
</ul>
<h2 dir="auto">Related Issues and Possible Duplicates</h2>
<h4 dir="auto">Related Issues</h4>
<p dir="auto"><a href="https://groups.google.com/g/celery-users/c/VIyUHo0UHCM" rel="nofollow">https://groups.google.com/g/celery-users/c/VIyUHo0UHCM</a></p>
<h4 dir="auto">Possible Duplicates</h4>
<ul dir="auto">
<li>None</li>
</ul>
<h2 dir="auto">Environment & Settings</h2>
<p dir="auto"><strong>Celery version</strong>: 5.0.0</p>
<details>
<summary><b><code class="notranslate">celery report</code> Output:</b></summary>
<p dir="auto">
</p><div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=""><pre class="notranslate"><code class="notranslate"></code></pre></div>
<p dir="auto"></p>
</details>
<h1 dir="auto">Steps to Reproduce</h1>
<h2 dir="auto">Required Dependencies</h2>
<ul dir="auto">
<li><strong>Minimal Python Version</strong>: 3.7</li>
<li><strong>Minimal Celery Version</strong>: 5.0.0</li>
<li><strong>Minimal Kombu Version</strong>: 5.0.2</li>
<li><strong>Minimal Broker Version</strong>: Redis 3.5.3</li>
<li><strong>Minimal Result Backend Version</strong>: N/A or Unknown</li>
<li><strong>Minimal OS and/or Kernel Version</strong>: Ubuntu 20.04</li>
<li><strong>Minimal Broker Client Version</strong>: N/A or Unknown</li>
<li><strong>Minimal Result Backend Client Version</strong>: N/A or Unknown</li>
</ul>
<h3 dir="auto">Python Packages</h3>
<details>
<summary><b><code class="notranslate">pip freeze</code> Output:</b></summary>
<p dir="auto">
</p><div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=""><pre class="notranslate"><code class="notranslate"></code></pre></div>
<p dir="auto"></p>
</details>
<h3 dir="auto">Other Dependencies</h3>
<details>
<p dir="auto">
N/A
</p>
</details>
<h2 dir="auto">Minimally Reproducible Test Case</h2>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="from celery.decorators import periodic_task
@periodic_task(run_every=crontab(minute='*/10'))
def my-task():
doSomething()
"><pre class="notranslate"><code class="notranslate">from celery.decorators import periodic_task
@periodic_task(run_every=crontab(minute='*/10'))
def my-task():
doSomething()
</code></pre></div>
<details>
<p dir="auto">
</p><div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content=""><pre class="notranslate"></pre></div>
<p dir="auto"></p>
</details>
<h1 dir="auto">Expected Behavior</h1>
<p dir="auto">Import <code class="notranslate">from celery.decorators import periodic_task</code> and use the <code class="notranslate">periodic_task </code>decorator on a task</p>
<h1 dir="auto">Actual Behavior</h1>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/celery/utils/dispatch/signal.py", line 276, in send
response = receiver(signal=self, sender=sender, **named)
File "/usr/local/lib/python3.7/site-packages/vine/promises.py", line 160, in __call__
return self.throw()
File "/usr/local/lib/python3.7/site-packages/vine/promises.py", line 157, in __call__
retval = fun(*final_args, **final_kwargs)
File "/usr/local/lib/python3.7/site-packages/celery/app/base.py", line 640, in _autodiscover_tasks
return self._autodiscover_tasks_from_fixups(related_name)
File "/usr/local/lib/python3.7/site-packages/celery/app/base.py", line 653, in _autodiscover_tasks_from_fixups
], related_name=related_name)
File "/usr/local/lib/python3.7/site-packages/celery/app/base.py", line 645, in _autodiscover_tasks_from_names
packages() if callable(packages) else packages, related_name,
File "/usr/local/lib/python3.7/site-packages/celery/loaders/base.py", line 220, in autodiscover_tasks
related_name) if mod)
File "/usr/local/lib/python3.7/site-packages/celery/loaders/base.py", line 245, in autodiscover_tasks
return [find_related_module(pkg, related_name) for pkg in packages]
File "/usr/local/lib/python3.7/site-packages/celery/loaders/base.py", line 245, in <listcomp>
return [find_related_module(pkg, related_name) for pkg in packages]
File "/usr/local/lib/python3.7/site-packages/celery/loaders/base.py", line 270, in find_related_module
raise e
File "/usr/local/lib/python3.7/site-packages/celery/loaders/base.py", line 266, in find_related_module
return importlib.import_module(module_name)
File "/usr/local/lib/python3.7/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 728, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/src/scraper/tasks.py", line 25, in <module>
@periodic_task(run_every=crontab(minute='*/10'))
File "/usr/local/lib/python3.7/site-packages/celery/local.py", line 403, in _compat_periodic_task_decorator
from celery.task import periodic_task
ModuleNotFoundError: No module named 'celery.task'
Traceback (most recent call last):
File "/usr/local/bin/celery", line 8, in <module>
sys.exit(main())
File "/usr/local/lib/python3.7/site-packages/celery/__main__.py", line 15, in main
sys.exit(_main())
File "/usr/local/lib/python3.7/site-packages/celery/bin/celery.py", line 150, in main
return celery(auto_envvar_prefix="CELERY")
File "/usr/local/lib/python3.7/site-packages/click/core.py", line 829, in __call__
return self.main(*args, **kwargs)
File "/usr/local/lib/python3.7/site-packages/click/core.py", line 782, in main
rv = self.invoke(ctx)
File "/usr/local/lib/python3.7/site-packages/click/core.py", line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/local/lib/python3.7/site-packages/click/core.py", line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/local/lib/python3.7/site-packages/click/core.py", line 610, in invoke
return callback(*args, **kwargs)
File "/usr/local/lib/python3.7/site-packages/click/decorators.py", line 21, in new_func
return f(get_current_context(), *args, **kwargs)
File "/usr/local/lib/python3.7/site-packages/celery/bin/worker.py", line 329, in worker
**kwargs)
File "/usr/local/lib/python3.7/site-packages/celery/worker/worker.py", line 94, in __init__
self.app.loader.init_worker()
File "/usr/local/lib/python3.7/site-packages/celery/loaders/base.py", line 111, in init_worker
self.import_default_modules()
File "/usr/local/lib/python3.7/site-packages/celery/loaders/base.py", line 105, in import_default_modules
raise response
File "/usr/local/lib/python3.7/site-packages/celery/utils/dispatch/signal.py", line 276, in send
response = receiver(signal=self, sender=sender, **named)
File "/usr/local/lib/python3.7/site-packages/celery/fixups/django.py", line 82, in on_import_modules
self.worker_fixup.validate_models()
File "/usr/local/lib/python3.7/site-packages/celery/fixups/django.py", line 121, in validate_models
run_checks()
File "/usr/local/lib/python3.7/site-packages/django/core/checks/registry.py", line 70, in run_checks
new_errors = check(app_configs=app_configs, databases=databases)
File "/usr/local/lib/python3.7/site-packages/django/core/checks/urls.py", line 13, in check_url_config
return check_resolver(resolver)
File "/usr/local/lib/python3.7/site-packages/django/core/checks/urls.py", line 23, in check_resolver
return check_method()
File "/usr/local/lib/python3.7/site-packages/django/urls/resolvers.py", line 408, in check
for pattern in self.url_patterns:
File "/usr/local/lib/python3.7/site-packages/django/utils/functional.py", line 48, in __get__
res = instance.__dict__[self.name] = self.func(instance)
File "/usr/local/lib/python3.7/site-packages/django/urls/resolvers.py", line 589, in url_patterns
patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
File "/usr/local/lib/python3.7/site-packages/django/utils/functional.py", line 48, in __get__
res = instance.__dict__[self.name] = self.func(instance)
File "/usr/local/lib/python3.7/site-packages/django/urls/resolvers.py", line 582, in urlconf_module
return import_module(self.urlconf_name)
File "/usr/local/lib/python3.7/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 728, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/src/mydjango/urls.py", line 22, in <module>
path('api/', include('scraper.urls', namespace="scraper")),
File "/usr/local/lib/python3.7/site-packages/django/urls/conf.py", line 34, in include
urlconf_module = import_module(urlconf_module)
File "/usr/local/lib/python3.7/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 728, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/src/scraper/urls.py", line 3, in <module>
from . import views
File "/src/scraper/views.py", line 2, in <module>
from .tasks import save_fuzzed_domains
File "/src/scraper/tasks.py", line 25, in <module>
@periodic_task(run_every=crontab(minute='*/10'))
File "/usr/local/lib/python3.7/site-packages/celery/local.py", line 403, in _compat_periodic_task_decorator
from celery.task import periodic_task
ModuleNotFoundError: No module named 'celery.task'"><pre class="notranslate"><code class="notranslate">Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/celery/utils/dispatch/signal.py", line 276, in send
response = receiver(signal=self, sender=sender, **named)
File "/usr/local/lib/python3.7/site-packages/vine/promises.py", line 160, in __call__
return self.throw()
File "/usr/local/lib/python3.7/site-packages/vine/promises.py", line 157, in __call__
retval = fun(*final_args, **final_kwargs)
File "/usr/local/lib/python3.7/site-packages/celery/app/base.py", line 640, in _autodiscover_tasks
return self._autodiscover_tasks_from_fixups(related_name)
File "/usr/local/lib/python3.7/site-packages/celery/app/base.py", line 653, in _autodiscover_tasks_from_fixups
], related_name=related_name)
File "/usr/local/lib/python3.7/site-packages/celery/app/base.py", line 645, in _autodiscover_tasks_from_names
packages() if callable(packages) else packages, related_name,
File "/usr/local/lib/python3.7/site-packages/celery/loaders/base.py", line 220, in autodiscover_tasks
related_name) if mod)
File "/usr/local/lib/python3.7/site-packages/celery/loaders/base.py", line 245, in autodiscover_tasks
return [find_related_module(pkg, related_name) for pkg in packages]
File "/usr/local/lib/python3.7/site-packages/celery/loaders/base.py", line 245, in <listcomp>
return [find_related_module(pkg, related_name) for pkg in packages]
File "/usr/local/lib/python3.7/site-packages/celery/loaders/base.py", line 270, in find_related_module
raise e
File "/usr/local/lib/python3.7/site-packages/celery/loaders/base.py", line 266, in find_related_module
return importlib.import_module(module_name)
File "/usr/local/lib/python3.7/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 728, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/src/scraper/tasks.py", line 25, in <module>
@periodic_task(run_every=crontab(minute='*/10'))
File "/usr/local/lib/python3.7/site-packages/celery/local.py", line 403, in _compat_periodic_task_decorator
from celery.task import periodic_task
ModuleNotFoundError: No module named 'celery.task'
Traceback (most recent call last):
File "/usr/local/bin/celery", line 8, in <module>
sys.exit(main())
File "/usr/local/lib/python3.7/site-packages/celery/__main__.py", line 15, in main
sys.exit(_main())
File "/usr/local/lib/python3.7/site-packages/celery/bin/celery.py", line 150, in main
return celery(auto_envvar_prefix="CELERY")
File "/usr/local/lib/python3.7/site-packages/click/core.py", line 829, in __call__
return self.main(*args, **kwargs)
File "/usr/local/lib/python3.7/site-packages/click/core.py", line 782, in main
rv = self.invoke(ctx)
File "/usr/local/lib/python3.7/site-packages/click/core.py", line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/local/lib/python3.7/site-packages/click/core.py", line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/local/lib/python3.7/site-packages/click/core.py", line 610, in invoke
return callback(*args, **kwargs)
File "/usr/local/lib/python3.7/site-packages/click/decorators.py", line 21, in new_func
return f(get_current_context(), *args, **kwargs)
File "/usr/local/lib/python3.7/site-packages/celery/bin/worker.py", line 329, in worker
**kwargs)
File "/usr/local/lib/python3.7/site-packages/celery/worker/worker.py", line 94, in __init__
self.app.loader.init_worker()
File "/usr/local/lib/python3.7/site-packages/celery/loaders/base.py", line 111, in init_worker
self.import_default_modules()
File "/usr/local/lib/python3.7/site-packages/celery/loaders/base.py", line 105, in import_default_modules
raise response
File "/usr/local/lib/python3.7/site-packages/celery/utils/dispatch/signal.py", line 276, in send
response = receiver(signal=self, sender=sender, **named)
File "/usr/local/lib/python3.7/site-packages/celery/fixups/django.py", line 82, in on_import_modules
self.worker_fixup.validate_models()
File "/usr/local/lib/python3.7/site-packages/celery/fixups/django.py", line 121, in validate_models
run_checks()
File "/usr/local/lib/python3.7/site-packages/django/core/checks/registry.py", line 70, in run_checks
new_errors = check(app_configs=app_configs, databases=databases)
File "/usr/local/lib/python3.7/site-packages/django/core/checks/urls.py", line 13, in check_url_config
return check_resolver(resolver)
File "/usr/local/lib/python3.7/site-packages/django/core/checks/urls.py", line 23, in check_resolver
return check_method()
File "/usr/local/lib/python3.7/site-packages/django/urls/resolvers.py", line 408, in check
for pattern in self.url_patterns:
File "/usr/local/lib/python3.7/site-packages/django/utils/functional.py", line 48, in __get__
res = instance.__dict__[self.name] = self.func(instance)
File "/usr/local/lib/python3.7/site-packages/django/urls/resolvers.py", line 589, in url_patterns
patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
File "/usr/local/lib/python3.7/site-packages/django/utils/functional.py", line 48, in __get__
res = instance.__dict__[self.name] = self.func(instance)
File "/usr/local/lib/python3.7/site-packages/django/urls/resolvers.py", line 582, in urlconf_module
return import_module(self.urlconf_name)
File "/usr/local/lib/python3.7/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 728, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/src/mydjango/urls.py", line 22, in <module>
path('api/', include('scraper.urls', namespace="scraper")),
File "/usr/local/lib/python3.7/site-packages/django/urls/conf.py", line 34, in include
urlconf_module = import_module(urlconf_module)
File "/usr/local/lib/python3.7/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 728, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/src/scraper/urls.py", line 3, in <module>
from . import views
File "/src/scraper/views.py", line 2, in <module>
from .tasks import save_fuzzed_domains
File "/src/scraper/tasks.py", line 25, in <module>
@periodic_task(run_every=crontab(minute='*/10'))
File "/usr/local/lib/python3.7/site-packages/celery/local.py", line 403, in _compat_periodic_task_decorator
from celery.task import periodic_task
ModuleNotFoundError: No module named 'celery.task'
</code></pre></div> | 0 |
<p dir="auto">Asked a bit in the IRC channel and it was suggested that this should be the case. Basically, if you imagine a real time linter (kind of like Babel's Try It) that just wants to show errors, or a syntax highlighter that also shows errors, it would be nice to show Duplicate Declaration Errors (let x = 10; let x = 10;).</p>
<p dir="auto">As of right now it appears that the only way to get this is through going through a transform (as opposed to babylon.parse just throwing it). This is unfortunate since its a lot of extra work since I won't actually be using the transform, just wanting to get this one error. I might be wrong here and there is some in-between step you can do to get this but I don't know.</p>
<p dir="auto">I am aware that this is kind of a strange error since it waits to happen until called, so its kind of in the middle, but again unfortunate to require the full sweep.</p> | <p dir="auto">The following ES6 code:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="var x = {x: 1, x: 2};"><pre class="notranslate"><span class="pl-k">var</span> <span class="pl-s1">x</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span><span class="pl-c1">x</span>: <span class="pl-c1">1</span><span class="pl-kos">,</span> <span class="pl-c1">x</span>: <span class="pl-c1">2</span><span class="pl-kos">}</span><span class="pl-kos">;</span></pre></div>
<p dir="auto">generates the following code:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content=""use strict";
var x = { x: 1, x: 2 };"><pre class="notranslate"><span class="pl-s">"use strict"</span><span class="pl-kos">;</span>
<span class="pl-k">var</span> <span class="pl-s1">x</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span> <span class="pl-c1">x</span>: <span class="pl-c1">1</span><span class="pl-kos">,</span> <span class="pl-c1">x</span>: <span class="pl-c1">2</span> <span class="pl-kos">}</span><span class="pl-kos">;</span></pre></div>
<p dir="auto">which will result in an error for ES5-compliant engines. I'm not sure what should be done here instead as duplicate keys are back to being valid in strict mode in ES6, but maybe something like this:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content=""use strict";
var x = { x: 1 };
x.x = 2;"><pre class="notranslate"><span class="pl-s">"use strict"</span><span class="pl-kos">;</span>
<span class="pl-k">var</span> <span class="pl-s1">x</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span> <span class="pl-c1">x</span>: <span class="pl-c1">1</span> <span class="pl-kos">}</span><span class="pl-kos">;</span>
<span class="pl-s1">x</span><span class="pl-kos">.</span><span class="pl-c1">x</span> <span class="pl-c1">=</span> <span class="pl-c1">2</span><span class="pl-kos">;</span></pre></div>
<p dir="auto">This bug also occurs with JSX:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="var x = <x x={1} x={2} />;"><pre class="notranslate"><span class="pl-k">var</span> <span class="pl-s1">x</span> <span class="pl-c1">=</span> <span class="pl-c1"><</span><span class="pl-s1">x</span> <span class="pl-c1">x</span><span class="pl-c1">=</span><span class="pl-kos">{</span><span class="pl-c1">1</span><span class="pl-kos">}</span> <span class="pl-c1">x</span><span class="pl-c1">=</span><span class="pl-kos">{</span><span class="pl-c1">2</span><span class="pl-kos">}</span> <span class="pl-c1">/</span><span class="pl-c1">></span><span class="pl-kos">;</span></pre></div>
<p dir="auto">becomes</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content=""use strict";
var x = React.createElement("x", { x: 1, x: 2 });"><pre class="notranslate"><span class="pl-s">"use strict"</span><span class="pl-kos">;</span>
<span class="pl-k">var</span> <span class="pl-s1">x</span> <span class="pl-c1">=</span> <span class="pl-v">React</span><span class="pl-kos">.</span><span class="pl-en">createElement</span><span class="pl-kos">(</span><span class="pl-s">"x"</span><span class="pl-kos">,</span> <span class="pl-kos">{</span> <span class="pl-c1">x</span>: <span class="pl-c1">1</span><span class="pl-kos">,</span> <span class="pl-c1">x</span>: <span class="pl-c1">2</span> <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div> | 0 |
<h1 dir="auto">Environment</h1>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Windows build number: Microsoft Windows [Version 10.0.18898.1000]
Windows Terminal version (if applicable):
Any other software?"><pre lang="none" class="notranslate"><code class="notranslate">Windows build number: Microsoft Windows [Version 10.0.18898.1000]
Windows Terminal version (if applicable):
Any other software?
</code></pre></div>
<h1 dir="auto">Steps to reproduce</h1>
<ol dir="auto">
<li>Open new tab in flyout menu</li>
<li>Try to select text in the newly created tab</li>
</ol>
<h1 dir="auto">Expected behavior</h1>
<p dir="auto">Text should be selected as normal</p>
<h1 dir="auto">Actual behavior</h1>
<p dir="auto">Terminal doesn't response to mouse dragging occasionally</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://camo.githubusercontent.com/4153092fff0c4dc6ffed9887d75f267958784dacd29baaacc54e107c07be2830/68747470733a2f2f692e696d6775722e636f6d2f304c54426438342e676966"><img src="https://camo.githubusercontent.com/4153092fff0c4dc6ffed9887d75f267958784dacd29baaacc54e107c07be2830/68747470733a2f2f692e696d6775722e636f6d2f304c54426438342e676966" alt="Imgur" data-animated-image="" data-canonical-src="https://i.imgur.com/0LTBd84.gif" style="max-width: 100%;"></a></p> | <h1 dir="auto">Environment</h1>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Windows build number: Windows 10 18363
Windows Terminal version (if applicable): 0.6.2911.0"><pre lang="none" class="notranslate"><code class="notranslate">Windows build number: Windows 10 18363
Windows Terminal version (if applicable): 0.6.2911.0
</code></pre></div>
<h1 dir="auto">Steps to reproduce</h1>
<p dir="auto">Drag the terminal window to other display. Terminal will exit after a second or so of being unresponsive.</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/3235846/67230611-e2659000-f43d-11e9-93f7-12b0915a592f.gif"><img src="https://user-images.githubusercontent.com/3235846/67230611-e2659000-f43d-11e9-93f7-12b0915a592f.gif" alt="2019-10-21_19-58-18" data-animated-image="" style="max-width: 100%;"></a></p> | 0 |
<p dir="auto">I have 4 videos and playing first video when app starts. While playing first video, I want to initialize other three videos so that playing smoothly. I initialized all four videos in same isolate, then sometimes UI freezes. So to avoid that I want to initialize other three videos in different isolate (not main isolate) so that UI won't freeze. I tried like so.</p>
<p dir="auto"><strong>Code:</strong></p>
<div class="highlight highlight-source-dart notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content=" VideoPlayerController _firstController;
VideoPlayerController _secondController;
VideoPlayerController _thirdController;
VideoPlayerController _fourthController;
static List<VideoPlayerController> _controllers;
List<String> urls = [url1, url2, url3, url4];
@override
void initState() {
_controllers = [
_firstController,
_secondController,
_thirdController,
_fourthController,
];
_initVideo();
_initFirstThree();
super.initState();
}
_initVideo() async {
_controllers[0] = new VideoPlayerController.network(urls[0]);
await _controllers[0].initialize();
await _controllers[0].setLooping(true);
await _controllers[0].play();
setState(() {});
}
_initFirstThree() async {
for (int i = 1; i < urls.length; i++) {
await initializeVideo(i, urls[i]);
}
}
Future initializeVideo(int index, String url) async {
final ReceivePort receivePort = ReceivePort();
await Isolate.spawn(isolateInit, receivePort.sendPort);
final SendPort sendPort = await receivePort.first;
final VideoPlayerController result = await sendReceive(sendPort, url);
_controllers[index] = result;
await result.dispose();
}
static isolateInit(SendPort sendPort) async {
final ReceivePort receivePort = ReceivePort();
sendPort.send(receivePort.sendPort);
final msg = await receivePort.first;
final String url = msg[0];
final SendPort replyPort = msg[1];
final VideoPlayerController controller = new VideoPlayerController.network(url);
await controller.initialize();
await controller.setLooping(true);
replyPort.send(controller);
}
Future sendReceive(SendPort send, message) {
final ReceivePort receivePort = ReceivePort();
send.send([message, receivePort.sendPort]);
return receivePort.first;
}"><pre class="notranslate"> <span class="pl-c1">VideoPlayerController</span> _firstController;
<span class="pl-c1">VideoPlayerController</span> _secondController;
<span class="pl-c1">VideoPlayerController</span> _thirdController;
<span class="pl-c1">VideoPlayerController</span> _fourthController;
<span class="pl-k">static</span> <span class="pl-c1">List</span><<span class="pl-c1">VideoPlayerController</span>> _controllers;
<span class="pl-c1">List</span><<span class="pl-c1">String</span>> urls <span class="pl-k">=</span> [url1, url2, url3, url4];
<span class="pl-k">@override</span>
<span class="pl-k">void</span> <span class="pl-en">initState</span>() {
_controllers <span class="pl-k">=</span> [
_firstController,
_secondController,
_thirdController,
_fourthController,
];
<span class="pl-en">_initVideo</span>();
<span class="pl-en">_initFirstThree</span>();
<span class="pl-c1">super</span>.<span class="pl-en">initState</span>();
}
<span class="pl-en">_initVideo</span>() <span class="pl-k">async</span> {
_controllers[<span class="pl-c1">0</span>] <span class="pl-k">=</span> <span class="pl-k">new</span> <span class="pl-c1">VideoPlayerController</span>.<span class="pl-en">network</span>(urls[<span class="pl-c1">0</span>]);
<span class="pl-k">await</span> _controllers[<span class="pl-c1">0</span>].<span class="pl-en">initialize</span>();
<span class="pl-k">await</span> _controllers[<span class="pl-c1">0</span>].<span class="pl-en">setLooping</span>(<span class="pl-c1">true</span>);
<span class="pl-k">await</span> _controllers[<span class="pl-c1">0</span>].<span class="pl-en">play</span>();
<span class="pl-en">setState</span>(() {});
}
<span class="pl-en">_initFirstThree</span>() <span class="pl-k">async</span> {
<span class="pl-k">for</span> (<span class="pl-c1">int</span> i <span class="pl-k">=</span> <span class="pl-c1">1</span>; i <span class="pl-k"><</span> urls.length; i<span class="pl-k">++</span>) {
<span class="pl-k">await</span> <span class="pl-en">initializeVideo</span>(i, urls[i]);
}
}
<span class="pl-c1">Future</span> <span class="pl-en">initializeVideo</span>(<span class="pl-c1">int</span> index, <span class="pl-c1">String</span> url) <span class="pl-k">async</span> {
<span class="pl-k">final</span> <span class="pl-c1">ReceivePort</span> receivePort <span class="pl-k">=</span> <span class="pl-c1">ReceivePort</span>();
<span class="pl-k">await</span> <span class="pl-c1">Isolate</span>.<span class="pl-en">spawn</span>(isolateInit, receivePort.sendPort);
<span class="pl-k">final</span> <span class="pl-c1">SendPort</span> sendPort <span class="pl-k">=</span> <span class="pl-k">await</span> receivePort.first;
<span class="pl-k">final</span> <span class="pl-c1">VideoPlayerController</span> result <span class="pl-k">=</span> <span class="pl-k">await</span> <span class="pl-en">sendReceive</span>(sendPort, url);
_controllers[index] <span class="pl-k">=</span> result;
<span class="pl-k">await</span> result.<span class="pl-en">dispose</span>();
}
<span class="pl-k">static</span> <span class="pl-en">isolateInit</span>(<span class="pl-c1">SendPort</span> sendPort) <span class="pl-k">async</span> {
<span class="pl-k">final</span> <span class="pl-c1">ReceivePort</span> receivePort <span class="pl-k">=</span> <span class="pl-c1">ReceivePort</span>();
sendPort.<span class="pl-en">send</span>(receivePort.sendPort);
<span class="pl-k">final</span> msg <span class="pl-k">=</span> <span class="pl-k">await</span> receivePort.first;
<span class="pl-k">final</span> <span class="pl-c1">String</span> url <span class="pl-k">=</span> msg[<span class="pl-c1">0</span>];
<span class="pl-k">final</span> <span class="pl-c1">SendPort</span> replyPort <span class="pl-k">=</span> msg[<span class="pl-c1">1</span>];
<span class="pl-k">final</span> <span class="pl-c1">VideoPlayerController</span> controller <span class="pl-k">=</span> <span class="pl-k">new</span> <span class="pl-c1">VideoPlayerController</span>.<span class="pl-en">network</span>(url);
<span class="pl-k">await</span> controller.<span class="pl-en">initialize</span>();
<span class="pl-k">await</span> controller.<span class="pl-en">setLooping</span>(<span class="pl-c1">true</span>);
replyPort.<span class="pl-en">send</span>(controller);
}
<span class="pl-c1">Future</span> <span class="pl-en">sendReceive</span>(<span class="pl-c1">SendPort</span> send, message) {
<span class="pl-k">final</span> <span class="pl-c1">ReceivePort</span> receivePort <span class="pl-k">=</span> <span class="pl-c1">ReceivePort</span>();
send.<span class="pl-en">send</span>([message, receivePort.sendPort]);
<span class="pl-k">return</span> receivePort.first;
}</pre></div>
<p dir="auto">But after first video initialized successfully, exception says those.<br>
Is this flutter error or am I missing something?</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" [VERBOSE-2:dart_isolate.cc(813)] Isolate (56689054) 'main.dart: isolateInit()' exited with an error
[VERBOSE-2:shell.cc(181)] Dart Error: Unhandled exception:
NoSuchMethodError: The method 'addObserver' was called on null.
Receiver: null
Tried calling: addObserver(Instance of '_VideoAppLifeCycleObserver')
#0 Object.noSuchMethod (dart:core/runtime/libobject_patch.dart:48:5)
#1 _VideoAppLifeCycleObserver.initialize (package:video_player/video_player.dart:398:29)
#2 VideoPlayerController.initialize (package:video_player/video_player.dart:187:24)
<asynchronous suspension>
#3 _SwiperScreenState. isolateInit (package:komama/video_swiper.dart:115:24)
<asynchronous suspension>
#4 _startIsolate.<anonymous closure> (dart:isolate/runtime/libisolate_patch.dart:292:17)
#5 _RawReceivePortImpl._handleMessage (dart:isolate/runtime/libisolate_patch.dart:171:12)"><pre class="notranslate"><code class="notranslate"> [VERBOSE-2:dart_isolate.cc(813)] Isolate (56689054) 'main.dart: isolateInit()' exited with an error
[VERBOSE-2:shell.cc(181)] Dart Error: Unhandled exception:
NoSuchMethodError: The method 'addObserver' was called on null.
Receiver: null
Tried calling: addObserver(Instance of '_VideoAppLifeCycleObserver')
#0 Object.noSuchMethod (dart:core/runtime/libobject_patch.dart:48:5)
#1 _VideoAppLifeCycleObserver.initialize (package:video_player/video_player.dart:398:29)
#2 VideoPlayerController.initialize (package:video_player/video_player.dart:187:24)
<asynchronous suspension>
#3 _SwiperScreenState. isolateInit (package:komama/video_swiper.dart:115:24)
<asynchronous suspension>
#4 _startIsolate.<anonymous closure> (dart:isolate/runtime/libisolate_patch.dart:292:17)
#5 _RawReceivePortImpl._handleMessage (dart:isolate/runtime/libisolate_patch.dart:171:12)
</code></pre></div>
<p dir="auto"><strong>Flutter doctor</strong></p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="[flutter] flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel beta, v0.7.3, on Mac OS X 10.13.6 17G65, locale pt-BR)
[!] Android toolchain - develop for Android devices (Android SDK 28.0.1)
! Some Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses
[✓] iOS toolchain - develop for iOS devices (Xcode 9.4.1)
[✓] Android Studio (version 3.1)
[✓] Connected devices (2 available)
! Doctor found issues in 1 category.
exit code 0"><pre class="notranslate"><code class="notranslate">[flutter] flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel beta, v0.7.3, on Mac OS X 10.13.6 17G65, locale pt-BR)
[!] Android toolchain - develop for Android devices (Android SDK 28.0.1)
! Some Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses
[✓] iOS toolchain - develop for iOS devices (Xcode 9.4.1)
[✓] Android Studio (version 3.1)
[✓] Connected devices (2 available)
! Doctor found issues in 1 category.
exit code 0
</code></pre></div> | <h2 dir="auto">Status</h2>
<p dir="auto">9/9/22: Work- in-progress</p>
<h2 dir="auto">Description</h2>
<p dir="auto">When I try to invoke a platform channel method from a custom spawned isolate, the app crashes badly (both on iOS and Android). I'm trying to figure out whether this is expected or not.</p>
<p dir="auto">If it's not, it's probably worth to mention that somewhere.</p>
<p dir="auto">Anyways I think that this can potentially be a strong limitation. Is there a way to be able to call platform plugins from a secondary isolate?</p>
<h2 dir="auto">PRs</h2>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> iOS Engine - <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="1329272252" data-permission-text="Title is private" data-url="https://github.com/flutter/engine/issues/35174" data-hovercard-type="pull_request" data-hovercard-url="/flutter/engine/pull/35174/hovercard" href="https://github.com/flutter/engine/pull/35174">flutter/engine#35174</a></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> iOS Framework - <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="1329273808" data-permission-text="Title is private" data-url="https://github.com/flutter/flutter/issues/109005" data-hovercard-type="pull_request" data-hovercard-url="/flutter/flutter/pull/109005/hovercard" href="https://github.com/flutter/flutter/pull/109005">#109005</a></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> Reland iOS Framework - <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="1368411373" data-permission-text="Title is private" data-url="https://github.com/flutter/flutter/issues/111320" data-hovercard-type="pull_request" data-hovercard-url="/flutter/flutter/pull/111320/hovercard" href="https://github.com/flutter/flutter/pull/111320">#111320</a></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> Android Engine - <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="1356086909" data-permission-text="Title is private" data-url="https://github.com/flutter/engine/issues/35804" data-hovercard-type="pull_request" data-hovercard-url="/flutter/engine/pull/35804/hovercard" href="https://github.com/flutter/engine/pull/35804">flutter/engine#35804</a></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> Android Framework - <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="1368087490" data-permission-text="Title is private" data-url="https://github.com/flutter/flutter/issues/111279" data-hovercard-type="pull_request" data-hovercard-url="/flutter/flutter/pull/111279/hovercard" href="https://github.com/flutter/flutter/pull/111279">#111279</a></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> Add macOS platform channel integration tests - <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="1356187128" data-permission-text="Title is private" data-url="https://github.com/flutter/flutter/issues/110606" data-hovercard-type="pull_request" data-hovercard-url="/flutter/flutter/pull/110606/hovercard" href="https://github.com/flutter/flutter/pull/110606">#110606</a></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> Desktop Engine - <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="1360597048" data-permission-text="Title is private" data-url="https://github.com/flutter/engine/issues/35893" data-hovercard-type="pull_request" data-hovercard-url="/flutter/engine/pull/35893/hovercard" href="https://github.com/flutter/engine/pull/35893">flutter/engine#35893</a></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> Desktop Framework - <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="1360596034" data-permission-text="Title is private" data-url="https://github.com/flutter/flutter/issues/110882" data-hovercard-type="pull_request" data-hovercard-url="/flutter/flutter/pull/110882/hovercard" href="https://github.com/flutter/flutter/pull/110882">#110882</a></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> Add samplecode - <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="1383102127" data-permission-text="Title is private" data-url="https://github.com/flutter/flutter/issues/112235" data-hovercard-type="issue" data-hovercard-url="/flutter/flutter/issues/112235/hovercard" href="https://github.com/flutter/flutter/issues/112235">#112235</a></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> Update website documentation - <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="1386862449" data-permission-text="Title is private" data-url="https://github.com/flutter/website/issues/7592" data-hovercard-type="pull_request" data-hovercard-url="/flutter/website/pull/7592/hovercard" href="https://github.com/flutter/website/pull/7592">flutter/website#7592</a></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> Make it work with plugins that require a dart plugin registrant - <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="1383132575" data-permission-text="Title is private" data-url="https://github.com/flutter/flutter/issues/112240" data-hovercard-type="issue" data-hovercard-url="/flutter/flutter/issues/112240/hovercard" href="https://github.com/flutter/flutter/issues/112240">#112240</a></li>
</ul> | 1 |
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have searched the <a href="https://github.com/apache/incubator-dubbo/issues">issues</a> of this repository and believe that this is not a duplicate.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have checked the <a href="https://github.com/apache/incubator-dubbo/blob/master/FAQ.md">FAQ</a> of this repository and believe that this is not a duplicate.</li>
</ul>
<h3 dir="auto">Environment</h3>
<ul dir="auto">
<li>Dubbo version: 2.7.0</li>
<li>Operating System version: Linux</li>
<li>Java version: Java 11</li>
</ul>
<h3 dir="auto">Steps to reproduce this issue</h3>
<p dir="auto">Travis CI failed with the following log<br>
<a href="https://api.travis-ci.org/v3/job/485054109/log.txt" rel="nofollow">https://api.travis-ci.org/v3/job/485054109/log.txt</a></p>
<h3 dir="auto">Expected Result</h3>
<p dir="auto">CI pass.</p>
<h3 dir="auto">Actual Result</h3>
<p dir="auto">CI Failure.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="[�[1;34mINFO�[m] Running org.apache.dubbo.registry.redis.�[1mRedisRegistryTest�[m
log4j:WARN No appenders could be found for logger (org.apache.dubbo.common.logger.LoggerFactory).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
[�[1;31mERROR�[m] �[1;31mTests �[0;1mrun: �[0;1m5�[m, Failures: 0, �[1;31mErrors: �[0;1;31m1�[m, Skipped: 0, Time elapsed: 1.202 s�[1;31m <<< FAILURE!�[m - in org.apache.dubbo.registry.redis.�[1mRedisRegistryTest�[m
[�[1;31mERROR�[m] testAnyHost Time elapsed: 0.201 s <<< ERROR!
redis.embedded.exceptions.EmbeddedRedisException: Failed to start Redis instance
at org.apache.dubbo.registry.redis.RedisRegistryTest.setUp(RedisRegistryTest.java:50)
Caused by: java.io.IOException: Cannot run program "/tmp/1548641223184-0/redis-server-2.8.19" (in directory "/tmp/1548641223184-0"): error=26, Text file busy
at org.apache.dubbo.registry.redis.RedisRegistryTest.setUp(RedisRegistryTest.java:50)
Caused by: java.io.IOException: error=26, Text file busy
at org.apache.dubbo.registry.redis.RedisRegistryTest.setUp(RedisRegistryTest.java:50)
[�[1;34mINFO�[m]
[�[1;34mINFO�[m] Results:
[�[1;34mINFO�[m]
[�[1;31mERROR�[m] �[1;31mErrors: �[m
[�[1;31mERROR�[m] �[1;31m RedisRegistryTest.setUp:50 » EmbeddedRedis Failed to start Redis instance�[m
[�[1;34mINFO�[m]
[�[1;31mERROR�[m] �[1;31mTests run: 5, Failures: 0, Errors: 1, Skipped: 0�[m"><pre class="notranslate"><code class="notranslate">[�[1;34mINFO�[m] Running org.apache.dubbo.registry.redis.�[1mRedisRegistryTest�[m
log4j:WARN No appenders could be found for logger (org.apache.dubbo.common.logger.LoggerFactory).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
[�[1;31mERROR�[m] �[1;31mTests �[0;1mrun: �[0;1m5�[m, Failures: 0, �[1;31mErrors: �[0;1;31m1�[m, Skipped: 0, Time elapsed: 1.202 s�[1;31m <<< FAILURE!�[m - in org.apache.dubbo.registry.redis.�[1mRedisRegistryTest�[m
[�[1;31mERROR�[m] testAnyHost Time elapsed: 0.201 s <<< ERROR!
redis.embedded.exceptions.EmbeddedRedisException: Failed to start Redis instance
at org.apache.dubbo.registry.redis.RedisRegistryTest.setUp(RedisRegistryTest.java:50)
Caused by: java.io.IOException: Cannot run program "/tmp/1548641223184-0/redis-server-2.8.19" (in directory "/tmp/1548641223184-0"): error=26, Text file busy
at org.apache.dubbo.registry.redis.RedisRegistryTest.setUp(RedisRegistryTest.java:50)
Caused by: java.io.IOException: error=26, Text file busy
at org.apache.dubbo.registry.redis.RedisRegistryTest.setUp(RedisRegistryTest.java:50)
[�[1;34mINFO�[m]
[�[1;34mINFO�[m] Results:
[�[1;34mINFO�[m]
[�[1;31mERROR�[m] �[1;31mErrors: �[m
[�[1;31mERROR�[m] �[1;31m RedisRegistryTest.setUp:50 » EmbeddedRedis Failed to start Redis instance�[m
[�[1;34mINFO�[m]
[�[1;31mERROR�[m] �[1;31mTests run: 5, Failures: 0, Errors: 1, Skipped: 0�[m
</code></pre></div> | <ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have searched the <a href="https://github.com/apache/incubator-dubbo/issues">issues</a> of this repository and believe that this is not a duplicate.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have checked the <a href="https://github.com/apache/incubator-dubbo/blob/master/FAQ.md">FAQ</a> of this repository and believe that this is not a duplicate.</li>
</ul>
<h3 dir="auto">Environment</h3>
<ul dir="auto">
<li>Dubbo version: master branch</li>
<li>Operating System version: macOS 10.13.6</li>
<li>Java version: 1.8</li>
</ul>
<h3 dir="auto">Step to reproduce this issue</h3>
<ol dir="auto">
<li>start the provider demo</li>
</ol>
<h3 dir="auto">Expected Result</h3>
<p dir="auto">Provider start success.</p>
<h3 dir="auto">Actual Result</h3>
<p dir="auto">Provider start failed.</p>
<p dir="auto">If there is an exception, please attach the exception trace:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Caused by: java.net.SocketException: Can't assign requested address
at java.net.PlainDatagramSocketImpl.join(Native Method)
at java.net.AbstractPlainDatagramSocketImpl.join(AbstractPlainDatagramSocketImpl.java:178)
at java.net.MulticastSocket.joinGroup(MulticastSocket.java:323)
at org.apache.dubbo.registry.multicast.MulticastRegistry.<init>(MulticastRegistry.java:91)
... 24 more"><pre class="notranslate"><code class="notranslate">Caused by: java.net.SocketException: Can't assign requested address
at java.net.PlainDatagramSocketImpl.join(Native Method)
at java.net.AbstractPlainDatagramSocketImpl.join(AbstractPlainDatagramSocketImpl.java:178)
at java.net.MulticastSocket.joinGroup(MulticastSocket.java:323)
at org.apache.dubbo.registry.multicast.MulticastRegistry.<init>(MulticastRegistry.java:91)
... 24 more
</code></pre></div>
<p dir="auto">If I add vm args <code class="notranslate">-Djava.net.preferIPv4Stack=true</code>, everything works fine.</p> | 0 |
<h3 dir="auto">Describe your issue.</h3>
<p dir="auto">Following up to <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="13650930" data-permission-text="Title is private" data-url="https://github.com/scipy/scipy/issues/1616" data-hovercard-type="issue" data-hovercard-url="/scipy/scipy/issues/1616/hovercard" href="https://github.com/scipy/scipy/issues/1616">#1616</a></p>
<p dir="auto">When the input for <code class="notranslate">distance_transform_edt</code> has no background, the results are unexpected.<br>
As in the previous issue, the expectation would be that the function would return an array of zeros.<br>
However, the output distances are based on the distance from (-1, 0), which seems incorrect.<br>
I'm currently having to check if the array has a background or not before using the function, but would like the function to have a more consistent output.</p>
<h3 dir="auto">Reproducing Code Example</h3>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="In [1]: import numpy as np
In [2]: from scipy.ndimage.morphology import distance_transform_edt
In [3]: distance_transform_edt(np.ones((3,3), dtype=int), return_indices=True)
Out[3]:
(array([[1. , 1.41421356, 2.23606798],
[2. , 2.23606798, 2.82842712],
[3. , 3.16227766, 3.60555128]]),
array([[[-1, -1, -1],
[-1, -1, -1],
[-1, -1, -1]],
[[ 0, 0, 0],
[ 0, 0, 0],
[ 0, 0, 0]]], dtype=int32))"><pre class="notranslate"><span class="pl-v">In</span> [<span class="pl-c1">1</span>]: <span class="pl-s1">import</span> <span class="pl-s1">numpy</span> <span class="pl-k">as</span> <span class="pl-s1">np</span>
<span class="pl-v">In</span> [<span class="pl-c1">2</span>]: <span class="pl-s1">from</span> <span class="pl-s1">scipy</span>.<span class="pl-s1">ndimage</span>.<span class="pl-s1">morphology</span> <span class="pl-s1">import</span> <span class="pl-s1">distance_transform_edt</span>
<span class="pl-v">In</span> [<span class="pl-c1">3</span>]: <span class="pl-en">distance_transform_edt</span>(<span class="pl-s1">np</span>.<span class="pl-en">ones</span>((<span class="pl-c1">3</span>,<span class="pl-c1">3</span>), <span class="pl-s1">dtype</span><span class="pl-c1">=</span><span class="pl-s1">int</span>), <span class="pl-s1">return_indices</span><span class="pl-c1">=</span><span class="pl-c1">True</span>)
<span class="pl-v">Out</span>[<span class="pl-c1">3</span>]:
(<span class="pl-en">array</span>([[<span class="pl-c1">1.</span> , <span class="pl-c1">1.41421356</span>, <span class="pl-c1">2.23606798</span>],
[<span class="pl-c1">2.</span> , <span class="pl-c1">2.23606798</span>, <span class="pl-c1">2.82842712</span>],
[<span class="pl-c1">3.</span> , <span class="pl-c1">3.16227766</span>, <span class="pl-c1">3.60555128</span>]]),
<span class="pl-en">array</span>([[[<span class="pl-c1">-</span><span class="pl-c1">1</span>, <span class="pl-c1">-</span><span class="pl-c1">1</span>, <span class="pl-c1">-</span><span class="pl-c1">1</span>],
[<span class="pl-c1">-</span><span class="pl-c1">1</span>, <span class="pl-c1">-</span><span class="pl-c1">1</span>, <span class="pl-c1">-</span><span class="pl-c1">1</span>],
[<span class="pl-c1">-</span><span class="pl-c1">1</span>, <span class="pl-c1">-</span><span class="pl-c1">1</span>, <span class="pl-c1">-</span><span class="pl-c1">1</span>]],
[[ <span class="pl-c1">0</span>, <span class="pl-c1">0</span>, <span class="pl-c1">0</span>],
[ <span class="pl-c1">0</span>, <span class="pl-c1">0</span>, <span class="pl-c1">0</span>],
[ <span class="pl-c1">0</span>, <span class="pl-c1">0</span>, <span class="pl-c1">0</span>]]], <span class="pl-s1">dtype</span><span class="pl-c1">=</span><span class="pl-s1">int32</span>))</pre></div>
<h3 dir="auto">Error message</h3>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="No error"><pre class="notranslate">No error</pre></div>
<h3 dir="auto">SciPy/NumPy/Python version information</h3>
<p dir="auto">1.7.3</p> | <p dir="auto"><em>Original ticket <a href="http://projects.scipy.org/scipy/ticket/1647" rel="nofollow">http://projects.scipy.org/scipy/ticket/1647</a> on 2012-04-22 by <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/WarrenWeckesser/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/WarrenWeckesser">@WarrenWeckesser</a>, assigned to unknown.</em></p>
<p dir="auto">The erlang distribution (in distributions.py) defines the method _arg_check instead of _argcheck, so it currently allows values for n that are not integers.</p> | 0 |
<blockquote>
<p dir="auto">Issue originally made by <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/spicyj/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/spicyj">@spicyj</a></p>
</blockquote>
<h3 dir="auto">Bug information</h3>
<ul dir="auto">
<li><strong>Babel version:</strong> 6.11.6</li>
<li><strong>Node version:</strong> 6</li>
<li><strong>npm version:</strong> 3</li>
</ul>
<h3 dir="auto">Description</h3>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="var traverse = require('babel-traverse').default, babylon = require('babylon');
traverse(babylon.parse('let x; let x;'))"><pre class="notranslate"><code class="notranslate">var traverse = require('babel-traverse').default, babylon = require('babylon');
traverse(babylon.parse('let x; let x;'))
</code></pre></div>
<p dir="auto">should throw an error about duplicate bindings, but it throws</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="TypeError: Cannot read property file of undefined
at Scope.checkBlockScopedCollisions (node_modules/babel-traverse/lib/scope/index.js:492:21)
at Scope.registerBinding (node_modules/babel-traverse/lib/scope/index.js:681:16)
at Scope.registerDeclaration (node_modules/babel-traverse/lib/scope/index.js:580:14)
...
at TraversalContext.visit (node_modules/babel-traverse/lib/context.js:219:19)
at Function.traverse.node (node_modules/babel-traverse/lib/index.js:171:17)
at traverse (node_modules/babel-traverse/lib/index.js:90:12)
at repl:1:81"><pre class="notranslate"><code class="notranslate">TypeError: Cannot read property file of undefined
at Scope.checkBlockScopedCollisions (node_modules/babel-traverse/lib/scope/index.js:492:21)
at Scope.registerBinding (node_modules/babel-traverse/lib/scope/index.js:681:16)
at Scope.registerDeclaration (node_modules/babel-traverse/lib/scope/index.js:580:14)
...
at TraversalContext.visit (node_modules/babel-traverse/lib/context.js:219:19)
at Function.traverse.node (node_modules/babel-traverse/lib/index.js:171:17)
at traverse (node_modules/babel-traverse/lib/index.js:90:12)
at repl:1:81
</code></pre></div>
<p dir="auto">instead because this.hub is undefined on this line: </p><div class="Box Box--condensed my-2">
<div class="Box-header f6">
<p class="mb-0 text-bold">
<a href="https://github.com/babel/babel/blob/dce9ee9d80547a421cf521a645b84049560647bd/packages/babel-traverse/src/scope/index.js#L350">babel/packages/babel-traverse/src/scope/index.js</a>
</p>
<p class="mb-0 color-fg-muted">
Line 350
in
<a data-pjax="true" class="commit-tease-sha" href="/babel/babel/commit/dce9ee9d80547a421cf521a645b84049560647bd">dce9ee9</a>
</p>
</div>
<div itemprop="text" class="Box-body p-0 blob-wrapper blob-wrapper-embedded data">
<table class="highlight tab-size mb-0 js-file-line-container" data-tab-size="8" data-paste-markdown-skip="">
<tbody><tr class="border-0">
<td id="L350" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="350"></td>
<td id="LC350" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-k">throw</span> <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">hub</span><span class="pl-kos">.</span><span class="pl-c1">file</span><span class="pl-kos">.</span><span class="pl-en">buildCodeFrameError</span><span class="pl-kos">(</span><span class="pl-s1">id</span><span class="pl-kos">,</span> <span class="pl-s1">messages</span><span class="pl-kos">.</span><span class="pl-en">get</span><span class="pl-kos">(</span><span class="pl-s">"scopeDuplicateDeclaration"</span><span class="pl-kos">,</span> <span class="pl-s1">name</span><span class="pl-kos">)</span><span class="pl-kos">,</span> <span class="pl-v">TypeError</span><span class="pl-kos">)</span><span class="pl-kos">;</span> </td>
</tr>
</tbody></table>
</div>
</div>
.<p></p>
<p dir="auto">Can we fix this as-is? Do I need to pass in a File object of some sort (how would I construct one)?</p>
<p dir="auto">(I'm actually passing <code class="notranslate">sourceFilename</code> and <code class="notranslate">code</code> to traverse already.)</p> | <p dir="auto">Since v1.11, 6to5 is modifying the source code in places where there are no es6 features.</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="var foo = function(bar) { this.foo = bar; };
var arr = [
'item1',
'item2',
...
];
var bar = 'bar',
baz = 'baz';"><pre class="notranslate"><span class="pl-k">var</span> <span class="pl-en">foo</span> <span class="pl-c1">=</span> <span class="pl-k">function</span><span class="pl-kos">(</span><span class="pl-s1">bar</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">foo</span> <span class="pl-c1">=</span> <span class="pl-s1">bar</span><span class="pl-kos">;</span> <span class="pl-kos">}</span><span class="pl-kos">;</span>
<span class="pl-k">var</span> <span class="pl-s1">arr</span> <span class="pl-c1">=</span> <span class="pl-kos">[</span>
<span class="pl-s">'item1'</span><span class="pl-kos">,</span>
<span class="pl-s">'item2'</span><span class="pl-kos">,</span>
...
<span class="pl-kos">]</span><span class="pl-kos">;</span>
<span class="pl-k">var</span> <span class="pl-s1">bar</span> <span class="pl-c1">=</span> <span class="pl-s">'bar'</span><span class="pl-kos">,</span>
<span class="pl-s1">baz</span> <span class="pl-c1">=</span> <span class="pl-s">'baz'</span><span class="pl-kos">;</span></pre></div>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="var foo = function (bar) {
this.foo = bar;
};
var arr = ["item1", "item2", ...];
var bar = "bar", baz = "baz";"><pre class="notranslate"><span class="pl-k">var</span> <span class="pl-en">foo</span> <span class="pl-c1">=</span> <span class="pl-k">function</span> <span class="pl-kos">(</span><span class="pl-s1">bar</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">foo</span> <span class="pl-c1">=</span> <span class="pl-s1">bar</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span><span class="pl-kos">;</span>
<span class="pl-k">var</span> <span class="pl-s1">arr</span> <span class="pl-c1">=</span> <span class="pl-kos">[</span><span class="pl-s">"item1"</span><span class="pl-kos">,</span> <span class="pl-s">"item2"</span><span class="pl-kos">,</span> ...<span class="pl-kos">]</span><span class="pl-kos">;</span>
<span class="pl-k">var</span> <span class="pl-s1">bar</span> <span class="pl-c1">=</span> <span class="pl-s">"bar"</span><span class="pl-kos">,</span> <span class="pl-s1">baz</span> <span class="pl-c1">=</span> <span class="pl-s">"baz"</span><span class="pl-kos">;</span></pre></div>
<p dir="auto">Some es6 features are also getting more modifications than before.</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="toString() {
return `${this.name}: ${this.message}` + (
this.url ? ` See: ${this.url}` : ''
);
}
// used to (<1.11) become:
toString: function() {
return "" + this.name + ": " + this.message + (
this.url ? " See: " + this.url : ''
);
}
// and is now (1.11)
toString: function() {
return "" + this.name + ": " + this.message + (this.url ? " See: " + this.url : "");
}"><pre class="notranslate"><span class="pl-en">toString</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-k">return</span> <span class="pl-s">`<span class="pl-s1"><span class="pl-kos">${</span><span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">name</span><span class="pl-kos">}</span></span>: <span class="pl-s1"><span class="pl-kos">${</span><span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">message</span><span class="pl-kos">}</span></span>`</span> <span class="pl-c1">+</span> <span class="pl-kos">(</span>
<span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">url</span> ? <span class="pl-s">` See: <span class="pl-s1"><span class="pl-kos">${</span><span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">url</span><span class="pl-kos">}</span></span>`</span> : <span class="pl-s">''</span>
<span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span>
<span class="pl-c">// used to (<1.11) become:</span>
toString: <span class="pl-k">function</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-k">return</span> <span class="pl-s">""</span> <span class="pl-c1">+</span> <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">name</span> <span class="pl-c1">+</span> <span class="pl-s">": "</span> <span class="pl-c1">+</span> <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">message</span> <span class="pl-c1">+</span> <span class="pl-kos">(</span>
<span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">url</span> ? <span class="pl-s">" See: "</span> <span class="pl-c1">+</span> <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">url</span> : <span class="pl-s">''</span>
<span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span>
<span class="pl-c">// and is now (1.11)</span>
toString: <span class="pl-k">function</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-k">return</span> <span class="pl-s">""</span> <span class="pl-c1">+</span> <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">name</span> <span class="pl-c1">+</span> <span class="pl-s">": "</span> <span class="pl-c1">+</span> <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">message</span> <span class="pl-c1">+</span> <span class="pl-kos">(</span><span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">url</span> ? <span class="pl-s">" See: "</span> <span class="pl-c1">+</span> <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">url</span> : <span class="pl-s">""</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span></pre></div> | 0 |
<p dir="auto">Apologies if this is a dupe.</p>
<p dir="auto">This doesn't compile:</p>
<div class="highlight highlight-source-rust notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="fn main() {
match 25u8 {
0 ... 24 => println!("less than 25"),
25 => println!("exactly 25"),
26 ... 255 => println!("above 25")
}
}"><pre class="notranslate"><span class="pl-k">fn</span> <span class="pl-en">main</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-k">match</span> <span class="pl-c1">25u8</span> <span class="pl-kos">{</span>
<span class="pl-c1">0</span> ... <span class="pl-c1">24</span> => <span class="pl-en">println</span><span class="pl-en">!</span><span class="pl-kos">(</span><span class="pl-s">"less than 25"</span><span class="pl-kos">)</span><span class="pl-kos">,</span>
<span class="pl-c1">25</span> => <span class="pl-en">println</span><span class="pl-en">!</span><span class="pl-kos">(</span><span class="pl-s">"exactly 25"</span><span class="pl-kos">)</span><span class="pl-kos">,</span>
<span class="pl-c1">26</span> ... <span class="pl-c1">255</span> => <span class="pl-en">println</span><span class="pl-en">!</span><span class="pl-kos">(</span><span class="pl-s">"above 25"</span><span class="pl-kos">)</span>
<span class="pl-kos">}</span>
<span class="pl-kos">}</span></pre></div>
<p dir="auto">Error message:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="<anon>:2:5: 6:6 error: non-exhaustive patterns: `_` not covered [E0004]
<anon>:2 match 25u8 {
<anon>:3 0 ... 24 => println!("less than 25"),
<anon>:4 25 => println!("exactly 25"),
<anon>:5 26 ... 255 => println!("above 25")
<anon>:6 }
<anon>:2:5: 6:6 help: see the detailed explanation for E0004
error: aborting due to previous error"><pre class="notranslate"><code class="notranslate"><anon>:2:5: 6:6 error: non-exhaustive patterns: `_` not covered [E0004]
<anon>:2 match 25u8 {
<anon>:3 0 ... 24 => println!("less than 25"),
<anon>:4 25 => println!("exactly 25"),
<anon>:5 26 ... 255 => println!("above 25")
<anon>:6 }
<anon>:2:5: 6:6 help: see the detailed explanation for E0004
error: aborting due to previous error
</code></pre></div>
<p dir="auto">The compiler isn't actually checking whether all the values for <code class="notranslate">u8</code> are covered, it's just checking whether or not there's a case for <code class="notranslate">_</code>.</p>
<p dir="auto">I've created some code that takes a <code class="notranslate">Range<T></code> (the 'all-encompassing' range, i.e. <code class="notranslate">0...255</code> for <code class="notranslate">u8</code>) and <code class="notranslate">Vec<Range<T>> where T: Ord + Copy</code> and determines which ranges (if any) are not covered by the ranges provided by the vector. However, this code needs proper inclusive range support in order to work; I can't add 1 to the maximum value of a type in order to make it include every possible value for that type. That is available <a href="https://gist.github.com/aarzee/4395cb34eef31ea4e5c4">here</a>.</p>
<p dir="auto">I'm interested in implementing this logic in the compiler but I've no idea where to start, plus the code has the aforementioned inclusive range requirement.</p> | <p dir="auto">The following function does not compile because rustc determines that the patterns in the match statement are non-exhaustive. However, the pattern matches every possible value of the integer type, and the compiler should be able to detect this.</p>
<div class="highlight highlight-source-rust notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="fn wont_compile(x : u8) {
match (x) {
0x00 .. 0xff => { }
}
}"><pre class="notranslate"><span class="pl-k">fn</span> <span class="pl-en">wont_compile</span><span class="pl-kos">(</span><span class="pl-s1">x</span> <span class="pl-kos">:</span> <span class="pl-smi">u8</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-k">match</span> <span class="pl-kos">(</span>x<span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-c1">0x00</span> .. <span class="pl-c1">0xff</span> => <span class="pl-kos">{</span> <span class="pl-kos">}</span>
<span class="pl-kos">}</span>
<span class="pl-kos">}</span></pre></div> | 1 |
<p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=nibe01" rel="nofollow">Nikos Beis</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-5476?redirect=false" rel="nofollow">SPR-5476</a></strong> and commented</p>
<p dir="auto">When using many property files and a cacheSeconds value of bigger than 0 the lookup time increases rapidly. I saw a 15% performance boost in my application when putting all my properties in the same file. The problem is the nested for loops in resolveCode and resolveCodeWithoutArguments.</p>
<hr>
<p dir="auto"><strong>Issue Links:</strong></p>
<ul dir="auto">
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398158657" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/15133" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/15133/hovercard" href="https://github.com/spring-projects/spring-framework/issues/15133">#15133</a> ReloadableResourceBundleMessageSource locks properties hashmap and fails under load. (<em><strong>"duplicates"</strong></em>)</li>
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398157460" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/14948" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/14948/hovercard" href="https://github.com/spring-projects/spring-framework/issues/14948">#14948</a> Allow adding resources to ReloadableResourceBundleMessageSource</li>
</ul>
<p dir="auto">3 votes, 6 watchers</p> | <p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=difranr" rel="nofollow">Ronald R. DiFrango</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-10500?redirect=false" rel="nofollow">SPR-10500</a></strong> and commented</p>
<p dir="auto">The ReloadableResourceBundleMessageSource class locks the whole hashmap that holds properties and in our case is making the network call (after acquiring lock). This terribly slows down the property look-up. Under load it’s more significant as multiple threads could potentially try to load the files if there is a timeout.</p>
<p dir="auto">Ideally we’d like a background thread load the properties after a timeout and put them into hashmap without locking as we are read-heavy and can tolerate stale entries.</p>
<p dir="auto">Another option is to use a concurrent hashmap. Therefore the change for RRB should allow a backing map and whether to lock or not.</p>
<p dir="auto">Here is the stack trace, notice the line in red is holding lock on a hashmap, which is the hashmap that holds properties:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=""[ACTIVE] ExecuteThread: '150' for queue: 'weblogic.kernel.Default (self-tuning)'" id=8927 idx=0x2fc tid=30297 prio=5 alive, native_blocked, daemon
at jrockit/net/SocketNativeIO.readBytesPinned(Ljava/io/FileDescriptor;[BIII)I(Native Method)
at jrockit/net/SocketNativeIO.socketRead(SocketNativeIO.java:32)[inlined]
at java/net/SocketInputStream.socketRead0(Ljava/io/FileDescriptor;[BIII)I(SocketInputStream.java)[inlined]
at java/net/SocketInputStream.read(SocketInputStream.java:129)[optimized]
at java/io/BufferedInputStream.fill(BufferedInputStream.java:218)
at java/io/BufferedInputStream.read1(BufferedInputStream.java:258)[optimized]
at java/io/BufferedInputStream.read(BufferedInputStream.java:317)[optimized]
^-- Holding lock: java/io/BufferedInputStream@0x10f0f4cc0[thin lock]
at weblogic/net/http/MessageHeader.isHTTP(MessageHeader.java:224)
at weblogic/net/http/MessageHeader.parseHeader(MessageHeader.java:148)[optimized]
at weblogic/net/http/HttpClient.parseHTTP(HttpClient.java:468)[optimized]
at weblogic/net/http/HttpURLConnection.getInputStream(HttpURLConnection.java:395)[inlined]
at weblogic/net/http/SOAPHttpURLConnection.getInputStream(SOAPHttpURLConnection.java:37)[optimized]
^-- Holding lock: weblogic/net/http/SOAPHttpURLConnection@0x10f0f2550[biased lock]
at weblogic/net/http/HttpURLConnection.getResponseCode(HttpURLConnection.java:983)[optimized]
at org/springframework/core/io/AbstractFileResolvingResource.exists(AbstractFileResolvingResource.java:103)[optimized]
at com/capitalone/epf/context/support/ReloadableResourceBundleMessageSource.refreshProperties(ReloadableResourceBundleMessageSource.java:131)[optimized]
at org/springframework/context/support/ReloadableResourceBundleMessageSource.getProperties(ReloadableResourceBundleMessageSource.java:439)[inlined]
at org/springframework/context/support/ReloadableResourceBundleMessageSource.resolveCodeWithoutArguments(ReloadableResourceBundleMessageSource.java:272)[optimized]
^-- Holding lock: java/util/HashMap@0x10d49e228[fat lock]
at org/springframework/context/support/AbstractMessageSource.getMessageInternal(AbstractMessageSource.java:193)[inlined]
at org/springframework/context/support/AbstractMessageSource.getMessage(AbstractMessageSource.java:127)[optimized]
at org/springframework/context/support/AbstractApplicationContext.getMessage(AbstractApplicationContext.java:1210)[optimized]
at org/springframework/web/servlet/tags/MessageTag.resolveMessage(MessageTag.java:227)[inlined]
at org/springframework/web/servlet/tags/MessageTag.doStartTagInternal(MessageTag.java:165)[optimized]
at org/springframework/web/servlet/tags/RequestContextAwareTag.doStartTag(RequestContextAwareTag.java:79)[optimized]
at jsp_servlet/_web_45_inf/_views/__viewrequiredinformation._jsp__tag12(__viewrequiredinformation.java:1381)
at jsp_servlet/_web_45_inf/_views/__viewrequiredinformation._jspService(__viewrequiredinformation.java:441)
at weblogic/servlet/jsp/JspBase.service(JspBase.java:34)[optimized]
at weblogic/servlet/internal/StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)[optimized]
at weblogic/servlet/internal/StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)[inlined]
at weblogic/servlet/internal/ServletStubImpl.execute(ServletStubImpl.java:300)[optimized]
at weblogic/servlet/internal/ServletStubImpl.execute(ServletStubImpl.java:183)[inlined]
at weblogic/servlet/internal/RequestDispatcherImpl.invokeServlet(RequestDispatcherImpl.java:523)[optimized]
at weblogic/servlet/internal/RequestDispatcherImpl.forward(RequestDispatcherImpl.java:253)[optimized]
at org/springframework/web/servlet/view/InternalResourceView.renderMergedOutputModel(InternalResourceView.java:238)[optimized]
at org/springframework/web/servlet/view/AbstractView.render(AbstractView.java:262)[optimized]
at org/springframework/web/servlet/DispatcherServlet.render(DispatcherServlet.java:1157)[optimized]
at org/springframework/web/servlet/DispatcherServlet.doDispatch(DispatcherServlet.java:927)[optimized]
at org/springframework/web/servlet/DispatcherServlet.doService(DispatcherServlet.java:827)[inlined]
at org/springframework/web/servlet/FrameworkServlet.processRequest(FrameworkServlet.java:882)[inlined]
at org/springframework/web/servlet/FrameworkServlet.doGet(FrameworkServlet.java:778)[optimized]
at javax/servlet/http/HttpServlet.service(HttpServlet.java:707)[optimized]
at javax/servlet/http/HttpServlet.service(HttpServlet.java:820)[optimized]
at weblogic/servlet/internal/StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)[optimized]
at weblogic/servlet/internal/StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)[inlined]
at weblogic/servlet/internal/ServletStubImpl.execute(ServletStubImpl.java:300)[optimized]
at weblogic/servlet/internal/TailFilter.doFilter(TailFilter.java:26)[optimized]
at weblogic/servlet/internal/FilterChainImpl.doFilter(FilterChainImpl.java:56)[optimized]
at com/capitalone/epf/context/filters/EPFContextServletFilter.doFilter(EPFContextServletFilter.java:89)[optimized]
at weblogic/servlet/internal/FilterChainImpl.doFilter(FilterChainImpl.java:56)[inlined]
at weblogic/servlet/internal/WebAppServletContext$ServletInvocationAction.wrapRun(Lweblogic/servlet/internal/ServletStubImpl;Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)Ljava/lang/Object;(Unknown Source)[inlined]
at weblogic/servlet/internal/WebAppServletContext$ServletInvocationAction.run()Ljava/lang/Object;(Unknown Source)[optimized]
at weblogic/security/acl/internal/AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)[optimized]
at weblogic/security/service/SecurityManager.runAs(SecurityManager.java:120)[inlined]
at weblogic/servlet/internal/WebAppServletContext.securedExecute(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;Z)V(Unknown Source)[inlined]
at weblogic/servlet/internal/WebAppServletContext.execute(Lweblogic/servlet/internal/ServletRequestImpl;Lweblogic/servlet/internal/ServletResponseImpl;)V(Unknown Source)[optimized]
at weblogic/servlet/internal/ServletRequestImpl.run()V(Unknown Source)[optimized]
at weblogic/work/ExecuteThread.execute(ExecuteThread.java:209)[inlined]
at weblogic/work/ExecuteThread.run(ExecuteThread.java:178)[optimized]
at jrockit/vm/RNI.c2java(JJJJJ)V(Native Method)"><pre class="notranslate"><code class="notranslate">"[ACTIVE] ExecuteThread: '150' for queue: 'weblogic.kernel.Default (self-tuning)'" id=8927 idx=0x2fc tid=30297 prio=5 alive, native_blocked, daemon
at jrockit/net/SocketNativeIO.readBytesPinned(Ljava/io/FileDescriptor;[BIII)I(Native Method)
at jrockit/net/SocketNativeIO.socketRead(SocketNativeIO.java:32)[inlined]
at java/net/SocketInputStream.socketRead0(Ljava/io/FileDescriptor;[BIII)I(SocketInputStream.java)[inlined]
at java/net/SocketInputStream.read(SocketInputStream.java:129)[optimized]
at java/io/BufferedInputStream.fill(BufferedInputStream.java:218)
at java/io/BufferedInputStream.read1(BufferedInputStream.java:258)[optimized]
at java/io/BufferedInputStream.read(BufferedInputStream.java:317)[optimized]
^-- Holding lock: java/io/BufferedInputStream@0x10f0f4cc0[thin lock]
at weblogic/net/http/MessageHeader.isHTTP(MessageHeader.java:224)
at weblogic/net/http/MessageHeader.parseHeader(MessageHeader.java:148)[optimized]
at weblogic/net/http/HttpClient.parseHTTP(HttpClient.java:468)[optimized]
at weblogic/net/http/HttpURLConnection.getInputStream(HttpURLConnection.java:395)[inlined]
at weblogic/net/http/SOAPHttpURLConnection.getInputStream(SOAPHttpURLConnection.java:37)[optimized]
^-- Holding lock: weblogic/net/http/SOAPHttpURLConnection@0x10f0f2550[biased lock]
at weblogic/net/http/HttpURLConnection.getResponseCode(HttpURLConnection.java:983)[optimized]
at org/springframework/core/io/AbstractFileResolvingResource.exists(AbstractFileResolvingResource.java:103)[optimized]
at com/capitalone/epf/context/support/ReloadableResourceBundleMessageSource.refreshProperties(ReloadableResourceBundleMessageSource.java:131)[optimized]
at org/springframework/context/support/ReloadableResourceBundleMessageSource.getProperties(ReloadableResourceBundleMessageSource.java:439)[inlined]
at org/springframework/context/support/ReloadableResourceBundleMessageSource.resolveCodeWithoutArguments(ReloadableResourceBundleMessageSource.java:272)[optimized]
^-- Holding lock: java/util/HashMap@0x10d49e228[fat lock]
at org/springframework/context/support/AbstractMessageSource.getMessageInternal(AbstractMessageSource.java:193)[inlined]
at org/springframework/context/support/AbstractMessageSource.getMessage(AbstractMessageSource.java:127)[optimized]
at org/springframework/context/support/AbstractApplicationContext.getMessage(AbstractApplicationContext.java:1210)[optimized]
at org/springframework/web/servlet/tags/MessageTag.resolveMessage(MessageTag.java:227)[inlined]
at org/springframework/web/servlet/tags/MessageTag.doStartTagInternal(MessageTag.java:165)[optimized]
at org/springframework/web/servlet/tags/RequestContextAwareTag.doStartTag(RequestContextAwareTag.java:79)[optimized]
at jsp_servlet/_web_45_inf/_views/__viewrequiredinformation._jsp__tag12(__viewrequiredinformation.java:1381)
at jsp_servlet/_web_45_inf/_views/__viewrequiredinformation._jspService(__viewrequiredinformation.java:441)
at weblogic/servlet/jsp/JspBase.service(JspBase.java:34)[optimized]
at weblogic/servlet/internal/StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)[optimized]
at weblogic/servlet/internal/StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)[inlined]
at weblogic/servlet/internal/ServletStubImpl.execute(ServletStubImpl.java:300)[optimized]
at weblogic/servlet/internal/ServletStubImpl.execute(ServletStubImpl.java:183)[inlined]
at weblogic/servlet/internal/RequestDispatcherImpl.invokeServlet(RequestDispatcherImpl.java:523)[optimized]
at weblogic/servlet/internal/RequestDispatcherImpl.forward(RequestDispatcherImpl.java:253)[optimized]
at org/springframework/web/servlet/view/InternalResourceView.renderMergedOutputModel(InternalResourceView.java:238)[optimized]
at org/springframework/web/servlet/view/AbstractView.render(AbstractView.java:262)[optimized]
at org/springframework/web/servlet/DispatcherServlet.render(DispatcherServlet.java:1157)[optimized]
at org/springframework/web/servlet/DispatcherServlet.doDispatch(DispatcherServlet.java:927)[optimized]
at org/springframework/web/servlet/DispatcherServlet.doService(DispatcherServlet.java:827)[inlined]
at org/springframework/web/servlet/FrameworkServlet.processRequest(FrameworkServlet.java:882)[inlined]
at org/springframework/web/servlet/FrameworkServlet.doGet(FrameworkServlet.java:778)[optimized]
at javax/servlet/http/HttpServlet.service(HttpServlet.java:707)[optimized]
at javax/servlet/http/HttpServlet.service(HttpServlet.java:820)[optimized]
at weblogic/servlet/internal/StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)[optimized]
at weblogic/servlet/internal/StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)[inlined]
at weblogic/servlet/internal/ServletStubImpl.execute(ServletStubImpl.java:300)[optimized]
at weblogic/servlet/internal/TailFilter.doFilter(TailFilter.java:26)[optimized]
at weblogic/servlet/internal/FilterChainImpl.doFilter(FilterChainImpl.java:56)[optimized]
at com/capitalone/epf/context/filters/EPFContextServletFilter.doFilter(EPFContextServletFilter.java:89)[optimized]
at weblogic/servlet/internal/FilterChainImpl.doFilter(FilterChainImpl.java:56)[inlined]
at weblogic/servlet/internal/WebAppServletContext$ServletInvocationAction.wrapRun(Lweblogic/servlet/internal/ServletStubImpl;Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)Ljava/lang/Object;(Unknown Source)[inlined]
at weblogic/servlet/internal/WebAppServletContext$ServletInvocationAction.run()Ljava/lang/Object;(Unknown Source)[optimized]
at weblogic/security/acl/internal/AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)[optimized]
at weblogic/security/service/SecurityManager.runAs(SecurityManager.java:120)[inlined]
at weblogic/servlet/internal/WebAppServletContext.securedExecute(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;Z)V(Unknown Source)[inlined]
at weblogic/servlet/internal/WebAppServletContext.execute(Lweblogic/servlet/internal/ServletRequestImpl;Lweblogic/servlet/internal/ServletResponseImpl;)V(Unknown Source)[optimized]
at weblogic/servlet/internal/ServletRequestImpl.run()V(Unknown Source)[optimized]
at weblogic/work/ExecuteThread.execute(ExecuteThread.java:209)[inlined]
at weblogic/work/ExecuteThread.run(ExecuteThread.java:178)[optimized]
at jrockit/vm/RNI.c2java(JJJJJ)V(Native Method)
</code></pre></div>
<p dir="auto">Now here are the lookup threads waiting on the lock [under load you could have literally hundreds as in our case]:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="[ACTIVE] ExecuteThread: '146' for queue: 'weblogic.kernel.Default (self-tuning)'" id=8923 idx=0x300 tid=30008 prio=5 alive, blocked, native_blocked, daemon
-- Blocked trying to get lock: java/util/HashMap@0x10d49e228[fat lock]
at jrockit/vm/Threads.waitForUnblockSignal()V(Native Method)
at jrockit/vm/Locks.fatLockBlockOrSpin(Locks.java:1411)[optimized]
at jrockit/vm/Locks.lockFat(Locks.java:1512)[optimized]
at jrockit/vm/Locks.monitorEnterSecondStageHard(Locks.java:1054)[optimized]
at jrockit/vm/Locks.monitorEnterSecondStage(Locks.java:1005)[optimized]
at org/springframework/context/support/ReloadableResourceBundleMessageSource.getProperties(ReloadableResourceBundleMessageSource.java:431)[inlined]
at org/springframework/context/support/ReloadableResourceBundleMessageSource.resolveCodeWithoutArguments(ReloadableResourceBundleMessageSource.java:272)[optimized]
at org/springframework/context/support/AbstractMessageSource.getMessageInternal(AbstractMessageSource.java:193)[inlined]
at org/springframework/context/support/AbstractMessageSource.getMessage(AbstractMessageSource.java:127)[optimized]
at org/springframework/context/support/AbstractApplicationContext.getMessage(AbstractApplicationContext.java:1210)[optimized]
at org/springframework/web/servlet/tags/MessageTag.resolveMessage(MessageTag.java:227)[inlined]
at org/springframework/web/servlet/tags/MessageTag.doStartTagInternal(MessageTag.java:165)[optimized]
at org/springframework/web/servlet/tags/RequestContextAwareTag.doStartTag(RequestContextAwareTag.java:79)[optimized]
at jsp_servlet/_web_45_inf/_views/__viewpaymentsalerts._jsp__tag34(__viewpaymentsalerts.java:2695)
at jsp_servlet/_web_45_inf/_views/__viewpaymentsalerts._jsp__tag30(__viewpaymentsalerts.java:2523)
at jsp_servlet/_web_45_inf/_views/__viewpaymentsalerts._jspService(__viewpaymentsalerts.java:601)
at weblogic/servlet/jsp/JspBase.service(JspBase.java:34)[optimized]
at weblogic/servlet/internal/StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)[optimized]
at weblogic/servlet/internal/StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)[inlined]
at weblogic/servlet/internal/ServletStubImpl.execute(ServletStubImpl.java:300)[optimized]
at weblogic/servlet/internal/ServletStubImpl.execute(ServletStubImpl.java:183)[inlined]
at weblogic/servlet/internal/RequestDispatcherImpl.invokeServlet(RequestDispatcherImpl.java:523)[optimized]
at weblogic/servlet/internal/RequestDispatcherImpl.forward(RequestDispatcherImpl.java:253)[optimized]
at org/springframework/web/servlet/view/InternalResourceView.renderMergedOutputModel(InternalResourceView.java:238)[optimized]
at org/springframework/web/servlet/view/AbstractView.render(AbstractView.java:262)[optimized]
at org/springframework/web/servlet/DispatcherServlet.render(DispatcherServlet.java:1157)[optimized]
at org/springframework/web/servlet/DispatcherServlet.doDispatch(DispatcherServlet.java:927)[optimized]
at org/springframework/web/servlet/DispatcherServlet.doService(DispatcherServlet.java:827)[inlined]
at org/springframework/web/servlet/FrameworkServlet.processRequest(FrameworkServlet.java:882)[inlined]
at org/springframework/web/servlet/FrameworkServlet.doGet(FrameworkServlet.java:778)[optimized]
at javax/servlet/http/HttpServlet.service(HttpServlet.java:707)[optimized]
at javax/servlet/http/HttpServlet.service(HttpServlet.java:820)[optimized]
at weblogic/servlet/internal/StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)[optimized]
at weblogic/servlet/internal/StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)[inlined]
at weblogic/servlet/internal/ServletStubImpl.execute(ServletStubImpl.java:300)[optimized]
at weblogic/servlet/internal/TailFilter.doFilter(TailFilter.java:26)[optimized]
at weblogic/servlet/internal/FilterChainImpl.doFilter(FilterChainImpl.java:56)[optimized]
at com/capitalone/epf/context/filters/EPFContextServletFilter.doFilter(EPFContextServletFilter.java:89)[optimized]
at weblogic/servlet/internal/FilterChainImpl.doFilter(FilterChainImpl.java:56)[inlined]
at weblogic/servlet/internal/WebAppServletContext$ServletInvocationAction.wrapRun(Lweblogic/servlet/internal/ServletStubImpl;Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)Ljava/lang/Object;(Unknown Source)[inlined]
at weblogic/servlet/internal/WebAppServletContext$ServletInvocationAction.run()Ljava/lang/Object;(Unknown Source)[optimized]
at weblogic/security/acl/internal/AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)[optimized]
at weblogic/security/service/SecurityManager.runAs(SecurityManager.java:120)[inlined]
at weblogic/servlet/internal/WebAppServletContext.securedExecute(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;Z)V(Unknown Source)[inlined]
at weblogic/servlet/internal/WebAppServletContext.execute(Lweblogic/servlet/internal/ServletRequestImpl;Lweblogic/servlet/internal/ServletResponseImpl;)V(Unknown Source)[optimized]
at weblogic/servlet/internal/ServletRequestImpl.run()V(Unknown Source)[optimized]
at weblogic/work/ExecuteThread.execute(ExecuteThread.java:209)[inlined]
at weblogic/work/ExecuteThread.run(ExecuteThread.java:178)[optimized]
at jrockit/vm/RNI.c2java(JJJJJ)V(Native Method)"><pre class="notranslate"><code class="notranslate">[ACTIVE] ExecuteThread: '146' for queue: 'weblogic.kernel.Default (self-tuning)'" id=8923 idx=0x300 tid=30008 prio=5 alive, blocked, native_blocked, daemon
-- Blocked trying to get lock: java/util/HashMap@0x10d49e228[fat lock]
at jrockit/vm/Threads.waitForUnblockSignal()V(Native Method)
at jrockit/vm/Locks.fatLockBlockOrSpin(Locks.java:1411)[optimized]
at jrockit/vm/Locks.lockFat(Locks.java:1512)[optimized]
at jrockit/vm/Locks.monitorEnterSecondStageHard(Locks.java:1054)[optimized]
at jrockit/vm/Locks.monitorEnterSecondStage(Locks.java:1005)[optimized]
at org/springframework/context/support/ReloadableResourceBundleMessageSource.getProperties(ReloadableResourceBundleMessageSource.java:431)[inlined]
at org/springframework/context/support/ReloadableResourceBundleMessageSource.resolveCodeWithoutArguments(ReloadableResourceBundleMessageSource.java:272)[optimized]
at org/springframework/context/support/AbstractMessageSource.getMessageInternal(AbstractMessageSource.java:193)[inlined]
at org/springframework/context/support/AbstractMessageSource.getMessage(AbstractMessageSource.java:127)[optimized]
at org/springframework/context/support/AbstractApplicationContext.getMessage(AbstractApplicationContext.java:1210)[optimized]
at org/springframework/web/servlet/tags/MessageTag.resolveMessage(MessageTag.java:227)[inlined]
at org/springframework/web/servlet/tags/MessageTag.doStartTagInternal(MessageTag.java:165)[optimized]
at org/springframework/web/servlet/tags/RequestContextAwareTag.doStartTag(RequestContextAwareTag.java:79)[optimized]
at jsp_servlet/_web_45_inf/_views/__viewpaymentsalerts._jsp__tag34(__viewpaymentsalerts.java:2695)
at jsp_servlet/_web_45_inf/_views/__viewpaymentsalerts._jsp__tag30(__viewpaymentsalerts.java:2523)
at jsp_servlet/_web_45_inf/_views/__viewpaymentsalerts._jspService(__viewpaymentsalerts.java:601)
at weblogic/servlet/jsp/JspBase.service(JspBase.java:34)[optimized]
at weblogic/servlet/internal/StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)[optimized]
at weblogic/servlet/internal/StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)[inlined]
at weblogic/servlet/internal/ServletStubImpl.execute(ServletStubImpl.java:300)[optimized]
at weblogic/servlet/internal/ServletStubImpl.execute(ServletStubImpl.java:183)[inlined]
at weblogic/servlet/internal/RequestDispatcherImpl.invokeServlet(RequestDispatcherImpl.java:523)[optimized]
at weblogic/servlet/internal/RequestDispatcherImpl.forward(RequestDispatcherImpl.java:253)[optimized]
at org/springframework/web/servlet/view/InternalResourceView.renderMergedOutputModel(InternalResourceView.java:238)[optimized]
at org/springframework/web/servlet/view/AbstractView.render(AbstractView.java:262)[optimized]
at org/springframework/web/servlet/DispatcherServlet.render(DispatcherServlet.java:1157)[optimized]
at org/springframework/web/servlet/DispatcherServlet.doDispatch(DispatcherServlet.java:927)[optimized]
at org/springframework/web/servlet/DispatcherServlet.doService(DispatcherServlet.java:827)[inlined]
at org/springframework/web/servlet/FrameworkServlet.processRequest(FrameworkServlet.java:882)[inlined]
at org/springframework/web/servlet/FrameworkServlet.doGet(FrameworkServlet.java:778)[optimized]
at javax/servlet/http/HttpServlet.service(HttpServlet.java:707)[optimized]
at javax/servlet/http/HttpServlet.service(HttpServlet.java:820)[optimized]
at weblogic/servlet/internal/StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)[optimized]
at weblogic/servlet/internal/StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)[inlined]
at weblogic/servlet/internal/ServletStubImpl.execute(ServletStubImpl.java:300)[optimized]
at weblogic/servlet/internal/TailFilter.doFilter(TailFilter.java:26)[optimized]
at weblogic/servlet/internal/FilterChainImpl.doFilter(FilterChainImpl.java:56)[optimized]
at com/capitalone/epf/context/filters/EPFContextServletFilter.doFilter(EPFContextServletFilter.java:89)[optimized]
at weblogic/servlet/internal/FilterChainImpl.doFilter(FilterChainImpl.java:56)[inlined]
at weblogic/servlet/internal/WebAppServletContext$ServletInvocationAction.wrapRun(Lweblogic/servlet/internal/ServletStubImpl;Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)Ljava/lang/Object;(Unknown Source)[inlined]
at weblogic/servlet/internal/WebAppServletContext$ServletInvocationAction.run()Ljava/lang/Object;(Unknown Source)[optimized]
at weblogic/security/acl/internal/AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)[optimized]
at weblogic/security/service/SecurityManager.runAs(SecurityManager.java:120)[inlined]
at weblogic/servlet/internal/WebAppServletContext.securedExecute(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;Z)V(Unknown Source)[inlined]
at weblogic/servlet/internal/WebAppServletContext.execute(Lweblogic/servlet/internal/ServletRequestImpl;Lweblogic/servlet/internal/ServletResponseImpl;)V(Unknown Source)[optimized]
at weblogic/servlet/internal/ServletRequestImpl.run()V(Unknown Source)[optimized]
at weblogic/work/ExecuteThread.execute(ExecuteThread.java:209)[inlined]
at weblogic/work/ExecuteThread.run(ExecuteThread.java:178)[optimized]
at jrockit/vm/RNI.c2java(JJJJJ)V(Native Method)
</code></pre></div>
<hr>
<p dir="auto"><strong>Affects:</strong> 3.1 GA</p>
<p dir="auto"><strong>Attachments:</strong></p>
<ul dir="auto">
<li><a href="https://jira.spring.io/secure/attachment/22100/ReloadableResourceBundleMessageSource.java" rel="nofollow">ReloadableResourceBundleMessageSource.java</a> (<em>26.71 kB</em>)</li>
</ul>
<p dir="auto"><strong>Issue Links:</strong></p>
<ul dir="auto">
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398093191" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/10149" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/10149/hovercard" href="https://github.com/spring-projects/spring-framework/issues/10149">#10149</a> ReloadableResourceBundleMessageSource performance issue when using many resource files (<em><strong>"is duplicated by"</strong></em>)</li>
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398196803" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/19152" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/19152/hovercard" href="https://github.com/spring-projects/spring-framework/issues/19152">#19152</a> Method getMergedProperties in ReloadableResourceBundleMessageSource does not set fileTimestamp</li>
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398219295" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/20782" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/20782/hovercard" href="https://github.com/spring-projects/spring-framework/issues/20782">#20782</a> Remove synchronization from ResourceBundleMessageSource</li>
</ul>
<p dir="auto"><strong>Referenced from:</strong> commits <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/spring-projects/spring-framework/commit/a000dd782a74bb27484e2d76760e76e8398a32e8/hovercard" href="https://github.com/spring-projects/spring-framework/commit/a000dd782a74bb27484e2d76760e76e8398a32e8"><tt>a000dd7</tt></a></p>
<p dir="auto">7 votes, 6 watchers</p> | 1 |
<p dir="auto"><strong>Is this a request for help?</strong> (If yes, you should use our troubleshooting guide and community support channels, see <a href="http://kubernetes.io/docs/troubleshooting/" rel="nofollow">http://kubernetes.io/docs/troubleshooting/</a>.):<br>
No</p>
<p dir="auto"><strong>What keywords did you search in Kubernetes issues before filing this one?</strong> (If you have found any duplicates, you should instead reply there.):<br>
duplicate node name + "kubectl get nodes"</p>
<hr>
<p dir="auto"><strong>Is this a BUG REPORT or FEATURE REQUEST?</strong> (choose one):<br>
BUG REPORT</p>
<p dir="auto"><strong>Kubernetes version</strong> (use <code class="notranslate">kubectl version</code>)<br>
kubectl version<br>
Client Version: version.Info{Major:"1", Minor:"4", GitVersion:"v1.4.4", GitCommit:"3b417cc4ccd1b8f38ff9ec96bb50a81ca0ea9d56", GitTreeState:"clean", BuildDate:"2016-10-21T02:48:38Z", GoVersion:"go1.6.3", Compiler:"gc", Platform:"linux/amd64"}<br>
Server Version: version.Info{Major:"1", Minor:"4", GitVersion:"v1.4.4", GitCommit:"3b417cc4ccd1b8f38ff9ec96bb50a81ca0ea9d56", GitTreeState:"clean", BuildDate:"2016-10-21T02:42:39Z", GoVersion:"go1.6.3", Compiler:"gc", Platform:"linux/amd64"}<br>
kubeadm version<br>
kubeadm version: version.Info{Major:"1", Minor:"5+", GitVersion:"v1.5.0-alpha.2.421+a6bea3d79b8bba", GitCommit:"a6bea3d79b8bbaa5e8b57482c9fff9265d402708", GitTreeState:"clean", BuildDate:"2016-11-03T06:54:50Z", GoVersion:"go1.7.1", Compiler:"gc", Platform:"linux/amd64"}</p>
<p dir="auto"><strong>Environment</strong>:</p>
<ul dir="auto">
<li><strong>Cloud provider or hardware configuration</strong>:x86_64 desktop</li>
<li><strong>OS</strong> (e.g. from /etc/os-release):ubuntu 16.04 LTS</li>
<li><strong>Kernel</strong> (e.g. <code class="notranslate">uname -a</code>):Linux ubuntu-2 4.4.0-31-generic <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="35429713" data-permission-text="Title is private" data-url="https://github.com/kubernetes/kubernetes/issues/50" data-hovercard-type="issue" data-hovercard-url="/kubernetes/kubernetes/issues/50/hovercard" href="https://github.com/kubernetes/kubernetes/issues/50">#50</a>-Ubuntu SMP Wed Jul 13 00:07:12 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux</li>
<li><strong>Install tools</strong>:kubeadm</li>
<li><strong>Others</strong>:</li>
</ul>
<p dir="auto"><strong>What happened</strong>:<br>
We have two nodes, the master name was ubuntu-2 while the minion node was ubuntu-3.<br>
kubectl get nodes<br>
NAME STATUS AGE<br>
ubunbu-3 Ready 10h<br>
ubuntu-2 Ready 1d<br>
If we add another node with same node name ubuntu-3, it just added without checking whether the node name had existed or not:<br>
kubectl get nodes<br>
NAME STATUS AGE<br>
ubunbu-3 Ready 10h<br>
ubuntu-2 Ready 1d<br>
ubuntu-3 Ready 26m</p>
<p dir="auto"><strong>What you expected to happen</strong>:<br>
If we add node using 'kubeadm join' with node name already exists, we should return failed with error messages: "duplicate node name"</p>
<p dir="auto"><strong>How to reproduce it</strong> (as minimally and precisely as possible):</p>
<ol dir="auto">
<li>kubeadm join (node with name ubuntu-3, for example)</li>
<li>In master node 'kubectl get nodes'<br>
NAME STATUS AGE<br>
ubunbu-3 Ready 10h<br>
ubuntu-2 Ready 1d</li>
<li>Add another node with name ubuntu-3<br>
NAME STATUS AGE<br>
ubunbu-3 Ready 10h <-----duplicate node name ubuntu-3<br>
ubuntu-2 Ready 1d<br>
ubuntu-3 Ready 26m <------duplicate node name ubuntu-3<br>
<strong>Anything else do we need to know</strong>:</li>
</ol> | <p dir="auto"><strong>Is this a request for help?</strong> (If yes, you should use our troubleshooting guide and community support channels, see <a href="http://kubernetes.io/docs/troubleshooting/" rel="nofollow">http://kubernetes.io/docs/troubleshooting/</a>.): no</p>
<p dir="auto"><strong>What keywords did you search in Kubernetes issues before filing this one?</strong> (If you have found any duplicates, you should instead reply there.):<br>
KubeletNotReady container runtime is down</p>
<hr>
<p dir="auto"><strong>Is this a BUG REPORT or FEATURE REQUEST?</strong> (choose one):<br>
bug report</p>
<p dir="auto"><strong>Kubernetes version</strong> (use <code class="notranslate">kubectl version</code>):</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Client Version: version.Info{Major:"1", Minor:"3", GitVersion:"v1.3.4", GitCommit:"dd6b458ef8dbf24aff55795baa68f83383c9b3a9", GitTreeState:"clean", BuildDate:"2016-08-01T16:45:16Z", GoVersion:"go1.6.2", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"3", GitVersion:"v1.3.4", GitCommit:"dd6b458ef8dbf24aff55795baa68f83383c9b3a9", GitTreeState:"clean", BuildDate:"2016-08-01T16:38:31Z", GoVersion:"go1.6.2", Compiler:"gc", Platform:"linux/amd64"}"><pre class="notranslate"><code class="notranslate">Client Version: version.Info{Major:"1", Minor:"3", GitVersion:"v1.3.4", GitCommit:"dd6b458ef8dbf24aff55795baa68f83383c9b3a9", GitTreeState:"clean", BuildDate:"2016-08-01T16:45:16Z", GoVersion:"go1.6.2", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"3", GitVersion:"v1.3.4", GitCommit:"dd6b458ef8dbf24aff55795baa68f83383c9b3a9", GitTreeState:"clean", BuildDate:"2016-08-01T16:38:31Z", GoVersion:"go1.6.2", Compiler:"gc", Platform:"linux/amd64"}
</code></pre></div>
<p dir="auto"><strong>Environment</strong>: What does that mean?</p>
<ul dir="auto">
<li><strong>Cloud provider or hardware configuration</strong>: AWS</li>
<li><strong>OS</strong> (e.g. from /etc/os-release):</li>
</ul>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="PRETTY_NAME="Debian GNU/Linux 8 (jessie)"
NAME="Debian GNU/Linux"
VERSION_ID="8"
VERSION="8 (jessie)"
ID=debian
HOME_URL="http://www.debian.org/"
SUPPORT_URL="http://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/""><pre class="notranslate"><code class="notranslate">PRETTY_NAME="Debian GNU/Linux 8 (jessie)"
NAME="Debian GNU/Linux"
VERSION_ID="8"
VERSION="8 (jessie)"
ID=debian
HOME_URL="http://www.debian.org/"
SUPPORT_URL="http://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
</code></pre></div>
<ul dir="auto">
<li><strong>Kernel</strong> (e.g. <code class="notranslate">uname -a</code>):</li>
</ul>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Linux ip-172-20-1-41 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt25-2+deb8u3 (2016-07-02) x86_64 GNU/Linux"><pre class="notranslate"><code class="notranslate">Linux ip-172-20-1-41 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt25-2+deb8u3 (2016-07-02) x86_64 GNU/Linux
</code></pre></div>
<ul dir="auto">
<li><strong>Install tools</strong>:</li>
<li><strong>Others</strong>:</li>
</ul>
<p dir="auto"><strong>What happened</strong>: Nodes turn to NotReady with the following message on the describe output:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="KubeletNotReady container runtime is down. WARNING: CPU hardcapping unsupported"><pre class="notranslate"><code class="notranslate">KubeletNotReady container runtime is down. WARNING: CPU hardcapping unsupported
</code></pre></div>
<p dir="auto">This is the output of the sudo docker version command on the node:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Client:
Version: 1.11.2
API version: 1.23
Go version: go1.5.4
Git commit: b9f10c9
Built: Wed Jun 1 21:23:39 2016
OS/Arch: linux/amd64
Cannot connect to the Docker daemon. Is the docker daemon running on this host?"><pre class="notranslate"><code class="notranslate">Client:
Version: 1.11.2
API version: 1.23
Go version: go1.5.4
Git commit: b9f10c9
Built: Wed Jun 1 21:23:39 2016
OS/Arch: linux/amd64
Cannot connect to the Docker daemon. Is the docker daemon running on this host?
</code></pre></div>
<p dir="auto">The node does not seem to recover from this failure so I have to kill it and the auto scaling group brings up another one instead.</p>
<p dir="auto"><strong>What you expected to happen</strong>: Nodes should remain in a Ready state or at least recover from such failures.</p>
<p dir="auto"><strong>How to reproduce it</strong> (as minimally and precisely as possible): It just happens once in two days approximately.</p>
<p dir="auto"><strong>Anything else do we need to know</strong>:</p>
<p dir="auto">This is the <a href="https://github.com/kubernetes/kubernetes/files/436373/daemon.log.txt">daemon.log.txt</a> from the time the node went down</p> | 0 |