text:
scroll-view  里面 用v-for绑定 列表，一次绑定数据>80条时，小程序卡死！

[ scroll-view  里面 用v-for绑定 列表，一次绑定数据>80条时，小程序卡死，即使分页添加数据，数组大于一定量时也会卡死。  iphone6 16g手机 微信版本6.6.7 （在安坐手机好像没发现问题）]
问题复现步骤:

[第一步]：
//取数据

let self = this;
 wx.request({url:"https://gw.yundzh.com/stkdata?output=json&gql=block%3D%E5%B8%82%E5%9C%BA%2F%E6%B2%AA%E6%B7%B1%E5%B8%82%E5%9C%BA%2F%E6%B2%AA%E6%B7%B1A%E8%82%A1&field=ZhangFu%2CZhongWenJianCheng%2CZuiXinJia%2CFenZhongZhangFu5%2CHuanShou%2CLiangBi%2CChengJiaoE&mode=2&orderby=ZhangFu&start=0&count=200&desc=true&qid=4&token=0000007f:1528377253:f3ed0ba0048680fa1682646e14cf8ce078b7b6c0",
                        data:{},
                        header: {'content-type':'application/json'},
                        success: function(res) {
                            let _res = res.data.Data.RepDataStkData;
                            _res.forEach((eachobj)=>self.FmtHqData(eachobj));
                            self.stockList = _res;
                        }
                    });

FmtHqData(eachObj){ //格式化行情数据
            if (eachObj.ZuiXinJia == null) {
                eachObj.ZuiXinJiaTxt = '--';
                eachObj.ZhangFuTxt = '--';
                eachObj.FenZhongZhangFu5 = '--';
            } else {
                eachObj.ZuiXinJiaTxt = formatNumber(eachObj.ZuiXinJia);
                eachObj.ZhangFuTxt = formatNumber(eachObj.ZhangFu / 100, 2, '%');
                eachObj.ChengJiaoE = (eachObj.ChengJiaoE/100000000).toFixed(2);
                eachObj.FenZhongZhangFu5Txt =eachObj.FenZhongZhangFu5 + '%';
            }
}

[第二步]
//绑定数据

<scroll-view class="ranking-list" scroll-y='true' :style="{height: windowHeight + 'px'}"  @scrolltolower='lower'>

	                    {{stock.ZhongWenJianCheng}}{{stock.Obj}}
                        0,'font-green':stock.ZhangFu<0,'font-gray':stock.ZhangFu==0}">{{stock.ZuiXinJiaTxt}}
                        0,'font-green':stock.ZhangFu<0,'font-gray':stock.ZhangFu==0}">{{stock.title2TXT}}

</scroll-view>

[其他步骤...]

期望的表现:
小程序不卡死
[在这里描述期望的表现]
观察到的表现:
小程序卡死，切换页面的时候，小程序的，onhiden onunload 事件已经不触发了。
[在这里描述观察到的表现]
屏幕截图和动态 GIF 图
![复现步骤的屏幕截图和动态 GIF 图](图片的 url)

测试发现，

 let _res = res.data.Data.RepDataStkData;
 _res.forEach((eachobj)=>self.FmtHqData(eachobj));
let _a = _res    //这样没事
self.stockList = _res;   //这样小程序就卡死，好像把里面的变量复制给data里面的变量时，就不行了

#500

性能很难受，长列表超过200条直接停止渲染，卡死

这一块我已经改成原生的了

我也遇到了，希望开发者能解决

@SevenChen  怎么改的

@jyj1993126 就用原生的写，写好放到dist目录里面。你可以看我的github库里面 dzhwxapp 的dist/pages/hqmore 目录

mpvue 的 data 赋值操作本质上最终会编译成 setData，直接赋值大量数据最终传输也是有个上限的，微信官方文档也说明了 setData 的常见操作错误：

频繁的去 setData
每次 setData 都传递大量新数据

不过建议 mpvue 官方能否在 Array 类型上扩展一个追加数据集的方法来解决大列表增量渲染的问题，而不是现在一旦检测到数组改变就把整个数组 setData 进去

mpvue 的 data 赋值操作本质上最终会编译成 setData，直接赋值大量数据最终传输也是有个上限的，微信官方文档也说明了 setData 的常见操作错误：

频繁的去 setData
每次 setData 都传递大量新数据

不过建议 mpvue 官方能否在 Array 类型上扩展一个追加数据集的方法来解决大列表增量渲染的问题，而不是现在一旦检测到数组改变就把整个数组 setData 进去

我看官方社区里也他们也承认长列表渲染有性能问题，可是也一直没见解决啊 难道真的是没办法吗

不要循环组件试试。


text:
acme报错

actions配置文件：
name: autocert
on:
  workflow_dispatch:
env:
  # Checkout 到的目录
  CERTS_OUTPUT_BASE: BASE
  # 证书输出目录
  CERTS_OUTPUT_DIRECTORY: example.com
  # 证书文件名
  FILE_FULLCHAIN: fullchain.cer
  # 私钥文件名
  FILE_KEY: private.key
jobs:
  issue-ssl-certificate:
    name: Issue SSL certificate
    runs-on: ubuntu-latest
    steps:
      - name: Checkout the default branch
        uses: actions/checkout@v3

      - uses: Menci/acme@v1
        with:
          version: 3.0.4

          account-tar: ${{ secrets.ACME_SH_ACCOUNT_TAR }}

          domains: example.com
          append-wildcard: true

          arguments: --dns dns_cf --keylength ec-384

          output-fullchain: ${{ env.CERTS_OUTPUT_BASE }}/${{ env.CERTS_OUTPUT_DIRECTORY }}/${{ env.FILE_FULLCHAIN }}
          output-key: ${{ env.CERTS_OUTPUT_BASE }}/${{ env.CERTS_OUTPUT_DIRECTORY }}/${{ env.FILE_KEY }}

      - name: Commit & Push
        run: |
          git config --local user.email "my@email"
          git config --local user.name "UptonEdward"
          git add --all
          git commit -m "Update"
          git push

