Monday-Friday, 9:00-17:00 +19056243686
header-image

Tab Tu

YOLO

You Only Live Once

feature image

The Elder Scrolls Online

https://vstab.com/build/#f3,r12,c16,144:1,145:3,146:3,147:3,169:1,171:3,172:2,173:2,174:2,175:2,179:3,180:2,181:2,299:1,304:3,365:1,376:1,378:2,379:2,380:2,381:2,382:2,445:1,454:1,457:1,458:2,459:2,460:2,461:2,462:2,630:1,636:1,645:1,647:2,649:2,650:2,656:1,658:1,669:2,670:2,671:2,672:2,686:1,692:2,693:2,716:1,745:1;658:636:299:457:645:630;376:365:656:686:169:745;30;0,0,64;0,0,0;12:4,15:30,16:48,18:43,19:40,20:43,31:32,36:66,45:64,53:11,56:72,57:27,61:15,67:72,75:30,76:75,80:48,;240,240,240;6,1;

Flanking StrategistGold Coast, overland2 items: Adds 25-1096 Maximum Stamina
3 items: Adds 19-833 Weapon Critical
4 items: Adds 3-129 Weapon Damage
5 items: Adds 34-400 Weapon Damage to your damaging abilities when you attack an enemy from behind or their sides.
Strength of the AutomatonDarkshade Caverns, dungeon2 items: Adds 19-833 Weapon Critical
3 items: Adds 25-1096 Maximum Stamina
4 items: Adds 3-129 Weapon Damage
5 items: Adds 9-400 Weapon Damage to your Physical Damage abilities.
Shield BreakerImperial City2 items: Adds 25-1096 Maximum Stamina
3 items: Adds 3-129 Stamina Recovery
4 items: Adds 3-129 Weapon Damage
5 items: Increases your damage done by 6%. This effect is doubled when attacking targets with a damage shield active.
Spriggan’s ThornsBangkorai, overland2 items: Adds 25-1096 Maximum Stamina
3 items: Adds 25-1096 Maximum Stamina
4 items: Adds 3-129 Weapon Damage
5 items: Adds 80-3460 Physical Penetration

ref:

https://en.uesp.net/wiki/Online:Flanking_Strategist
https://en.uesp.net/wiki/Online:Strength_of_the_Automaton
https://en.uesp.net/wiki/Online:Shield_Breaker
https://en.uesp.net/wiki/Online:Spriggan%27s_Thorns
feature image

CORE3.1 add CORS support

Setting up CORS

To setup CORS for your application you use the Microsoft.AspNetCore.Cors package. In your project.json file, add the following:

  "dependencies": {
    "Microsoft.AspNet.Cors": "6.0.0-rc1-final",
  },

Add the CORS services in Startup.cs:

public void ConfigureServices(IServiceCollection services)
{
    services.AddCors();
}

Enabling CORS with middleware

To enable CORS for your entire application add the CORS middleware to your request pipeline using the UseCors extension method. Note that the CORS middleware must precede any defined endpoints in your app that you want to support cross-origin requests (ex. before any call to UseMvc).

You can specify a cross-origin policy when adding the CORS middleware using the CorsPolicyBuilder class. There are two ways to do this. The first is to call UseCors with a lambda:

public void Configure(IApplicationBuilder app)
{
    app.UseCors(builder =>
        builder.WithOrigins("http://example.com"));
}

The lambda takes a CorsPolicyBuilder object. I’ll describe all of the configuration options later in this topic. In this example, the policy allows cross-origin requests from “http://example.com” and no other origins.

Note that CorsPolicyBuilder has a fluent API, so you can chain method calls:

app.UseCors(builder =>
    builder.WithOrigins("http://example.com")
           .AllowAnyHeader()
    );

The second approach is to define one or more named CORS policies, and then select the policy by name at run time.

