vr 陀螺仪加速计_可以肯定,它可以加速3D VR,但是用一个不错的ASCII进度条或微调框会让我印象深刻

vr 陀螺仪加速计

vr 陀螺仪加速计

I'm glad you have a 1080p 60fps accelerated graphics setup, but I'm old school. Impress me with a really nice polished ASCII progress bar or spinner!

很高兴您有一个1080p 60fps加速图形设置,但是我很老。 出色的抛光ASCII进度条或微调框给我留下深刻的印象!

I received two tips this week about cool .NET Core ready progress bars so I thought I'd try them out.

本周,我收到了两个有关.NET Core就绪状态栏的技巧,因此我想尝试一下。

ShellProgressBar,作者:Martijn Laarman (ShellProgressBar by Martijn Laarman)

This one is super cool. It even supports child progress bars for async stuff happening in parallel! It's very easy to use. I was able to get a nice looking progress bar going in minutes.

这一款超酷。 它甚至还支持子进度条,用于并行发生的异步事件! 它很容易使用。 我能够在几分钟之内得到一个漂亮的进度条。

static void Main(string[] args)
{
const int totalTicks = 100;
var options = new ProgressBarOptions
{
ForegroundColor = ConsoleColor.Yellow,
ForegroundColorDone = ConsoleColor.DarkGreen,
BackgroundColor = ConsoleColor.DarkGray,
BackgroundCharacter = '\u2593'
};
using (var pbar = new ProgressBar(totalTicks, "Initial message", options))
{
pbar.Tick(); //will advance pbar to 1 out of 10.
//we can also advance and update the progressbar text
pbar.Tick("Step 2 of 10");
TickToCompletion(pbar, totalTicks, sleep: 50);
}
}

Boom.

繁荣。

Cool ASCII Progress Bars in .NET Core

Be sure to check out the examples for ShellProgressBar, specifically ExampleBase.cs where he has some helper stuff like TickToCompletion() that isn't initially obvious.

一定要检查一下ShellProgressBar的示例,特别是ExampleBase.cs ,其中他有一些辅助工具,例如TickToCompletion(),这些辅助工具起初并不明显。

Kurukuru由泽渡真月 (Kurukuru by Mayuki Sawatari)

Another nice progress system that is in active development for .NET Core (like super active...I can see they updated code an hour ago!) is called Kurukuru. This code is less about progress bars and more about spinners. It's smart about Unicode vs. non-Unicode as there's a lot of cool characters you could use in a Unicode-aware console that make for attractive spinners.

正在积极开发.NET Core的另一个不错的进度系统(如super active ...我可以看到他们在一小时前更新了代码!)称为Kurukuru。 这段代码较少涉及进度条,而更多涉及微调器。 关于Unicode与非Unicode比较聪明,因为您可以在支持Unicode的控制台中使用许多很酷的字符,这些字符可以吸引有吸引力的微调。

What a lovely ASCII Spinner in .NET Core!

Kurukuru is also super easy to use and integrated into your code. It also uses the "using" disposable pattern in a clever way. Wrap your work and if you throw an exception, it will show a failed spinner.

Kurukuru也非常易于使用,并已集成到您的代码中。 它还以一种巧妙的方式使用“使用”的一次性模式。 包装您的工作,如果抛出异常,它将显示失败的微调器。

Spinner.Start("Processing...", () =>
{
Thread.Sleep(1000 * 3);

// MEMO: If you want to show as failed, throw a exception here.
// throw new Exception("Something went wrong!");
});

Spinner.Start("Stage 1...", spinner =>
{
Thread.Sleep(1000 * 3);
spinner.Text = "Stage 2...";
Thread.Sleep(1000 * 3);
spinner.Fail("Something went wrong!");
});

TIP: If your .NET Core console app wants to use an async Main (like I did) and call Kurukuru's async methods, you'll want to indicate you want to use the latest C# 7.1 features by adding this to your project's *.csproj file:

提示:如果您的.NET Core控制台应用程序想要使用异步Main(如我一样)并调用Kurukuru的异步方法,则需要通过将其添加到项目的* .csproj中来指示您要使用最新的C#7.1功能。文件:

<PropertyGroup>
    <LangVersion>latest</LangVersion>
</PropertyGroup>

This allowed me to do this:

这使我可以这样做:

public static async Task Main(string[] args)
{
Console.WriteLine("Hello World!");
await Spinner.StartAsync("Stage 1...", async spinner =>
{
await Task.Delay(1000 * 3);
spinner.Text = "Stage 2...";
await Task.Delay(1000 * 3);
spinner.Fail("Something went wrong!");
});
}

Did I miss some? I'm sure I did. What nice ASCII progress bars and spinners make YOU happy?

我想念一些吗? 我确定我做到了。 哪些不错的ASCII进度条和微调框使您感到高兴?

And again, as with all Open Source, I encourage you to HELP OUT! I know the authors would appreciate it.

再次,与所有开放源代码一样,我鼓励您帮助! 我知道作者会很感激。

Sponsor: Check out JetBrains Rider: a new cross-platform .NET IDE. Edit, refactor, test and debug ASP.NET, .NET Framework, .NET Core, Xamarin or Unity applications. Learn more and download a 30-day trial!

赞助商:查看JetBrains Rider:一个新的跨平台.NET IDE 。 编辑,重构,测试和调试ASP.NET,.NET Framework,.NET Core,Xamarin或Unity应用程序。 了解更多信息并下载30天试用版

翻译自: https://www.hanselman.com/blog/accelerated-3d-vr-sure-but-impress-me-with-a-nice-ascii-progress-bar-or-spinner

vr 陀螺仪加速计

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值