actions中证书申请成功，但后续步骤报错：
[Wed Nov  2 23:22:09 UTC 2022] Your cert is in: /home/runner/.acme.sh/example.com_ecc/example.com.cer
[Wed Nov  2 23:22:09 UTC 2022] Your cert key is in: /home/runner/.acme.sh/example.com_ecc/example.com.key
[Wed Nov  2 23:22:09 UTC 2022] The intermediate CA cert is in: /home/runner/.acme.sh/example.com_ecc/ca.cer
[Wed Nov  2 23:22:09 UTC [202](https://github.com/UptonEdward/xxx#stop4:207)2] And the full chain certs is there: /home/runner/.acme.sh/example.com_ecc/fullchain.cer
Run ACME_SH_TEMP_DIR="$(mktemp -d)"
[Wed Nov  2 23:22:10 UTC 2022] The domain 'example.com' seems to have a ECC cert already, please add '--ecc' parameter if you want to use that cert.
[Wed Nov  2 23:22:10 UTC 2022] The domain 'example.com' is not a cert name. You must use the cert name to specify the cert to install.
[Wed Nov  2 23:22:10 UTC 2022] Can not find path:'/home/runner/.acme.sh/example.com'
Error: Process completed with exit code 1.

arguments 加上 --ecc 试试？

source: gharchive/issue

authors: Menci UptonEdward

repo: Menci/acme

license: MIT

license_type: permissive

license_source: github-api


text:
Introduce audience personas

As discussed in today's print review, we add audience personas to focus documentation and release notes.

Looks good to me.

source: gharchive/pull-request

authors: meshjoerg tfelix

repo: Meshcloud/meshcloud-docs


text:
Rekommenderad dct:accessRights på datamängden

DCAT-AP säger att den är valfri.
Denna property är en av de som lyfts fram på öppnadata.se, att få fler att tillhandahålla ett värde här skulle ge bättre filtreringsmöjligheter på öppnadata.

Föreslår att vi också gör den rekommenderad på dcat:DatasetService.

repo: MetaSolutionsAB/DCAT-AP-SE


text:
Invalid get index 'window_mode' (on base: 'null instance') error

I just cloned, imported it from the Project List and opened the project. Then without making any changes, I get this error:
Invalid get index 'window_mode' (on base: 'null instance') and its stopping in the "_enter_tree()" at like 45.
I want to try to use this, but I'm stuck here.

This is an early development software without a stable version yet. Currently the codebase is in a pretty messy half-finished state, but it's my top priority to clean it up and untangle the mess.

Is there anything you’d like help with? I could try and help in any way I
can.
On Sat, Sep 23, 2023 at 1:45 PM Mew Pur Pur @.***>
wrote:

This is an early development software without a stable version yet.
Currently the codebase is in a pretty messy half-finished state, but it's
my top priority to clean it up and untangle the mess.
—
Reply to this email directly, view it on GitHub
https://github.com/MewPurPur/GodSVG/issues/28#issuecomment-1732405786,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AAJFK6PGIBJWXVFO4IJJ7D3X35C5FANCNFSM6AAAAAA5EBALIY
.
You are receiving this because you authored the thread.Message ID:
@.***>

OK Figured it out, it's not part of the stuff I'm refactoring.

Fixed by https://github.com/MewPurPur/GodSVG/commit/b22b8c566063abe9c75afbe7bf7d30d91ea21459

authors: MewPurPur jsonify

repo: MewPurPur/GodSVG


text:
Different width for different columns

Is there an option to set width property for each column of data set (not just one width for all the columns using UseCssClasses)?

I hope that your improvement will be released this week with another features or early of next week.
Thanks a lot

authors: DenUsachev Mewriick


text:
Unused assets bloating dll size

So I noticed that FlexGird.dll was taking 2.5MB which was more than mscorlib.dll and mono.wasm which seemed odd
Looks like a bunch of fontawesome thing being embedded into it
I don't know what the grid uses but I'm pretty sure the dll size could be reduced by like 90%

Thanks, I will check it

I hope that in new version is it better. If you have any ideas how to improve this problem do not hesitate to advice me. Thanks

authors: Mewriick alek-mcgarry


text:
ytmp4 error

"error mungkin disebbkn oleh sistem"Sama lama Lama botny ga respon gitu tpi di cmdny msuk

coba pencet Ctrl+C terus npm start

coba pencet Ctrl+C terus npm start

iy w gitu trus rmlih,lm lm jg jengkel mesti gtu trus

Di gue gada error Tapi banyak bet yang ngeluh ini error itu error

Yang error coba ganti aja requests get jadi axios

apikey limit mhank

sama w juga error

You can use ytdl-core instead

authors: CE-10 ItzTobz MhankBarBar kikiixyz lokublah lxndr-rl muhammadzakizn07

repo: MhankBarBar/whatsapp-bot


text:
Fixes the un-hide problem with currentwether and weatherforcast modules.

Does the pull request solve a related issue?
I don't really know if there is an "issue" created. I just read three different threads in the forum regarding the "automatic un-hide". And I have myself had the same problem.

What does the pull request accomplish? Use a list if needed.
Gets rid of the problem that you never can hide the "currentweather" and "weatherforcast" for more then the time it updates.

If it includes major visual changes please add screenshots.
No visual changes. Just piece of mind. :)

This PR got reverted due to an issue:
https://github.com/MichMich/MagicMirror/issues/2164

authors: MichMich Snille

repo: MichMich/MagicMirror

license: mit

license_source: bigquery


text:
additional output filtering of metadata

Add additional output filtering of metadata for markdown and html

First Advantage: user can define exactely which of any metadata are in the final documentation
Also user can define the output order.

Second Advantage: we could use the meta dictionary to store other not user specific data like the keyword arguments per entry and if needed set them on a blacklist.

Question? are there any other default output metadata we should add to the Config.
In your example you used at least does:

return_type https://github.com/MichaelHatherly/Docile.jl/blob/master/docs/syntax.md#meta
returns https://github.com/MichaelHatherly/Docile.jl/blob/master/docs/api/Docile.md#metadoc
file (but I guess this is special isn't it?
author https://github.com/MichaelHatherly/Docile.jl/blob/master/docs/api/Docile.md#docargs
status https://github.com/MichaelHatherly/Docile.jl/blob/master/docs/api/Docile.md#docargs

Lets just stick with :source for the moment. :signature is automatically added for macros since we store them internally as (anonymous function) objects which then loose their name. Once we implement the signature metadata properly (first code block of a docstring) then we can make further use of :signature. Perhaps we need a naming convention for "internal" and "public" metadata, maybe underscores.

Perhaps we need a naming convention for "internal" and "public" metadata, maybe underscores.

Might be good but not necessary because  in the Config ony the public are listed.
Anyway I change the default to only source - probably in the morning.

Might be good but not necessary because in the Config ony the public are listed.

Yeah, sure. Until it's definitely a problem we should leave it as it then.

@MichaelHatherly I think that one could be merged and I will continue tomorrow morning?


text:
请问这是怎么回事？

我在Windows 10 1803 17134.167 下运行的，不知道支不支持？我下的程序版本要求都是达到了的。为什么就是运行不了?
还请赐教，谢谢！

看看你的php 版本有没有启用 curl 扩展？

好的，谢谢！我去试试

你看，还是不行，提示语法错误，咋整？

以下是我测试该链接的结果。环境：Linux （php7.2.X）、Mac（php7.1.X），由于没有 win PC机，无法测试。我找朋友试试

你将 Runtime\Cache 目录下的缓存文件删除了，然后再次请求一下，复制缓存文件内容提交给我

缓存文件名01：577607a6221d8a0b122a4e35912fd513
内容：a:2:{i:0;s:32:"2e3e3ff18d6211e89d19a042d48ad00a";i:1;i:1532231962;}
缓存文件名02：ed2235de7e11465d9f4632c842c00251
内容：a:2:{i:0;N;i:1;i:0;}

我在Linux下也这样，CentOS7。
请看上图
我怀疑还是组件的问题，如：cURL 等。
但是不知道怎么处理。
问题是，我已经启用了PHP的 cURL、OpenSSL扩展了，下载方面应该没问题了。
但是还是下载不了。

这是结果。

今晚我修复

这是相应的程序版本。

Discord：https://discord.gg/yuxfCy

repo: Mickeyto/phpVideos


text:
Develop chain functions

Goal
Develop the necessary functions to interact with ErgoChain.

@hirotadashi Please add the list of necessary functions as a check list and mark off what has been developed so far.

Test progress
Bugs

[ ] https://trusted-lily-a18.notion.site/humming-bot-edge-cases-doc-8ac894fbdae249da92826ab980e294f2

Remaining

[ ] Swap function
[ ] Sign function in wallet provider class

repo: Microflow-xyz/gateway


text:
Cannot download symbols for new extension

Maybe this is just not implemented yet. But VSCode tries to download symbols for dependent apps, so I guess it should work.
Created and published a new extension. After that, created a another extension that depends on the first one. Set dependencies in app.json and issued command to download symbols. However, it was unable to download it from the server.
Compared the download url with the url for the system and us symbols. It all looks correct.
These url's work like expected:
http://localhost:7049/navision_main/dev/symbols/Microsoft/System/10.0.12925.0
http://localhost:7049/navision_main/dev/symbols/Microsoft/US/10.0.16477.0
This url doesn't work (generated by VSCode)
http://localhost:7049/navision_main/dev/symbols/ArendJanKauffmann/RESTWebServicesBase/1.0.0.0
Copy navx file to the packages folder solves the issue. But according to the behavior, it should be possible for VSCode to get the navx file from the server, am I right?

This is a bug, we'll take a look at it

authors: StanislawStempin ajkauffmann

repo: Microsoft/AL


text:
Unable to test Role Center page

Hello,
I am creating tests for our app and I want to test that our new fields/cues are on the role center. But I am unable to do that, because when trying to run the role center (to trap it as TestPage) ends with error:
Unexpected CLR exception thrown.: System.NullReferenceException: Object reference not set to an instance of an object.\ at Microsoft.Dynamics.Nav.Client.TestPageClient.TestPageClientSession.UISession_FormToShow(Object sender, FormSessionEventArgs e

The code I am using is:
        OrderProcessorRCTP.Trap();
        Page.RUN(Page::"Order Processor Role Center");

I expect that running role center is not allowed in AL, but it is needed to be able to test it.

Agree, totally forget that I have already reported it... :-)


text:
Need  the ability to write code in between standard code line

We need ability to add code in between existing code (similar to currently available feature to add a field after an existing field in page).
Please see example code below
IF ((Amount <= 0) AND ("Bank Payment Type" = "Bank Payment Type"::"Computer Check") AND "Check Printed") OR
((Amount < 0) AND ("Bank Payment Type" = "Bank Payment Type"::"Manual Check"))
THEN BEGIN
IF BankAcc."Currency Code" <> "Currency Code" THEN
ERROR(BankPaymentTypeMustNotBeFilledErr);
CASE "Bank Payment Type" OF
"Bank Payment Type"::"Computer Check":
BEGIN
TESTFIELD("Check Printed",TRUE);
CheckLedgEntry.LOCKTABLE;
CheckLedgEntry.RESET;
CheckLedgEntry.SETCURRENTKEY("Bank Account No.","Entry Status","Check No.");  //New AL Extension code
CheckLedgEntry.SETRANGE("Bank Account No.","Account No.");
CheckLedgEntry.SETRANGE("Entry Status",CheckLedgEntry."Entry Status"::Printed);
CheckLedgEntry.SETRANGE("Check No.","Document No.");
IF CheckLedgEntry.FINDSET THEN
REPEAT
CheckLedgEntry2 := CheckLedgEntry;
CheckLedgEntry2."Entry Status" := CheckLedgEntry2."Entry Status"::Posted;
CheckLedgEntry2."Bank Account Ledger Entry No." := BankAccLedgEntry."Entry No.";
CheckLedgEntry2.MODIFY;
UNTIL CheckLedgEntry.NEXT = 0;
END;
"Bank Payment Type"::"Manual Check":
BEGIN
IF "Document No." = '' THEN
These features are crucial for converting our vertical into extension.  I am sure vast majority of the solution center would require such ability as 90% of the code enhancement we do in a daily basis falls under this category.  Without this feature we can not switch from C/SIDE to AL going forward.
Please note we do not want to do code cloning as it will put a high overhead in maintaining these extension and will defeat the purpose for extension, which is ease of upgradability and maintainability.

You need to use events.
If you don't see an event handler which can manage your scenario, then you need to raise an event request here.

I am fully aware of requesting additional events and using events.  This method will not address my request to put code any arbitrary point in the code.  Events are normally defined on a logical trigger (ie on before... or on after).See my code example before.

The entire BC codebase is getting converted to AL, so you'll be able to put code wherever you like. Keeping in mind, that means it (very likely) cannot be deployed to AppSource, or potentially even as an App for other databases (expecting more info at Directions).
Without getting too much into designing solutions, a well placed event in the above code should let you achieve what you need.

If these kind of changes are not going to be supported in extension or AL code. I do not think Microsoft can scrap CSIDE. It is taking away a key customization feature and it be a disaster to Dynamic NAV industry.

In an OnPrem database, that should be possible with AL when C/AL is finally shoved down the drain.
From this point onwards, AL was announced to be usable for extensions as well as conventional coding.
But for SaaS deployment, currently no chance. Actually I asked for something like this (arbitrary code line inserts in standard objects, also exiting a function prematurely if necessary to prevent standard code from being executed to run your own instead) already in November 2017 in a feedback Session at the ISV Red Carpet Days in Lyngby. I understand why MS is not inclined to allow this, but it shows the limitations of extensions.

If your solution is horizontal, then you're better off building a solution app.
While allowing code at any line would be the ultimate in versatility, it's not a practical solution to implement.
Hooks and events are perfectly good patterns. In time there will be enough to cover all scenarios. The best thing you can do in the interim is provide event suggestions to help improve coverage.

authors: Kowa63 Rama-M ShadowXVII


text:
Exception while initializing AzureWebAppRoleEnvironmentTelemetryInitializer

I just added Asp.Net Core App Insights integration to my existing application. We have previously been sending telemetry from the app itself, but not from ASP.NET Core. Immediately after the change was deployed I started seeing the following in our traces:
AI (Internal):
[msg=Log Error];
[msg=Exception while initializing Microsoft.ApplicationInsights.AspNetCore.TelemetryInitializers.ClientIpHeaderTelemetryInitializer,
exception message - System.TypeInitializationException:
The type initializer for 'Microsoft.ApplicationInsights.AspNetCore.Extensibility.Implementation.Tracing.AspNetCoreEventSource' threw an exception.
---> System.IO.FileNotFoundException: Could not load file or assembly
'Microsoft.Extensions.PlatformAbstractions, Version=1.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'.
The system cannot find the file specified.
at Microsoft.ApplicationInsights.AspNetCore.Extensibility.Implementation.Tracing.AspNetCoreEventSource..ctor()
at Microsoft.ApplicationInsights.AspNetCore.Extensibility.Implementation.Tracing.AspNetCoreEventSource..cctor() --- End of inner exception stack trace ---
at Microsoft.ApplicationInsights.AspNetCore.TelemetryInitializers.ClientIpHeaderTelemetryInitializer.OnInitializeTelemetry(HttpContext platformContext, RequestTelemetry requestTelemetry, ITelemetry telemetry) at Microsoft.ApplicationInsights.TelemetryClient.Initialize(ITelemetry telemetry)]

We're using the 2.1.1 package and are building on asp.net core 2.0. AFAIK, Microsoft.Extensions.PlatformAbstractions was deprecated after asp.net core 1.0, so I'm surprised that there is an attempt to load it. However, given that a namespace on the stack reads Extensibility I wonder if some extensibility model is play and pulling in unexpected types from other assemblies.
Any pointers for debugging would be appreciated.

Ok, found that:

Microsoft.ApplicationInsights.DependencyCollector v2.4.1 depends on Microsoft.Extensions.PlatformAbstractions v1.1.0

I've verified this is included with my published application, so it's not clear why there is a failure. However, that looks like a dotnet problem and not one in ApplicationInsights. I'm closing this issue, but will try to comment here once solved in case anyone else hits this.


text:
[Facebook Channel] No reply on facebook Messanger channel, emulator with remote service and Skype work allright

I have a bot service on Azure. I can connect to it via emulator and Skype and talk without issues.
Bot Builder version: 3.5.1-alpha
.NETCoreApp 1.1
After clicking Test on dev framework dashboard I got:
OK { "version": { "major": 1, "minor": 1, "build": -1, "revision": -1, "majorRevision": -1, "minorRevision": -1 }, "content": null, "statusCode": 202, "reasonPhrase": "Accepted", "headers": [], "requestMessage": null, "isSuccessStatusCode": true }
What is not working:

web chat on developer dashboard - no reply
Facebook Messanger - no reply

I investigated the service by remote debugging - code reaches returning http.ok, no exceptions; also Applications Insights show now failed requests.
Facebook configurations seem to be correct - the green notifications says that credentials are correct.

Have you resolved this issue or do you still need help with it?

@JasonSowers TBH: no :/ Any help would be appreciated. Also I posted on SO, but with no luck: https://stackoverflow.com/questions/44090614/microsoft-bot-framework-chatbot-does-not-respond-on-facebook-messenger-and-webch?noredirect=1#comment75213754_44090614

repo: Microsoft/BotBuilder


text:
[Question] Why am I getting error: "There was an error sending this message to your bot: HTTP status code GatewayTimeout?

Bot Info

SDK Platform: .NET
Active Channels:  Web Chat, Direct Line

Issue Description
Bot is developed using SDK & deployed on corporate server. Same bot is published on internet (https://testmy.ebharatgas.com/bitsy/api/messages) & registered with Bot channel of azure.Certificate is also vaild.
When we are trying to test the web chat getting following error,
"There was an error sending this message to your bot: HTTP status code GatewayTimeout". Please suggest. When we test locally inside corporate network its working.

@EricDahlvang : I want to update that , After enabling [botauthentication] in message controller , now i am getting 401 error, though my credentials are correct .I have a question, do i need to open outgoing connection also from my IIS server to internet. I am reading this post https://github.com/Microsoft/BotBuilder/issues/2266

Just to confirm issue is resolved


text:
Restarting the main side of the application wipes the bots list

When building / developing locally, restarting the main process will wipe the most recently used bots list.

Addressed in #661

repo: Microsoft/BotFramework-Emulator


text:
Got rid of old and unused build resources.

Got rid of some unused build resources:

Windows Squirrel startup event handling (old auto update system that we no longer use)
winreg dependency (used to edit Windows Registry keys as part of Windows Squirrel update)
travis.yml logic that is supposed to deploy our artifacts to GitHub, but was never used
Old Squirrel installer graphics

Pull Request Test Coverage Report for Build 1678

0 of 0   changed or added relevant lines in 0 files are covered.
No unchanged relevant lines lost coverage.
Overall coverage remained the same at 58.29%

Totals

Change from base Build 1672:
0.0%

Covered Lines:
5020

Relevant Lines:
7749

💛  - Coveralls

authors: coveralls tonyanziano


text:
Added zoom to address bar menu

Zoom functions are now available in the address bar menu.

@mgbennet,
Thanks for your contribution as a Microsoft full-time employee or intern. You do not need to sign a CLA.
Thanks,
Microsoft Pull Request Bot

authors: mgbennet msftclas


text:
Sending additional fields through BotChat.App

The "User" object in the bot-framework-directlinejs package states userid as a mandatory field, with an optional name field. Let's say the user logs in through the website and we now want to identify the current user by their login id. Technically, because the typescript interface does not do excess checks, we can add an additional loginid field to the "User" object to be passed to the bot, like this:
BotChat.App({
       directLine: { secret: 'YOUR DIRECT LINE SECRET HERE' },
       user: { id: '1236342', name: 'Testuser', loginid: 'alyssaong1' },
       bot: { id: 'botid' },
       resize: 'detect'
}, document.getElementById("bot"));

While this implementation works, is it something that is encouraged? I don't see any problems with it but is there a chance that the "User" interface will be excess checked in future versions?
Note that I would not change the userid to the login id as this would make the bot think it is a new user.

@dandriscoll - does DirectLine remove "extra" properties?
@alyssaong1 - if not, you may have to maintain a lookup elsewhere.

With Direct Line, as with any protocol, you should never assume that undocumented behavior will be preserved. What works today will not necessarily work tomorrow.
In this case you'd also be depending on undocumented behavior on the part of DirectLineJS, which happens to send the entire user object along with each message, but may be more careful in the future.
Two better, and documented, ways to pass information like this are:

sending an event message to the bot with the user's loginId
sending the loginId in the channeData field of each message

The latter is a better fit for what you're doing now.

Noted, thank you Bill!

authors: alyssaong1 billba danmarshall

repo: Microsoft/BotFramework-WebChat


text:
Banned API with a space between API and () don't trigger rules

Our regexes have a bug that don't take into account spaces:
gets(str);
gets (str);
The first gets will trigger a warning, but the second won't.  We need to update a bunch of our rules to catch that

Should be resolved by https://github.com/Microsoft/DevSkim/commit/8fdf0ad713bfd905421f92d78fb6c9277d87deef

repo: Microsoft/DevSkim


text:
Spectator View compositor does not show frames for BlackMagic Shuttle USB3 external capture card

The BlackMagic Shuttle card does not support capture >30 FPS.
Temporary workaround: modify DeckLinkManager to receive frames at less than 30 FPS.
Change DeckLinkManager.cpp(71) to:
videoDisplayMode = bmdModeHD1080p2398;
Rebuild the compositor and run CopyDLL.

Added a frame provider selection to special case this capture card:
https://github.com/Microsoft/HoloLensCompanionKit/pull/168

repo: Microsoft/HoloLensCompanionKit


text:
run python setup.py, says:Exception: Please install CMake and all required dependencies first The full version of error log was saved into /Users/hong/LightGBM_compilation.log

My computer is Mac. I followed the Installation Guide step by step:
brew install cmake
brew install gcc
git clone --recursive https://github.com/Microsoft/LightGBM ; cd LightGBM
export CXX=g++-7 CC=gcc-7
mkdir build ; cd build
cmake ..
make -j4
pip install setuptools wheel numpy scipy scikit-learn -U
cd LightGBM/python-package
export CXX=g++-7 CC=gcc-7  # for macOS users only
python setup.py install
But it shows that:
Error Message:
running install
creating compile
creating compile/include
creating compile/include/LightGBM
copying ../include/LightGBM/application.h -> ./compile/include/LightGBM
copying ../include/LightGBM/bin.h -> ./compile/include/LightGBM
copying ../include/LightGBM/boosting.h -> ./compile/include/LightGBM
copying ../include/LightGBM/c_api.h -> ./compile/include/LightGBM
copying ../include/LightGBM/config.h -> ./compile/include/LightGBM
copying ../include/LightGBM/dataset.h -> ./compile/include/LightGBM
copying ../include/LightGBM/dataset_loader.h -> ./compile/include/LightGBM
copying ../include/LightGBM/export.h -> ./compile/include/LightGBM
copying ../include/LightGBM/feature_group.h -> ./compile/include/LightGBM
copying ../include/LightGBM/lightgbm_R.h -> ./compile/include/LightGBM
copying ../include/LightGBM/meta.h -> ./compile/include/LightGBM
copying ../include/LightGBM/metric.h -> ./compile/include/LightGBM
copying ../include/LightGBM/network.h -> ./compile/include/LightGBM
copying ../include/LightGBM/objective_function.h -> ./compile/include/LightGBM
copying ../include/LightGBM/prediction_early_stop.h -> ./compile/include/LightGBM
copying ../include/LightGBM/R_object_helper.h -> ./compile/include/LightGBM
copying ../include/LightGBM/tree.h -> ./compile/include/LightGBM
copying ../include/LightGBM/tree_learner.h -> ./compile/include/LightGBM
creating compile/include/LightGBM/utils
copying ../include/LightGBM/utils/array_args.h -> ./compile/include/LightGBM/utils
copying ../include/LightGBM/utils/common.h -> ./compile/include/LightGBM/utils
copying ../include/LightGBM/utils/file_io.h -> ./compile/include/LightGBM/utils
copying ../include/LightGBM/utils/log.h -> ./compile/include/LightGBM/utils
copying ../include/LightGBM/utils/openmp_wrapper.h -> ./compile/include/LightGBM/utils
copying ../include/LightGBM/utils/pipeline_reader.h -> ./compile/include/LightGBM/utils
copying ../include/LightGBM/utils/random.h -> ./compile/include/LightGBM/utils
copying ../include/LightGBM/utils/text_reader.h -> ./compile/include/LightGBM/utils
copying ../include/LightGBM/utils/threading.h -> ./compile/include/LightGBM/utils
creating compile/src
creating compile/src/application
copying ../src/application/application.cpp -> ./compile/src/application
copying ../src/application/predictor.hpp -> ./compile/src/application
creating compile/src/boosting
copying ../src/boosting/boosting.cpp -> ./compile/src/boosting
copying ../src/boosting/dart.hpp -> ./compile/src/boosting
copying ../src/boosting/gbdt.cpp -> ./compile/src/boosting
copying ../src/boosting/gbdt.h -> ./compile/src/boosting
copying ../src/boosting/gbdt_model_text.cpp -> ./compile/src/boosting
copying ../src/boosting/gbdt_prediction.cpp -> ./compile/src/boosting
copying ../src/boosting/goss.hpp -> ./compile/src/boosting
copying ../src/boosting/prediction_early_stop.cpp -> ./compile/src/boosting
copying ../src/boosting/rf.hpp -> ./compile/src/boosting
copying ../src/boosting/score_updater.hpp -> ./compile/src/boosting
copying ../src/c_api.cpp -> ./compile/src
creating compile/src/io
copying ../src/io/bin.cpp -> ./compile/src/io
copying ../src/io/config.cpp -> ./compile/src/io
copying ../src/io/dataset.cpp -> ./compile/src/io
copying ../src/io/dataset_loader.cpp -> ./compile/src/io
copying ../src/io/dense_bin.hpp -> ./compile/src/io
copying ../src/io/dense_nbits_bin.hpp -> ./compile/src/io
copying ../src/io/file_io.cpp -> ./compile/src/io
copying ../src/io/metadata.cpp -> ./compile/src/io
copying ../src/io/ordered_sparse_bin.hpp -> ./compile/src/io
copying ../src/io/parser.cpp -> ./compile/src/io
copying ../src/io/parser.hpp -> ./compile/src/io
copying ../src/io/sparse_bin.hpp -> ./compile/src/io
copying ../src/io/tree.cpp -> ./compile/src/io
copying ../src/lightgbm_R.cpp -> ./compile/src
copying ../src/main.cpp -> ./compile/src
creating compile/src/metric
copying ../src/metric/binary_metric.hpp -> ./compile/src/metric
copying ../src/metric/dcg_calculator.cpp -> ./compile/src/metric
copying ../src/metric/map_metric.hpp -> ./compile/src/metric
copying ../src/metric/metric.cpp -> ./compile/src/metric
copying ../src/metric/multiclass_metric.hpp -> ./compile/src/metric
copying ../src/metric/rank_metric.hpp -> ./compile/src/metric
copying ../src/metric/regression_metric.hpp -> ./compile/src/metric
copying ../src/metric/xentropy_metric.hpp -> ./compile/src/metric
creating compile/src/network
copying ../src/network/linker_topo.cpp -> ./compile/src/network
copying ../src/network/linkers.h -> ./compile/src/network
copying ../src/network/linkers_mpi.cpp -> ./compile/src/network
copying ../src/network/linkers_socket.cpp -> ./compile/src/network
copying ../src/network/network.cpp -> ./compile/src/network
copying ../src/network/socket_wrapper.hpp -> ./compile/src/network
creating compile/src/objective
copying ../src/objective/binary_objective.hpp -> ./compile/src/objective
copying ../src/objective/multiclass_objective.hpp -> ./compile/src/objective
copying ../src/objective/objective_function.cpp -> ./compile/src/objective
copying ../src/objective/rank_objective.hpp -> ./compile/src/objective
copying ../src/objective/regression_objective.hpp -> ./compile/src/objective
copying ../src/objective/xentropy_objective.hpp -> ./compile/src/objective
creating compile/src/treelearner
copying ../src/treelearner/data_parallel_tree_learner.cpp -> ./compile/src/treelearner
copying ../src/treelearner/data_partition.hpp -> ./compile/src/treelearner
copying ../src/treelearner/feature_histogram.hpp -> ./compile/src/treelearner
copying ../src/treelearner/feature_parallel_tree_learner.cpp -> ./compile/src/treelearner
copying ../src/treelearner/gpu_tree_learner.cpp -> ./compile/src/treelearner
copying ../src/treelearner/gpu_tree_learner.h -> ./compile/src/treelearner
copying ../src/treelearner/leaf_splits.hpp -> ./compile/src/treelearner
creating compile/src/treelearner/ocl
copying ../src/treelearner/ocl/histogram16.cl -> ./compile/src/treelearner/ocl
copying ../src/treelearner/ocl/histogram256.cl -> ./compile/src/treelearner/ocl
copying ../src/treelearner/ocl/histogram64.cl -> ./compile/src/treelearner/ocl
copying ../src/treelearner/parallel_tree_learner.h -> ./compile/src/treelearner
copying ../src/treelearner/serial_tree_learner.cpp -> ./compile/src/treelearner
copying ../src/treelearner/serial_tree_learner.h -> ./compile/src/treelearner
copying ../src/treelearner/split_info.hpp -> ./compile/src/treelearner
copying ../src/treelearner/tree_learner.cpp -> ./compile/src/treelearner
copying ../src/treelearner/voting_parallel_tree_learner.cpp -> ./compile/src/treelearner
copying ../windows/LightGBM.sln -> ./compile/windows
copying ../windows/LightGBM.vcxproj -> ./compile/windows
copying ../CMakeLists.txt -> ./compile/
copying ../LICENSE -> ./
INFO:LightGBM:Starting to compile the library.
INFO:LightGBM:Starting to compile with CMake.
Traceback (most recent call last):
File "setup.py", line 68, in silent_call
output = subprocess.check_output(cmd, stderr=subprocess.STDOUT)
File "/Users/hong/anaconda/lib/python3.6/subprocess.py", line 336, in check_output
**kwargs).stdout
File "/Users/hong/anaconda/lib/python3.6/subprocess.py", line 418, in run
output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['cmake', '../compile/']' returned non-zero exit status 1.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "setup.py", line 282, in
'Topic :: Scientific/Engineering :: Artificial Intelligence'])
File "/Users/hong/anaconda/lib/python3.6/site-packages/setuptools/init.py", line 129, in setup
return distutils.core.setup(**attrs)
File "/Users/hong/anaconda/lib/python3.6/distutils/core.py", line 148, in setup
dist.run_commands()
File "/Users/hong/anaconda/lib/python3.6/distutils/dist.py", line 955, in run_commands
self.run_command(cmd)
File "/Users/hong/anaconda/lib/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "setup.py", line 208, in run
opencl_include_dir=self.opencl_include_dir, opencl_library=self.opencl_library)
File "setup.py", line 154, in compile_cpp
silent_call(cmake_cmd, raise_error=True, error_msg='Please install CMake and all required dependencies first')
File "setup.py", line 77, in silent_call
raise Exception("\n".join((error_msg, log_notice)))
Exception: Please install CMake and all required dependencies first
The full version of error log was saved into /Users/hong/LightGBM_compilation.log
And LightGBM_compilation.log shows that:
-- The C compiler identification is AppleClang 9.0.0.9000039
-- The CXX compiler identification is AppleClang 9.0.0.9000039
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error at CMakeLists.txt:26 (message):
AppleClang wasn't supported.  Please see
https://github.com/Microsoft/LightGBM/blob/master/docs/Installation-Guide.rst#macos
-- Configuring incomplete, errors occurred!
See also "/Users/hong/LightGBM/python-package/build_cpp/CMakeFiles/CMakeOutput.log".
I'm sure I have installed cmake by: brew install cmake
how can I deal with this problem?