public void ConfigureServices(IServiceCollection services)
{
    services.AddCors(options =>
    {
        options.AddPolicy("AllowSpecificOrigin",
            builder => builder.WithOrigins("http://example.com"));
    });
}

public void Configure(IApplicationBuilder app)
{
    app.UseCors("AllowSpecificOrigin");
    app.Run(async (context) =>
    {
        await context.Response.WriteAsync("Hello World!");
    });
}

PS: app.UseCors() should be set between Routing and Endpoints

configure your application startup by adding app.UseCors() inside the call to Configure(..) in the application startup code. The call to app.UseAuthorization() must appear between app.UseRouting() and app.UseEndpoints(…).

https://jakeydocs.readthedocs.io/en/latest/security/cors.html#setting-up-cors

feature image

Init react, react-bootstrap, react-router-dom

Setting up a React Environment

If you have NPM and Node.js installed, you can create a React application by first installing the create-react-app.

If you’ve already created the create-react-app you can skip this section.

Install create-react-app by running this command in your

npm install -g create-react-app

Then you are able to create a React application, let’s create one called myfirstreact.

Run this command to create a React application named myfirstreact

npx create-react-app myfirstreact

The create-react-app will set up everything you need to run a React application.

Setting up react-bootstrap, react-router-dom into Environment

we need to install some libs into environment

npm install --save react-bootstrap
npm install --save react-router-dom
npm install --save styled-components

PS: Comparing bootstrap vs. react-bootstrap vs. reactstrap

https://npmcompare.com/compare/bootstrap,react-bootstrap,reactstrap

feature image

AspCore.Swagger is too slow

Are you using NewtonSoft? You need to add:

Install-Package Swashbuckle.AspNetCore.Newtonsoft -Version 5.1.0

And add:

services.AddSwaggerGenNewtonsoftSupport();
// explicit opt-in - needs to be placed after AddSwaggerGen()
feature image

Stain & Finish

In a wood working, we need to understand Stain and Finish.

Stain, give the wood a nice surface looking oil stain. It will change wood colour, do not have enough protection with the lumber or board. We usually use stain to give the wood a rice and great colour on surface. Beside, we can use different colour in opposite sides with designing.

Finish, build a protection level on the surface. We have many different choices in this kind, such as, Polyurethane, Oil-Based, Water-Based, Lacquer, Varnish and Shellac. Choose the right finish on different project. https://www.tabtu.top/?p=897

feature image

Types of Wood Finish

Polyurethane(聚氨酯)

Highly durable, water-resistant. Provides a natural appearance; available in satin, semi-gloss and glossy sheens. Ideal for kitchen cabinets, doors, furniture and floors. Not recommended for outdoor use; may yellow or crack when exposed to sunlight unless UV light absorbers are added. Can be difficult to repair if damaged.

Polyurethane wood finishes are synthetic coatings that prove highly durable and water resistant, making them the best clear coat for wood protection. 

  • They provide a natural appearance with a variety of satin, semi-gloss and glossy sheens and are ideal for kitchen cabinets, doors, furniture and floors, but not recommended for outdoor use. 
  • They may yellow or crack in sunlight unless formulated to be UV-resistant.

Oil-Based

Dries slowly. Provides a rich, satin finish. Ideal for furniture and low-traffic areas; shows water or alcohol spills. Easy to apply with a brush or cloth.

Oil-based finish dries more slowly and has a stronger aroma than water-based finish. 

  • It is ideal for furniture and low-traffic areas but shows water or alcohol spills. 
  • It is easy to apply with a brush or cloth. 

Water-Based

Dries quickly. Can be used on bare, stained or painted wood; does not yellow with age. Ideal for protecting decorative finishes; not as durable as other finishes. Use synthetic brushes to apply, as brush marks may show up on surface.

Water-based finish dries quickly and can be used on bare, stained or painted wood. 

  • It provides a clear, natural sheen that does not yellow with age. 
  • Ideal for protecting decorative finishes, it is not as durable as other finishes. 
  • Synthetic brushes are recommended for application. 