Did brew install gcc install gcc 7 ?

I'm not sure, since I just "brew install gcc". And now, when I do this on the terminal:  brew install gcc7
It shows,
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 1 tap (homebrew/core).
==> Updated Formulae
clac                       glslang                    pcre2
elasticsearch@5.6          hcloud                     planck
gjs                        jpegoptim                  swiftformat
Error: No available formula with the name "gcc7"
==> Searching for a previously deleted formula (in the last month)...
Warning: homebrew/core is shallow clone. To get complete history run:
git -C "$(brew --repo homebrew/core)" fetch --unshallow
Error: No previously deleted formula found.
==> Searching for similarly named formulae...
==> Searching local taps...
Error: No similarly named formulae found.
==> Searching taps...
==> Searching taps on GitHub...
Error: No formulae found in taps.

For the log, the error is
CMake Error at CMakeLists.txt:26 (message):
AppleClang wasn't supported. Please see
https://github.com/Microsoft/LightGBM/blob/master/docs/Installation-Guide.rst#macos

So it seems the gcc isn't used by cmake.
Did it throw the error If you run following cmd only ?
brew install cmake
brew install gcc
git clone --recursive https://github.com/Microsoft/LightGBM ; cd LightGBM
export CXX=g++-7 CC=gcc-7
mkdir build ; cd build
cmake ..
make -j4

MacBook-Pro:~ hong$ cd LightGBM
MacBook-Pro:LightGBM hong$ export CXX=g++-7 CC=gcc-7
MacBook-Pro:LightGBM hong$ mkdir build
mkdir: build: File exists
MacBook-Pro:LightGBM hong$ cd build
MacBook-Pro:build hong$ cmake ..
-- Found OpenMP_C: -fopenmp
-- Found OpenMP_CXX: -fopenmp
-- Found OpenMP: TRUE
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/hong/LightGBM/build
MacBook-Pro:build hong$ make -j4
[ 50%] Built target _lightgbm
[100%] Built target lightgbm

No, it didn't throw any error.

okay, so you can install python package via -p.
brew install cmake
brew install gcc
git clone --recursive https://github.com/Microsoft/LightGBM ; cd LightGBM
export CXX=g++-7 CC=gcc-7
mkdir build ; cd build
cmake ..
make -j4
cd LightGBM/python-package
python setup.py install -p

error: [Errno 13] Permission denied: '/Users/hong/LightGBM_compilation.log'
you may need to run by root

@guolinke It works, thanks! 真是太谢谢了，请原谅我这个小白。

you are welcome

repo: Microsoft/LightGBM


text:
Update reference assemblies

Updates our reference assemblies and makes it easier to have VS 2015 and VS 2017 actively working on the same repository.

👍

authors: huguesv zooba

repo: Microsoft/PTVS


text:
1.0RC documentation

Documentation staged for 1.0RC1

👍

authors: MikhailArkhipov jflam

repo: Microsoft/RTVS-docs


text:
Fix #3037: Fix hack for debugger breakpoints focus in VS 2017

Register REPL tool window via IVsDebugger6.RegisterFocusPreservingWindow in VS 2017, and disable the workaround.
Fix VS 2015 focus workaround not working when there is an active project.

👍

repo: Microsoft/RTVS


text:
Cannot communicate with the MS Launchpad Service

Followed the installation instructions for RServices in SQL Server 2016, but am not able to test any of these due to this issue.  I've tried searching for solutions every where and have lost a few days of time trying to find the solution with no luck to date.

Although this is an old issue, please note that this repo is for samples only. If you have issues with RServices, please use our forums.

authors: jeroenterheerdt wbuchanan

repo: Microsoft/SQL-Server-R-Services-Samples


text:
Extend external modules declared in @types npm dependency

TypeScript Version:  nightly (2.0.0-dev.201xxxxx)
Code
npm i @types/estree;

// myESTreeExtension.ts
declare module 'estree' {
    interface MyAddon {
   }
}

// Some other file.ts
import * as estree from 'estree';

let a: estree.Node; // ERROR: [ts] Module ''estree'' has no exported member 'Node'.

Expected behavior:
I would expect i can extend an external module as described here: #280
Actual behavior:
The ambient module in myESTreeExtension.ts overrides the @types/estree types
Remark: I'm a big fan of the new work flow with @types. Great job!

make sure the file that contains the module augmentation is itself a module (i.e. includes at least one top-level import or export).
so this should work:
import * as estree from 'estree';

declare module 'estree' {
    interface MyAddon {
   }
}

Thanks @mhegazy, this works. When using the extensions you need to do this:
import * as estree from 'estree';
import 'myESTreeExtension';

let a: estree.Node; // Works
let b: estree.MyAddon; // Works as well

Sorry to ask here since the bug is closed but i have a similar problem with KoaJS definitions here.
The Koa definition file looks like this:
declare namespace Koa { }
export = Koa;
declare namespace Koa {
    export interface Context extends Request, Response {
    }
    // ... more things
}
declare class Koa extends EventEmitter {
   // ... things
}

And i want to be able to do something like (as suggested here and here):
import * as Koa from 'koa';
const server: Koa = new Koa();
server.name = 'UrbanScope';
server.context.db = db; // server.context is Koa.Context

But i keep getting TS2339 errors from tsc like:
src/server.ts(60,10): error TS2339: Property 'name' does not exist on type 'Koa'.
src/server.ts(63,18): error TS2339: Property 'db' does not exist on type 'Context'.

Following your advice i created a augment.ts file with:
import * as Koa from 'koa';
import { Db } from 'mongodb';
declare module 'koa' {
    namespace Koa {
        interface Context {
            db: Db,
        }
    }
    class Koa {
        name?: string;
    }
}

But the errors are still there 😨 , i tried with a number of export/namespace/class/declare combinations with no luck. Any idea on how to solve it?

given the way Koa is authored extending the class is not possible. as for the interface context, you should be able to do that as:
import * as Koa from 'koa';
import { Db } from 'mongodb';

declare module 'koa' {
        interface Context {
            db: Db,
        }
}

It works!
Thanks for you support!

I am having a similar issue, but for interface merging (adding new interfaces works just fine).
// index.d.ts for Router5
declare module 'Router5' {
   // ...
   interface Router {
       // ....
       stop(): Router;
   }
}

// some_extension.ts
import * as Router from 'router5';
declare module 'router5' {
    interface Router {
        foo(): void;
    }
}

// test.ts
import { Router } from 'router5';
import 'some_extension';

function test(router: Router) {
    router.foo(); // this is ok
    router.stop(); // TS2339: Property 'stop' does not exist on type 'Router'.
}

I'm trying to extend a class, but it seems to override the whole class with my new definition. F.e.:
import * as THREE from 'three'

declare module 'three' {
	export class OrbitControls {
		setCamera( cam: THREE.Camera ): void
	}
}

Now my code has no errors when using the setCamera method, but there is now a type error on the use of all the other stuff in the OrbitControls class, so it looks like the @types/three version was replaced with my version.
How do we extend the class defintion of a module?

authors: Volox mhegazy nicojs tals trusktr