Lacquer(漆)

Dries faster than other finishes; usually sprayed on. Can be easily removed. Ideal for furniture. Works well when multiple layers are applied, but do not use over old paint or varnish. Gives off noxious fumes when applied; can be a fire hazard.

Lacquer is a wood finish typically made with a solution of nitrocellulose and solvents to make a glossy or matte coating.

  • Frequently sprayed on, it leaves a thin coat that dries faster than other finishes.
  • It can give off strong fumes when applied, so apply in a well-ventilated area and take necessary precautions.
  • It is ideal for furniture but is not recommended for use over old paint or varnish.
  • Lacquer is more durable than shellac. It is considered one of the best wood sealants.

Varnish(清漆)

Very durable. Can be used on bare or stained wood. Ideal for use on doors and marine finishes. Must be applied to a dust-free surface with a clean brush. Use paint thinner for thinning and cleaning.

Varnish wood finishes tend to consist of a resin, a drying oil and a solvent or thinner. 

  • Varnishes are usually clear, highly durable and offer UV protection, making them suitable for doors and marine finishes, whether on bare or stained wood. 
  • They are less expensive than polyurethane and are slow to dry, making them susceptible to dust and dirt. 
  • They are also considered among the best wood sealants.

Shellac

Provides a hard finish that dries quickly; may break down over time. May be used as a sealer and stain killer on drywall, cured plaster and new wood. Ideal for furniture and floors. Not recommended for wood that will be exposed to moisture. Use denatured alcohol to thin and clean.

Shellac wood finish is made from a protective waxy resin secreted by the lac insect. 

  • It is mixed with a solvent, such as alcohol, that makes it easy to apply as it dries quickly, but it may need to be thinned before applying. 
  • It provides a hard finish suitable for floors, antiques and fine furniture. 
  • It is not recommended for wood that will be exposed to moisture or alcohol spills, as it may dissolve or break down over time. 
feature image

IIS forward request(转发请求)

最近部门要开发一个简单的APP,部分数据是现有项目已经存在的,为了方便维护,希望只提供一个交互的入口,并且协议的规则不变。

基于这个需求,有两套解决方案:

1.用代码将现有的api封装一层,对请求数据和返回数据不做任何改变,只是中转,然后和新的数据接口一起部署在一个项目里;

2.用IIS进行请求转发,调用现有接口回应请求,剩余部分开发新的api,部署在一个项目里,用URL Rewrite进行过滤分发。

第一个方案很传统,没什么好评价的,这里主要讲一下第二种方案的实现,第二个方案的好处是可以节省时间成本,需要依赖IIS插件(Application Request Routing + URL Rewrite)。

先下载ARR 和 URL Rewrite 进行安装,使用过程中发现ARR对IIS的“目录浏览”功能有依赖(未验证,如果无法使用,可以查看一下是否安装了“目录浏览”功能):

http://www.iis.net/downloads/microsoft/application-request-routing#additionalDownloads
http://www.iis.net/downloads/microsoft/url-rewrite#additionalDownloads

安装好插件,重新打开IIS

双击IIS根目录

双击Application Request Routing Cache

双击右边的 Server Proxy Settings

勾上 Enable proxy

取消勾选“Reverse rewrite host in response headers”,否则所有的响应内容的host都会被重写为当前站点域名,简单来讲,最直接的影响就是对外部站点的重定向都会失败,所以这里取消勾选。

点击“应用”后,新建一个站点,用来接受请求做转发

双击站点,双击 URL Rewrite -> Add Rules(新建规则) -> Blank rule(空白规则) 

Name:填写你的规则名称

Match URL 是匹配Requested URL的规则

http://www.test.com?name=michael&age=30

host: www.test.com

requested url: ?name=michael&age=30

query string: name=michael&age=30