repo: Microsoft/TypeScript


text:
Method and accessor decorators should modify type based on returned descriptor

Method and accessor decorators should modify the type of the method/accessor based on the return type of the property descriptor.
Additionally, property descriptors should be parameterised based on the type of the property they're describing, with the appropriate types for get/set and value
TypeScript Version:  2.1.1
Code
function stringified(target:any, property:string, descriptor:PropertyDescriptor) {
    let oldGetter = descriptor.get
    return {
        get: function () {
            return oldGetter().toString()
        }
    }
}

class Test {
    @stringified get getter() {
        return 5;
    }
}

let x = new Test().getter
x.startsWith('5')

Expected behavior:
The return type of the getter is string and the code compiles without errors.
Actual behavior:
The type of x is still number

Decorators are not allowed to change the type of declaration. allowing this is tracked by https://github.com/Microsoft/TypeScript/issues/4881.
You should get an error if you try to change the type. The reason you did not get this error is your decorator function is typed to return any for all properties. since any is a subtype of number, you do not get an error. if it however was typed as:
function stringified<T>(target:any, property:string, descriptor:TypedPropertyDescriptor<T>) ...

you should get an error on the application of the decorator.

authors: mhegazy spion


text:
Operation of "instanceof" is illegal when "target:es5"

typescript2.1.4
class MyError extends Error {}
let e=new MyError();
console.log(e instanceof MyError);

target:es5

false

target:es6

true

duplicate of https://github.com/Microsoft/TypeScript/issues/12790
Please see https://github.com/Microsoft/TypeScript/wiki/Breaking-Changes#extending-built-ins-like-error-array-and-map-may-no-longer-work

authors: kgtkr mhegazy


text:
Rename of import should be a local rename

TypeScript Version:  nightly (2.2.0-dev.20170213)
Code
import { readFileSync } from "fs";
readFileSync("a.txt");

Rename readFileSync to read.
Expected behavior:
import { readFileSync as read } from "fs";
read("a.txt");

Actual behavior:
import { read } from "fs";
read("a.txt");

And @types/node/index.d.ts is modified too!

The current behavior is exactly what I expect and want.
To rename all instances of something in a given file, Ctrl+D is really useful.

What editor are you using? What does Ctrl+D do?

I think it would be better to leave the current way as it is, and use this trick to do the alias rename only

Initial
import { readFileSync } from "fs"

Use alias
import { readFileSync as readFileSync } from "fs"

Rename alias (right readFileSync to read)

Unfortunately there is related bug: https://github.com/Microsoft/TypeScript/issues/10894

@andy-ms Ah, sorry; I was actually thinking of this as an editor feature/tool, rather than a language one (kind of surprises me that the language itself controls this). I use VS Code. Ctrl+D selects other strings of text matching the one you have highlighted. This is multi-line selecting, so you can edit all of them at once. Exceedingly useful feature.

I think the behavior should depend on the context, but I am not sure it is possible.
Say, given
import { readFileSync } from "fs";
readFileSync("a.txt");

If the cursor is in the readFileSync call, I'd expect renaming it to create an alias; while if I either go to the definition, or rename it from the import specifier itself, to rename the symbol definition.
A similar issue exists with object shorthand notation (renaming a symbol that's used in shorthand also renames its object key, instead of separating the key/value).

Related to #19173 and #15787

@krryan

Ah, sorry; I was actually thinking of this as an editor feature/tool, rather than a language one (kind of surprises me that the language itself controls this).

It makes a lot of sense for the language to control this; correct refactorings require deep knowledge of the semantics of the language being edited.

I use VS Code. Ctrl+D selects other strings of text matching the one you have highlighted. This is multi-line selecting, so you can edit all of them at once. Exceedingly useful feature.

It is a useful approximation when you don't have better tools for the job, i.e. semantically-aware refactorings.
I think this change is needed, at least in the case where a refactor would end up editing a file under node_modules; that's never what you meant to do.

authors: Kovensky andy-ms krryan mhegazy normalser pelotom


text:
Type guard fails to narrow union type

This works, AS EXPECTED:
class Cat {}
class Dog {}

function logType1(animal: Cat|Dog) {
	if (animal instanceof Cat) {
		console.log("cat");
	}
	else if (animal instanceof Dog) {
		console.log("dog");
	}
}

This doesn't work, which is debatable since undefined instanceof Cat is legal JS but I prefer the type warning since it catches errors:
function logType2(animal: Cat|Dog|void) {
	if (animal instanceof Cat) {
		console.log("cat");
	}
	else if (animal instanceof Dog) {
		console.log("dog");
	}
}

This doesn't work, but I would definitely expect it to:
function logType3(animal: Cat|Dog|void) {
	if (typeof animal === "undefined" || animal === null) { // edited to check for null as well, since void can be either
		console.log("no animal");
	}
	else if (animal instanceof Cat) {
		console.log("cat");
	}
	else if (animal instanceof Dog) {
		console.log("dog");
	}
}

See playground for code.
As it stands, if a union type contains void, I don't know how to use instanceof with it.

Worth noting that this compiles fine, which is inconsistent:
function logType4(animal?: Cat) {
	if (animal instanceof Cat) {
		console.log("Cat");
	}
}

Since void is null or undefined, I think this behavior is inconsistent.

What exactly are you trying to accomplish by putting void in the union parts?

@danquirk in my code there's a callback function that I am not in control of, which can return a value of one of 2 types or nothing (undefined).  I'm trying to determine what type was returned by the function and I'm hitting this issue as a result.  It looks more like this:
interface AnimalOrNothing {
    (): Dog | Cat | void;
}

var getAnimal: AnimalOrNothing = () => {
    if (Math.random() > 0.5) {
        return new Dog();
    }
    else if (Math.random() > 0.5) {
        return new Cat();
    }
    else {
        return;
    }
}

var unknown = getAnimal();
if (unknown instanceof Dog) {
    unknown.bark();
}
else if (unknown instanceof Cat) {
    unknown.pur();
}
else {

}

Note that I don't have control over the method that can either return a value or nothing.

Since void is a basic type this issue looks to be related to #1785. The problem is when primitives are unioned with object types the compiler is not able to resolve instanceof.

With the fix in #1803, the instanceof operator now allows unions that contain primtives (including void), so I'm closing this bug.

Isn't 'void' implicit in any type?
interface AnimalOrNothing {
    (): string | number;
}

var getAnimal: AnimalOrNothing = () => {
    if (Math.random() > 0.5) {
        return new Dog();
    }
    else if (Math.random() > 0.5) {
        return new Cat();
    }
    else {
        return; // allowed already!
    }
}

var unknown = getAnimal();
if (unknown instanceof Dog) {
    unknown.bark();
}
else if (unknown instanceof Cat) {
    unknown.pur();
}
else {
  unknown // should narrow to void
}
// Or alternative
if (unknown == null) {
    unknown // narrows to void
}
else if (unknown instanceof Cat) {
    unknown.pur();
}
else {
    unknown.bark();
}

authors: NoelAbrahams ahejlsberg altano danquirk jbondc


text:
Quickfix for unused arrow function parameter results in invalid code

TypeScript Version:  nightly (typescript@2.6.0-dev.20170906)
Code
const f = x => 1;

Apply the Remove declaration for 'x' quickfix.
Expected behavior:
const f = () => 1;

Actual behavior:
const f = => 1;

It turns out that our infrastructure is not well-suited to synthesizing the required parameters.  We think that the emitter might do the right thing if we deleted the parameter list entry, but it might not and there would still be trivia issues.
TL;DR: This might be non-trivial.

authors: amcasey andy-ms


text:
Wrong type inferred for array of tuples

TypeScript Version:  3.1.6

Search Terms:
array tuple inference inferred argument
Code
let x = [["a", [1]]];

function f(arg: [string, number[]][]) {
}

f(x);

// If I declare x's type directly like this then it works:
// let x: [string, number[]][] = [["a", [1]]];

Expected behavior:
No error
Actual behavior:
Error:
Error:(352, 3) TS2345: Argument of type '(string | number[])[][]' is not assignable to parameter of type '[string, number[]][]'.
  Type '(string | number[])[]' is not assignable to type '[string, number[]]'.
    Property '0' is missing in type '(string | number[])[]'.

Playground Link:
Link

Duplicate of https://github.com/Microsoft/TypeScript/issues/16389

Also see my comment here.

I see, thank you for the quick response!

authors: DanielRosenwasser ahejlsberg chinhodado


text:
Excess property checking for instances or other object types

Search Terms

object literal class instance
treat object literal as class instance

Suggestion
According to this part of documentation, object literal is type-checked more strictly than other objects for excess properties. It would be nice to have feature to check excess properties for other "non-literal" objects such as class instances.

Use Cases
Let's say we have data fetched from database. It would include createdAt, updatedAt, or something like passwordHash. Some properties are not the best to get out of server.
When sending the data to client, I defined the payload type to not include those excess properties, but if the data is an form of class instance, the excess properties are allowed.

Examples
Playground link

Checklist
My suggestion meets these guidelines:

[x] This wouldn't be a breaking change in existing TypeScript/JavaScript code

If this feature is introduced as additional feature

[x] This wouldn't change the runtime behavior of existing JavaScript code
[x] This could be implemented without emitting different JS based on the types of the expressions
[x] This isn't a runtime feature (e.g. library functionality, non-ECMAScript syntax with JavaScript output, etc.)
[x] This feature would agree with the rest of TypeScript's Design Goals.

Exact types: #12936
Nominal types: #202
We don't have excess property checking on other object types because excess property checks are mostly meant to catch issues where an object literal is supposed to be used as a "bag of options".
To try to avoid other issues, we also have overlap checking for "weak types", where if there's no overlap between a Source type to a Target type, and the target type only has optional properties (i.e. it's "weak") then we error if there's no overlap.
But here, it's not even clear why this example should be an error:
const alex: Person = new Student('alex', 'alex@example.ac.jp', 20)

though I agree that this piece just feels inconsistent:
const john: Person = {
    name: 'john',
    email: 'john@example.com',
    age: 30
}

@ajafff @DanielRosenwasser
I have seen Exact types, but I wasn't sure if that was something I was looking for, but after looking back, it seems that they should result in what I want to see.
What would be the best way to do either

check excess property of non-object literal
force a value to be object literal
?

authors: DanielRosenwasser Hoishin


text:
allow class fields overload

This is what we can do in current ts version:
class Foo {
    public bar(a: number): void;
    public bar(a: string, b: number, c: boolean): void;

    public bar(a, b?, c?) {
        console.log(this);
        console.log(a, b, c);
    }
}

However, we want to use arrow functions to avoid this problem, so we have to write some code like this:
class Foo {
    public bar: (a: number) => void;
    public bar: (a: string, b: number, c: boolean) => void;

    public bar = (a, b?, c?) => {
        console.log(this);
        console.log(a, b, c);
    }
}

But currently typescript don't allow us to do that, so I hope typescript can overload class fields (arrow functions) in the future.

Thre isn't dedicated syntax for this, but you can easily declare a function field with overloads, and the syntax is not overly verbose IMO:
class Foo {
    public bar: {
        (a: number): void;
        (a: string, b: number, c: boolean): void;
    }  = (a: number | string, b?: number, c?: boolean) => {
        console.log(this);
        console.log(a, b, c);
    }
}

authors: dragomirtitian foisonocean