Requested URL 选择 Matches the Pattern (匹配符合规则的url)

Using 选择 Regular Expressions (使用正则表达式来匹配)

Pattern 里填写 ^(.*) 这里不对正则表达式做讲解,有需要的可以自己了解。

勾选 Ignore case 忽略大小写

展开 Conditions 条件筛选

Logical grouping 选择 Match Any

Match All 是列表中所有规则都要匹配才符合(与)

Match Any 是列表中有一个规则匹配就算符合(或)

track capture group across conditions 跟踪捕获组,这个功能跟正则有关,这里不需要不勾选,可以查询关键词 capture group  自行了解详情

点击 Add 添加条件 

Condition input 填写  {HTTP_HOST}  ,HTTP_HOST 代表请求头里的host,就是上面例子里的 www.test.com 部分, 更多可过滤条件查询 Server Variables  自行了解

Check if input string 选择 Matches the Pattern 

Pattern 填写 ^arrtest.com$  ,这里的意思是如果host是 arrtest.com 则匹配通过,例:http://arrtest.com?asdf=1234

如果这里填写的是 ^www.arrtest.com$  ,则匹配 http://www.arrtest.com?asdf=1234

勾选 Ignore case 忽略大小写

双击展开 Action 部分

Action type 选择 Rewrite 重写转发

Rewrite URL 里填写 https://cn.bing.com/{R:1} 转发目标地址, {R:1} 代表 Match URL 部分匹配到的 Request URL 

勾选 Append query string 追加查询字符串 

到此配置结束,保存这个规则,在浏览器访问 http://arrtest.com/search?q=测试 就等同于访问 https://cn.bing.com/search?q=测试  

为了防止该站点下的其他接口被这个规则无脑转发,我们需要新增一个转发条件

现有的需要转发的 API 格式如下 http://arrtest.com?PROTOID=123456 

其他接口是没有 PROTOID 这个关键词的,并且 PROTOID 后面的value都是数字,那么这里就用这个关键词来过滤需要转发的请求

再回到刚刚的 Conditions 部分,点 Add 新增条件

Condition input 填写 {QUERY_STRING} 

Check if input string 选择 Matches the Pattern