text:
Disallow global namespace from imported types.

It's really annoying that simply installing Jest will create global types that pollute the global namespace, not just in my type files, but the actual application files as well which makes my code less type-safe...
I think it would make sense if all global types had to be declared from your ts config so you can scope them to specific files.
I see other issues about this but I'm not sure a proper solution has been lofted.
Related Issues:
https://github.com/Microsoft/TypeScript/issues/5808

You can configure this by creating a separate tsconfig.json for tests and src and setting
"types": []

in the tsconfig.json for your src.

The dual of this issue is "Installing @types/node should automatically make Buffer available without more configuration", which is by far the more common scenario here.

Interesting. You're right, but now I'm even more confused how all of this is supposed to work. These three things seems to have a lot of conflated functionality.

npm install @types/node
lib: ["dom"]
types: []

Ideally importing node types would be similar to importing dom types.

For others who are having this same pain, my current workaround is just to rewrite the type definition files in post-install...
// No global exports from Jest. Use jestShim.ts.
rewrite("node_modules/@types/jest/index.d.ts", str => {
	return str
		.replace(/declare const/g, "export const")
		.replace(/declare var/g, "export var")
		.replace(/declare function/g, "export function")
})

rewrite("node_modules/@types/mocha/index.d.ts", str => {
	return str
		.replace(/declare const/g, "export const")
		.replace(/declare var/g, "export var")
		.replace(/declare function/g, "export function")
		.replace(/declare module "mocha"[^\}]+\}/m, "")
})

rewrite("node_modules/cypress/types/index.d.ts", str => {
	return str
		.replace(/declare const/g, "export const")
		.replace(/declare var/g, "export var")
		.replace(/declare function/g, "export function")
		.replace(
			`/// <reference types="sinon-chai" />\r\n\r\n`,
			`/// <reference types="sinon-chai" />\r\nimport { Mocha } from "mocha"\r\n`
		)
		.replace(
			`/// <reference types="sinon-chai" />\n\n`,
			`/// <reference types="sinon-chai" />\nimport { Mocha } from "mocha"\n`
		)
})

Then I just have to import the stuff I want from this jestShim.ts file which grabs the globals and gives them types.
/*

Jest exposes these functions in the global namespace, but we don't want
them to leak into the rest of the application so you have to import them
here and we use tools/fixGlobalTypes.ts post-install to cleanup.

Put this at the top of your test file and let ts-lint cleanup unused.

import {
	beforeAll,
	beforeEach,
	afterAll,
	afterEach,
	describe,
	fdescribe,
	xdescribe,
	it,
	fit,
	xit,
	test,
	xtest,
	expect,
	spyOn,
	pending,
	fail,
} from "./jestShim"

*/

import * as jest from "jest"

export const beforeAll: typeof jest.beforeAll = global["beforeAll"]
export const beforeEach: typeof jest.beforeEach = global["beforeEach"]
export const afterAll: typeof jest.afterAll = global["afterAll"]
export const afterEach: typeof jest.afterEach = global["afterEach"]
export const describe: typeof jest.describe = global["describe"]
export const fdescribe: typeof jest.fdescribe = global["fdescribe"]
export const xdescribe: typeof jest.xdescribe = global["xdescribe"]
export const it: typeof jest.it = global["it"]
export const fit: typeof jest.fit = global["fit"]
export const xit: typeof jest.xit = global["xit"]
export const test: typeof jest.test = global["test"]
export const xtest: typeof jest.xtest = global["xtest"]
export const expect: typeof jest.expect = global["expect"]
export const spyOn: typeof jest.spyOn = global["spyOn"]
export const pending: typeof jest.pending = global["pending"]
export const fail: typeof jest.fail = global["fail"]

As for this actual issue... Buffer is an interesting case, but that in fact leaks to the client in my codebase... Ideally it would use something more like lib so I can extend types in certain subdirectories.

authors: DanielRosenwasser RyanCavanaugh ccorcos


text:
HTML string inside TypeScript and JavaScript files

Copied from https://github.com/Microsoft/vscode/issues/2000
When using Angular 2 and TypeScript I noticed that editing template strings of components in TypeScript files are not working as one expect. There is not autocomplete for tags and other usual HTML editing features.
For example
import {Component} from 'angular2/core';

@Component({
    selector: 'my-app',
    template: '
My First Angular 2 App
'
})
export class AppComponent { }

Of course it's because the type definition has declared template as a String and no part of VSCode knows that it's an HTML string.
My proposal is to define a HTMLString type where it's basically just string but helps tooling in cases like this.
If it was possible to do this, then we can define CSSString, JavaScriptString, SCSSString and so on...

What is the take of the TS team on this?

See also #6508

this looks like a duplicate of #4856. please see my reply in https://github.com/Microsoft/TypeScript/issues/4856#issuecomment-141552809. the possible change here is as @DanielRosenwasser mentioned by allowing extensibility for the typescript language service.

authors: DanielRosenwasser dbaeumer mhegazy


text:
Transpiled ES5 has _invalid left-hand side of assignment expression

TypeScript Version:
1.7.3
Code
import { bindable, customElement } from 'aurelia-framework';

@customElement('my-element')
export class MyElement {
  @bindable heading = "Default heading";
}

Let me first say that I have discussed this with the creator of Aurelia, who is a very competent programmer, and he has looked at it and suggested I post it here, as there is something strange with the compilation (perhaps).
What I observe is that the generated ES5 JavaScript has an error, at least that's what VSCode tells me:
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
define(["require", "exports", 'aurelia-framework'], function (require, exports, aurelia_framework_1) {
    var MyElement = (function () {
        function MyElement() {
            this.heading = "Default heading";
        }
        __decorate([
            aurelia_framework_1.bindable,
            __metadata('design:type', Object)
        ], MyElement.prototype, "heading", void 0);
        MyElement = __decorate([
            aurelia_framework_1.customElement('my-element'),
            __metadata('design:paramtypes', [])
        ], MyElement);
        return MyElement;
    })();
    exports.MyElement = MyElement;
});

The error is on the line: MyElement = __decorate([ 7 lines from the end there.
and reads: _invalid left-hand side of assignment expression.`

The code is correct. it should run correctly, and will do what you expect.
VSCode is showing you an error here, because it is considered as bad practice to override a function declaration because of TDZ issues.
I agree that the TS emitted code should be held to the same standard, that we flag our users for doing.
having said that, the decorator proposal is undergoing a large change in the near future, and any change here will be undone by that.


text:
Abstract classes as the default export

Are abstract classes allowed to be the default export in a typescript file? I get a compilation error.
export default abstract class Service {
...
}

#3792, please search for duplicates before logging new issues.


text:
Type inference does not propagate properly across try/catch/finally blocks

"typescript": "1.9.0-dev.20160620-1.0"
function foo () {
  let maybe_connection : number | null;
  try {
    maybe_connection = 1;
  } finally {
    return maybe_connection;
  }
}

Compile error: "Variable 'maybe_connection' is used before being assigned."
Expected outcome: 'maybe_connection' is properly inferred as being assigned and usable
finally { if (maybe_connection instanceof number) { ... } }

gives a compile error as well.
Use case: To initialise a database connection, use it in a try-catch-finally, and then, if the connection was acquired, to terminate/return-to-pool the connection
Urgency: Not urgent, workarounds exist, e.g. casting to "any" type

This works as intended. We can't know for certain that the assignment has happened in the finally clause because an exception might happen anytime in the try block.

authors: ahejlsberg dingfengquek


text:
[Bug] Cannot default export an expression that begins with async

TypeScript Version:  nightly (2.0.0-dev.20160705)
The changes in #9445 have caused a breaking change in my code base. This is a pattern that we use very frequently our projects.
The compiled output has also changed and no longer functions as expected. The same error also occurs when using the async library in the same way (e.g. export default async.map(...))
Code
import {async,await} from 'asyncawait';
export default async(() => await(Promise.resolve(1)));

should compile without error and emit:
const asyncawait_1 = require('asyncawait');
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = asyncawait_1.async(() => asyncawait_1.await(Promise.resolve(1)));

but incorrectly emits:
const asyncawait_1 = require('asyncawait');
asyncawait_1.async(() => asyncawait_1.await(Promise.resolve(1)));

Expected behavior:
Compiles without error
Actual behavior:
[ts] Declaration expected
Incorrect compiled output

Looking at the changes in #9445, it seems that if the next token after export default is async, then it's treated like a declaration rather than an expression. But async is not a keyword (spec), and a valid expression may begin with an async token, as in @Seikho's two examples above.
I think export default <expression> should be allowed even if the expression is something like async.map(...) or async(() => {...}), since these are valid expressions.

If this makes it into the 2.0 release, it will be a breaking change.

Thanks for tracking the regression down @yortus!

authors: DanielRosenwasser Seikho yortus


text:
For completions of union type, get all possible properties

Fixes #6405 and #15428.
When providing completions for a union type, we will now iterate over all union members to get all possible properties, rather than just those common to the union. So for { a, b } | { b, c } we will give completions for a, b, c instead of just b.
The implementation of getAllPossiblePropertiesOfType could possibly be better, so it needs review from someone familiar with the checker.

thanks!

authors: andy-ms mhegazy


text:
Bind logger function before using

bind log function to avoid invalid access to this.

Does this need to be PR'd into master, too?

authors: mhegazy weswigham


text:
allowJs:true + declaration:true

[x] There is an associated issue. Fixes #7546
[x] Code is up-to-date with the master branch
[x] You've successfully run jake runtests locally
[x] You've signed the CLA
[x] There are new or updated unit tests validating the change

** TODO **
From previous PR: #15911

[ ] Fix commented out tsserver test. Not sure what the correct fix is
[ ] ES5 prototype style function definitions

function f() {
}
f.prototype.method = function() {}   // should probably emit a class?

[ ] @typedef {Object} SpecialType -> Interfaces

/**
 * @typedef {object} SpecialType1 - creates a new type named 'SpecialType'
 * @property {string} prop1 - a string property of SpecialType
 * @property {number} prop2 - a number property of SpecialType
 * @property {number=} prop3 - an optional number property of SpecialType
 */
/** @type {SpecialType1} */
var specialTypeObject1;

[ ] Recognize @private/@readonly -> private X / readonly X

  /** @private */
  _render() {...}

  /** @readonly */
  static observedAttributes() {...}

This looks awesome! Is there an ETA to release?

Needs some work on emitting part for type interfaces described in jsdocs.
I’ve been using puppeteer project as a real world test case to solve.
Typescript doesn’t understand that module.exports should also export the
interfaces so need to solve that too.
I think a lot of these can be sped up if I could get a mentor from
Typescript team.
This isn’t as easy as I thought it would be.
Please help Typescript.

I did a quick test of this on a project I am developing for. It works great except that it automatically detects require("SOMETHING") as a module import even if the TypeScript module setting is set to none.
This is a weird quirk of the code I am dealing with but it would be nice to be able to disable module detection. Since in my case require is just another function.

Yeah there are lots of little quirks like that to work out.
But being able to auto-generate types for js projects is going to be amazing.

@nojvek Once #21930 is merged, I'd like to write a transformer for JS files that simply iterates over their exported symbols, gets their declared types, and uses a modified typeToTypeNode on them to generate declarations for all required symbols. It needs to be a very different process from our usual subtractive declaration emit.

ooo I like it. Do you have a guesstimate for the merge ?

What needs to be done to finish this effort?

I basically just need to re-focus and get back into it. TSC has moved some pieces around so need to re-base and figure out the merge conflicts + tests.
Hopefully we don't end up bikeshedding again. Been trying to land this for a couple of years now :/

You probably want to start fresh rather than attempt a rebase - the declaration emit pipeline has entirely changed since this PR was last updated.

@nojvek thanks for the work so far! I'm going to close this since it's going to require a substantial rebasing anyway. Looking forward to the next iteration.

authors: DSchroer RyanCavanaugh TeffenEllis ahocevar nojvek weswigham


text:
always set NodeCheckFlags when checking super expression

otherwise emit for super calls when base class information is not accessible for typechecker (i.e. in single file compilation cases) will be incorrect. Fixes #4118.
Also PR slightly reorganizes the code in checkSuperExpression to make it more readable- reduced nesting and simplified usage of variables

:+1:

authors: mhegazy vladima


text:
Implement CTFontCopyLocalizedName and CTFontCopyAvailableTables

Fixes #2023

@Notes Returns family name

super nit: I feel the note here could be better.
Just saying returns family name doesn't help.
So It doesn't return the full name and  'only' returns family name?

Refers to: Frameworks/CoreGraphics/CGFont.mm:225 in 031bf91. [](commit_id = 031bf915137be104e665baba20ba335ea4990ce1, deletion_comment = False)

Ah, I see. I didn’t see that it allowed freeform input.

ping @rajsesh-msft @msft-Jeyaram

ping @rajsesh-msft @msft-Jeyaram

authors: DHowett-MSFT aballway msft-Jeyaram

repo: Microsoft/WinObjC


text:
install WDTF failed

environment:    host : win7 64 + vs2017 + WDK10
target : win7 64 in vmware
I have configed target machine  refered to msdn,   then I config vs2017 : Driver->configure Devices to add a test device,  and after some step,  when it install "Windows Driver Testing Framework (WDTF) Runtime Libraries-x64_en-us.msi", it failed:
WDTFInstall:    Process "C:\Program Files (x86)\Windows Kits\10\Testing\Runtimes\WDTF\RunTime\Actions\Deprecated\DeviceManagement.dll".
WDTFInstall:    Process "C:\Program Files (x86)\Windows Kits\10\Testing\Runtimes\WDTF\RunTime\Actions\DeviceSupport\WDTFDeviceSupportAction.dll".
MSI (s) (28!08) [17:11:40:880]: Product: Windows Driver Testing Framework (WDTF) Runtime Libraries -- WDTFInstall:       ERROR: Failed to load DLL
WDTFInstall:       ERROR: Failed to load DLL
MSI (s) (28!08) [17:11:40:895]: Product: Windows Driver Testing Framework (WDTF) Runtime Libraries -- WDTFInstall:       ERROR: 183
WDTFInstall:       ERROR: 183
MSI (s) (28!08) [17:11:40:895]: Product: Windows Driver Testing Framework (WDTF) Runtime Libraries -- WDTFInstall:       ERROR:

I've encountered the same issue with win8.1 64 + vs 2017 + WDK10。
Can it be addressed ?

authors: babyaaaaaa phh-cg

repo: Microsoft/Windows-driver-samples

license: MS-PL


text:
Link to Download Zip of samples broken link.

There seems to have been a lot of moving destinations around recently.
The Windows IoT Core (https://developer.microsoft.com/en-us/windows/iot/samples)
no longer links to samples.
The path seems to have been changed from master to develop. Is this intentional?
e.g. Original link
https://github.com/Microsoft/Windows-iotcore-samples/tree/master/Samples/HelloBlinky
Actual link.
https://github.com/Microsoft/Windows-iotcore-samples/tree/develop/Samples/HelloBlinky

Hi John, due to a bit of a fire we had to put out, those links were temporarily changed to develop. They are back to master now.

authors: JohnDrinkall saraclay

repo: Microsoft/Windows-iotcore-samples


text:
BluetoothAdvertising Sample

Hi,
I built the BluetoothAdvertising solution and the program seems to run properly, except it does not seem to recognize my Bluetooth USB dongle.  Where does one tell the program which device to use for advertising or what the Bluetooth radio address is?
Thanks!

Do you have two radios on the system (one internal and one dongle)? This is an unsupported case and you will likely run into inconsistencies. Only way to definitely tell the OS what radio to use is through DeviceManager (Win + x, m). Disable all radios but one and you will know you've got one available.
Another possibility is the dongle does not support Bluetooth LE (please make sure the dongle supports BT 4.0 or higher for the sample to work).

authors: kpathakota lbreton

repo: Microsoft/Windows-universal-samples


text:
Handle query plan flow problems

There was timing issues with the query plan which would cause errors when query plans were being shown.
fixes #2911, fixes #2641

@anthonydresser thanks for the quick turn-around!  I'll merge now to test for Oct release.

@anthonydresser it looks like this broke some test in master (see the travis ci build), any idea what's going on with it?

authors: MattIrv anthonydresser kburtram

repo: Microsoft/azuredatastudio


text:
Does not support paste of monetary values

When pasting input that contains a prefix currency symbol (e.g., $5), the display shows "Invalid input". We should not treat this as invalid input, but instead trim away prefix currency symbols and treat them as numerical values.

Hi I can take this one but can you clarify which currency symbols should be trimmed away? Should all world currency symbols be trimmed and if so is there an official world currency list that should be used for reference?

Awesome! Thanks for taking a look. At a minimum, I think we should support trimming the currency symbols supported by the Windows keyboard:

yen or yuan (¥)
unspecified currency sign (¤)
Ghanaian cedi (₵)
dollar or peso ($)
colón (₡)
won (₩)
shekel (₪)
naira (₦)
Indian rupee (₹)
pound (£)
euro (€)

It should also trim commas, ex. 123,456.78.

I believe commas are already trimmed but are then formatted back in at some point. I'm having troubles finding where that is done at the moment. For example if you type in 1000 it will get formatted to 1,000.

@grochocki, I have a question about the behavior here.  When pasted into Currency Converter, it feels like the units should be switched to the same monetary unit.  Separate issue or same?

@danbelcher-MSFT I like the idea, but let's treat that as a separate issue.

authors: AldoMX MicrosoftIssueBot danbelcher-MSFT grochocki willibrandon

repo: Microsoft/calculator


text:
co_await and IAsync::get() difference

co_await suspend the current executing function.
IAsyncAction::get() or IAsyncOoperation<...>::get block the current executing thread.
suspension on a function also blocks the rest of code in a function to be executed.
so what's the difference between these two concepts in simple example.

The co_await suspension is cooperative. While it prevents further execution of the current function (coroutine), it returns execution back to the caller immediately so that it doesn't block the progress of the thread itself. The get() suspension is not cooperative. It blocks execution of the calling thread indefinitely.

another way of playing around and to understand the co_await behavior is to use "F10 step over". It shows that co_await directly returns execution back to caller and will come back to this moment later.

authors: bigdimboom kennykerr

repo: Microsoft/cppwinrt


text:
Microsoft .NET Framework 4.7.1 Developer Pack is not supported on Windows 10 Pro

Hi,
I tried to install .NET Framework 4.7.1 using web installer and also using offline installer, but click here for the blocking issue which is not allowing to install the framework.
Blocking Issue
Here are my operating system details.

OS Name: Microsoft Windows 10 Pro
OS Version: 10.0.10586 N/A Build 10586
OS Manufacturer: Microsoft Corporation
OS Configuration: Member Workstation
OS Build Type: Multiprocessor Free

Currently .NET Framework 4.6.1 is available in the OS. Can some suggest how I can resolve this issue and install 4.7.1!
Thanks,
Avinash

Got a response in MSDN, .NET Framework 4.7.1 is not supported in Window 10 Build 10586.
.NET Framework 4.7.1 is supported only in Windows 10 Build 14393 and above, closing the issue.

repo: Microsoft/dotnet


text:
Race condition on generate

A recent CI/CD test on a documentation change uncovered a race condition:
=== RUN   TestGenerateJSON
time="2019-04-18T14:26:16Z" level=info msg="💾  Loading ../test/fixtures/generate/component.json"
time="2019-04-18T14:26:16Z" level=info msg="💾  Loading ../test/fixtures/generate/infra/component.json"
time="2019-04-18T14:26:16Z" level=info msg="💾  Loading ../test/fixtures/generate/infra/config/prod.json"
time="2019-04-18T14:26:16Z" level=info msg="💾  Loading ../test/fixtures/generate/infra/config/common.json"
time="2019-04-18T14:26:16Z" level=info msg="💾  Writing ../test/fixtures/generate/generated/prod-east-prod/microservices-workload.yaml"
time="2019-04-18T14:26:16Z" level=info msg="🙌  finished generate"
==================
WARNING: DATA RACE
Read at 0x00c0001ce130 by goroutine 12:
  runtime.chansend()
      /usr/local/go1.11/src/runtime/chan.go:140 +0x0
  github.com/Microsoft/fabrikate/core.WalkComponentTree.func5.1()
      /home/vsts/work/1/s/gopath/src/github.com/Microsoft/fabrikate/core/component.go:286 +0x1d0

Previous write at 0x00c0001ce130 by goroutine 11:
  runtime.closechan()
      /usr/local/go1.11/src/runtime/chan.go:327 +0x0
  github.com/Microsoft/fabrikate/core.WalkComponentTree.func1()
      /home/vsts/work/1/s/gopath/src/github.com/Microsoft/fabrikate/core/component.go:246 +0x285
  github.com/Microsoft/fabrikate/core.WalkComponentTree.func5.1.1.1()
      /home/vsts/work/1/s/gopath/src/github.com/Microsoft/fabrikate/core/component.go:293 +0x139
  github.com/Microsoft/fabrikate/core.WalkComponentTree.func5.1.1()
      /home/vsts/work/1/s/gopath/src/github.com/Microsoft/fabrikate/core/component.go:299 +0xf4

Goroutine 12 (running) created at:
  github.com/Microsoft/fabrikate/core.WalkComponentTree.func5()
      /home/vsts/work/1/s/gopath/src/github.com/Microsoft/fabrikate/core/component.go:282 +0x14a

Goroutine 11 (running) created at:
  github.com/Microsoft/fabrikate/core.WalkComponentTree.func5.1()
      /home/vsts/work/1/s/gopath/src/github.com/Microsoft/fabrikate/core/component.go:289 +0x20f
==================
panic: send on closed channel

goroutine 21 [running]:
github.com/Microsoft/fabrikate/core.WalkComponentTree.func5.1(0xc0001ce120, 0xbea2f8, 0xc000198480, 0xc000188450, 0xc0001984a0, 0xc00002ac88, 0x5, 0x0, 0x0, 0x0, ...)
	/home/vsts/work/1/s/gopath/src/github.com/Microsoft/fabrikate/core/component.go:286 +0x1d1
created by github.com/Microsoft/fabrikate/core.WalkComponentTree.func5
	/home/vsts/work/1/s/gopath/src/github.com/Microsoft/fabrikate/core/component.go:282 +0x14b
FAIL	github.com/Microsoft/fabrikate/cmd	0.026s

I am running the tests on CI/CD with the -race flag:
$ go test -v -race ./...

@evanlouie Potentially related to https://github.com/Microsoft/fabrikate/commit/458d280936e13aede6346c40f06b721f73bcda59

repo: Microsoft/fabrikate


text:
DialPipe doesn't retry on ERROR_FILE_NOT_FOUND

I am seeing an error where DialPipe is returning ERROR_FILE_NOT_FOUND (2). If I retry a few times the function succeeds. I see DialPipe only retries if it received ERROR_PIPE_BUSY. However I took a look at the npipe library and it seems like it retries on either ERROR_PIPE_BUSY or ERROR_FILE_NOT_FOUND.
I have not tested npipe but I am using a work around of retrying DialPipe every 10ms if it returns this errno which seems to resolve my issue. I think DialPipe should do this internally the same way it handles ERROR_PIPE_BUSY, retrying until it exceeds the overall timeout. Although I am not familiar with windows APIs and it seems counter intuitive that "file not found" would be a temporary error.

@camr2 - This is by design. It doesn't make sense from a client perspective to retry waiting for a server connection to be started (IE: enter the listen/accept state). A client should really only be trying to connect to a path that is already created.

I believe the server has started listening, I used os.Stat which seems to think the file path exists, but even afterwards I get "file not found". I am integrating my client with a c application that is not using this library, so it is possible that app is not starting the server connection correctly. But I found it interesting that the npipe library retries on "file not found." This is happening on a particularly sluggish hyper-v VM.

repo: Microsoft/go-winio


text:
Monarch languages typescript interfaces are inconsistent

monaco-editor version: 0.13.1

Shortend expressions can't be used in a Monarch language definition. For example, IMonarchLanguageBracket  interface is

   /**
     * This interface can be shortened as an array, ie. ['{','}','delimiter.curly']
     */
    export interface IMonarchLanguageBracket {
        /**
         * open bracket
         */
        open: string;
        /**
         * closeing bracket
         */
        close: string;
        /**
         * token class
         */
        token: string;
    }

so I can't use proposed ['{','}','delimiter.curly'] shorthand.

Moreover, I can't declare any common regular expressions or keywords or operators in a language definition without extending IMonarchLanguage interface. Cause it's the following:

   /**
     * A Monarch language definition
     */
    export interface IMonarchLanguage {
        /**
         * map from string to ILanguageRule[]
         */
        tokenizer: {
            [name: string]: IMonarchLanguageRule[];
        };
        /**
         * is the language case insensitive?
         */
        ignoreCase?: boolean;
        /**
         * if no match in the tokenizer assign this token class (default 'source')
         */
        defaultToken?: string;
        /**
         * for example [['{','}','delimiter.curly']]
         */
        brackets?: IMonarchLanguageBracket[];
        /**
         * start symbol in the tokenizer (by default the first entry is used)
         */
        start?: string;
        /**
         * attach this to every token class (by default '.' + name)
         */
        tokenPostfix: string;
    }

And tokenPostfix is not optional though here it has a default value.

And the biggest problem - IMonarchLanguageAction  interface:

export interface IMonarchLanguageAction {
        /**
         * array of actions for each parenthesized match group
         */
        group?: IMonarchLanguageAction[];
        /**
         * map from string to ILanguageAction
         */
        cases?: Object;
        /**
         * token class (ie. css class) (or "@brackets" or "@rematch")
         */
        token?: string;
        /**
         * the next state to push, or "@push", "@pop", "@popall"
         */
        next?: string;
        /**
         * switch to this state
         */
        switchTo?: string;
        /**
         * go back n characters in the stream
         */
        goBack?: number;
        /**
         * @open or @close
         */
        bracket?: string;
        /**
         * switch to embedded language (useing the mimetype) or get out using "@pop"
         */
        nextEmbedded?: string;
        /**
         * log a message to the browser console window
         */
        log?: string;
    }

If I declare a group of actions 'action: {group: [{token: 'keyword'}, {token: 'entity'}]}' for parenthesized match groups '/(first)(second)/' the code iscompiled succefully. But I get this error in runtime:
Error: myLanguage: an action must be a string, an object with a 'token' or 'cases' attribute, or an array of actions; in rule: tokenizer.root: (first)(second)
If I declare just an array of actions 'action : [{token: 'keyword'}, {token: 'entity'}]' which runs perfectly, thus I get a type error Type '{ token: string; }[]' has no properties in common with type 'IMonarchLanguageAction' during compilation.

@Geloosa PR welcome. The type definitions for a monarch language are not stellar. The root cause is that monarch was contributed to our project and was initially written in JavaScript. Ever since, we are trying to untangle the types it uses.

Fixed via https://github.com/Microsoft/vscode/pull/57439

Is this fix published to npm?

@cport1 it has.

authors: Geloosa alexandrudima cport1 davidgomes

repo: Microsoft/monaco-editor


text:
NRE in Microsoft.Build.Evaluation.Evaluator`4.ExpandAndLoadImportsFromUnescapedImportExpression

Version: 15.3.388.41745
msbuild crashes with stack trace:
MSBUILD : error MSB1025: An internal failure occurred while running MSBuild.
System.NullReferenceException: Object reference not set to an instance of an object.
   at Microsoft.Build.Evaluation.Evaluator`4.ExpandAndLoadImportsFromUnescapedImportExpression(String directoryOfImportingFile, ProjectImportElement importElement, String unescapedExpression, Boolean throwOnFileNotExistsError, List`1& imports)
   at Microsoft.Build.Evaluation.Evaluator`4.ExpandAndLoadImportsFromUnescapedImportExpressionConditioned(String directoryOfImportingFile, ProjectImportElement importElement, List`1& projects, Boolean throwOnFileNotExistsError)
   at Microsoft.Build.Evaluation.Evaluator`4.ExpandAndLoadImports(String directoryOfImportingFile, ProjectImportElement importElement)
   at Microsoft.Build.Evaluation.Evaluator`4.EvaluateImportElement(String directoryOfImportingFile, ProjectImportElement importElement)
   at Microsoft.Build.Evaluation.Evaluator`4.PerformDepthFirstPass(ProjectRootElement currentProjectOrImport)
   at Microsoft.Build.Evaluation.Evaluator`4.EvaluateImportElement(String directoryOfImportingFile, ProjectImportElement importElement)
   at Microsoft.Build.Evaluation.Evaluator`4.PerformDepthFirstPass(ProjectRootElement currentProjectOrImport)
   at Microsoft.Build.Evaluation.Evaluator`4.EvaluateImportElement(String directoryOfImportingFile, ProjectImportElement importElement)
   at Microsoft.Build.Evaluation.Evaluator`4.PerformDepthFirstPass(ProjectRootElement currentProjectOrImport)
   at Microsoft.Build.Evaluation.Evaluator`4.EvaluateImportElement(String directoryOfImportingFile, ProjectImportElement importElement)
   at Microsoft.Build.Evaluation.Evaluator`4.PerformDepthFirstPass(ProjectRootElement currentProjectOrImport)
   at Microsoft.Build.Evaluation.Evaluator`4.EvaluateImportElement(String directoryOfImportingFile, ProjectImportElement importElement)
   at Microsoft.Build.Evaluation.Evaluator`4.PerformDepthFirstPass(ProjectRootElement currentProjectOrImport)
   at Microsoft.Build.Evaluation.Evaluator`4.EvaluateImportElement(String directoryOfImportingFile, ProjectImportElement importElement)
   at Microsoft.Build.Evaluation.Evaluator`4.PerformDepthFirstPass(ProjectRootElement currentProjectOrImport)
   at Microsoft.Build.Evaluation.Evaluator`4.EvaluateImportElement(String directoryOfImportingFile, ProjectImportElement importElement)
   at Microsoft.Build.Evaluation.Evaluator`4.PerformDepthFirstPass(ProjectRootElement currentProjectOrImport)
   at Microsoft.Build.Evaluation.Evaluator`4.Evaluate(ILoggingService loggingService, BuildEventContext buildEventContext)
   at Microsoft.Build.Evaluation.Evaluator`4.Evaluate(IEvaluatorData`4 data, ProjectRootElement root, ProjectLoadSettings loadSettings, Int32 maxNodeCount, PropertyDictionary`1 environmentProperties, ILoggingService loggingService, IItemFactory`2 itemFactory, IToolsetProvider toolsetProvider, ProjectRootElementCache projectRootElementCache, BuildEventContext buildEventContext, ProjectInstance projectInstanceIfAnyForDebuggerOnly, SdkResolution sdkResolution)
   at Microsoft.Build.Execution.ProjectInstance.Initialize(ProjectRootElement xml, IDictionary`2 globalProperties, String explicitToolsVersion, String explicitSubToolsetVersion, Int32 visualStudioVersionFromSolution, BuildParameters buildParameters, ILoggingService loggingService, BuildEventContext buildEventContext, SdkResolution sdkResolution)
   at Microsoft.Build.Execution.ProjectInstance..ctor(String projectFile, IDictionary`2 globalProperties, String toolsVersion, BuildParameters buildParameters, ILoggingService loggingService, BuildEventContext buildEventContext)
   at Microsoft.Build.BackEnd.RequestBuilder.LoadProjectFromFile()
   at Microsoft.Build.BackEnd.BuildRequestConfiguration.InitializeProject(BuildParameters buildParameters, Func`1 loadProjectFromFile)
   at Microsoft.Build.BackEnd.RequestBuilder.LoadProjectIntoConfiguration()
   at Microsoft.Build.BackEnd.RequestBuilder.<BuildProject>d__57.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.Build.BackEnd.RequestBuilder.<BuildAndReport>d__49.MoveNext()

MSBUILD : error MSB1025: An internal failure occurred while running MSBuild.
System.NullReferenceException: Object reference not set to an instance of an object.
   at Microsoft.Build.CommandLine.MSBuildApp.BuildProject(String projectFile, String[] targets, String toolsVersion, Dictionary`2 globalProperties, ILogger[] loggers, LoggerVerbosity verbosity, DistributedLoggerRecord[] distributedLoggerRecords, Boolean needToValidateProject, String schemaFile, Int32 cpuCount, Boolean enableNodeReuse, TextWriter preprocessWriter, Boolean debugger, Boolean detailedSummary, ISet`1 warningsAsErrors, ISet`1 warningsAsMessages)
   at Microsoft.Build.CommandLine.MSBuildApp.Execute(String commandLine)

Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object.
   at Microsoft.Build.CommandLine.MSBuildApp.BuildProject(String projectFile, String[] targets, String toolsVersion, Dictionary`2 globalProperties, ILogger[] loggers, LoggerVerbosity verbosity, DistributedLoggerRecord[] distributedLoggerRecords, Boolean needToValidateProject, String schemaFile, Int32 cpuCount, Boolean enableNodeReuse, TextWriter preprocessWriter, Boolean debugger, Boolean detailedSummary, ISet`1 warningsAsErrors, ISet`1 warningsAsMessages)
   at Microsoft.Build.CommandLine.MSBuildApp.Execute(String commandLine)
   at Microsoft.Build.CommandLine.MSBuildApp.Main()

Crash dump: \\mlangfs1\public\tomat\Bugs\MSB2228

This is caused by assuming ex.InnerException is set which is not always the case.  My change to ignore missing imports altered behavior around catching exceptions when evaluation imports.  This line previously would be checking if the InvalidProjectFileException was really just a wrapped I/O related exception.  After my change, it no longer checks that and could throw a NullReferenceException.

authors: jeffkl tmat

repo: Microsoft/msbuild