Pattern 填写 PROTOID=\d+ 这个规则的意思是,匹配查询字符串为 PROTOID 开头参数值为数字的请求(例:http://arrtest.com/?PROTOID=456789)

勾选 Ignore case 忽略大小写

确定保存,修改 匹配逻辑为 Match All (与),列表内所有的规则都匹配,请求才会通过

现在只有 QueryString 为 PROTOID 开头参数值为数字的请求才会被转发了

例子:http://arrtest.com/search?PROTOID=4564&q=测试   =>   http://cn.bing.com/search?PROTOID=4564&q=测试

http://arrtest.com/search?q=测试&PROTOID=4564  则不会被转发 

至此请求转发的功能就实现了,除此之外,强大的 ARR + URL Rewrite 还可以实现高可用负载均衡。

https://www.cnblogs.com/mahatmasmile/p/5725253.html

feature image

CORE return HttpResponseMessage

在.net framework下我们编写webapi时返回一般会用到HttpResponseMessage类型,如果返回值什么内容调用此api就能返回什么值了。但是在.net core下我们用HttpResponseMessage来当做返回值得话得到的结果可能就不是你想要的了,可能会出现一堆看起来没什么用的json返回值,如下所示就是我调用后的返回值

{
"version": {
"major": 1,
"minor": 1,
"build": -1,
"revision": -1,
"majorRevision": -1,
"minorRevision": -1
},
"content": {
"headers": [
{
"key": "Content-Type",
"value": [
"text/plain; charset=utf-8"
]
}
]
},
"statusCode": 200,
"reasonPhrase": "OK",
"headers": [],
"requestMessage": null,
"isSuccessStatusCode": true
}


其实我们可以安装.net core的webapi兼容包来实现的,通过nuget安装

Microsoft.AspNetCore.Mvc.WebApiCompatShim

然后在Startup中的ConfigureServices方法里在AddMvc()后增加AddWebApiConventions()就行了

public void ConfigureServices(IServiceCollection services)
{
    services.AddMvc().AddWebApiConventions();
}


这时你再重新调用下webapi返回的值就是你程序里的返回值了。

附上.net core的相关组件清单,以便有用时查询

相关组件
ASP.NET Core MVC 包含了下列组件,基于 .NET Core 的精神,只有需要用到的才需要加入参考 (于 project.json),因此开发者可以自由选择,而不必把所有的组件都加进来。

  • Microsoft.AspNetCore.Mvc ASP.NET Core MVC 引用套件
  • Microsoft.AspNetCore.Mvc.Abstractions ASP.NET Core MVC 功能的抽象层
  • Microsoft.AspNetCore.Mvc.ApiExplorer ASP.NET Core MVC 的 API 文件支持
  • Microsoft.AspNetCore.Mvc.Core ASP.NET Core MVC 核心组件
  • Microsoft.AspNetCore.Mvc.Cors 提供 Web API 所需要的 CORS 能力
  • Microsoft.AspNetCore.Mvc.DataAnnotations MVC 所需的数据注解 (Data Annotation) 功能
  • Microsoft.AspNetCore.Mvc.Formatters.Json MVC/Web API 所需的 JSON 序列化器
  • Microsoft.AspNetCore.Mvc.Formatters.Xml MVC/Web API 所需的 XML 序列化器
  • Microsoft.AspNetCore.Mvc.Localization MVC 应用程序本地化支持
  • Microsoft.AspNetCore.Mvc.Razor MVC Razor 的核心类库 (若要在 MVC 中使用 Razor 就必须参考此组件)
  • Microsoft.AspNetCore.Mvc.Razor.Host MVC Razor 的运行时引擎
  • Microsoft.AspNetCore.Mvc.TagHelpers MVC Tag Helper 的核心类库
  • Microsoft.AspNetCore.Mvc.ViewFeatures MVC View 功能的类库 (Controller 类的操作在此)
  • Microsoft.AspNetCore.Mvc.WebApiCompatShim Web API 兼容套件
  • Microsoft.AspNetCore.Razor Razor 的核心类库

————————————————

原文链接:https://blog.csdn.net/sammy520/java/article/details/104581376

feature image

core MVC 默认大小写不敏感

对于.Net Core 3.1及以上版本, 默认使用json序列化/反序列化时对大小写不敏感. 设置大小写敏感, 在Startup.cs中添加:

            services.AddControllersWithViews().AddNewtonsoftJson(opt =>
            {
                // lazy mode json Serializer
                opt.SerializerSettings.ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore;
                // donot up case the first letter
                opt.SerializerSettings.ContractResolver = new Newtonsoft.Json.Serialization.DefaultContractResolver();
            });

一些简单配置如下.

public void ConfigureServices(IServiceCollection services)
{
     services.AddJsonOptions(options =>
            {
                //格式化日期时间格式
                options.JsonSerializerOptions.Converters.Add(new DatetimeJsonConverter());
                //数据格式首字母小写
                //options.JsonSerializerOptions.PropertyNamingPolicy =JsonNamingPolicy.CamelCase;
                //数据格式原样输出
                options.JsonSerializerOptions.PropertyNamingPolicy = null;
                //取消Unicode编码
                options.JsonSerializerOptions.Encoder = JavaScriptEncoder.Create(UnicodeRanges.All);
                //忽略空值
                options.JsonSerializerOptions.IgnoreNullValues = true;
                //允许额外符号
                options.JsonSerializerOptions.AllowTrailingCommas = true;
                //反序列化过程中属性名称是否使用不区分大小写的比较
                options.JsonSerializerOptions.PropertyNameCaseInsensitive = false;
            });
}