甜嗑

文章 评论 浏览 27

甜嗑 2025-02-18 20:19:36

在这里尚未提及的东西,但是在尝试从另一个项目中恢复饲料时,我的痛苦是我的痛苦的根源,但是同一组织是消费项目的某些设置...(sic。

在将管道权限添加到nuget feed之后 /en-us/azure/devops/trafacts/feeds/feed-permissions?view = azure-devops#pipelines-permissions“ rel =“ noreferrer”> https://learlen.microsoft.com/en-microsoft.com/en-us/azure/devops /工件/feeds/feed-permissions?view = azure-devops#pipelines-permissions ),您需要更新限制正在恢复项目中正在恢复的项目的工作授权范围... 提要。

Something that hasn't been mentioned here, but has been the source of my pain when trying to restore from a feed in a different project but the same organization was certain settings of the consuming project... (sic. https://developercommunity.visualstudio.com/t/restore-nuget-task-unable-to-load-the-service-inde/1337219)

After adding the pipeline permissions to the NuGet feed (as per https://learn.microsoft.com/en-us/azure/devops/artifacts/feeds/feed-permissions?view=azure-devops#pipelines-permissions), you need to update the Limit job authorization scope... settings in the project which is restoring the feed.

enter image description here

Azure Devops Nuget Restore失败了,“无法为源代码加载服务索引。

甜嗑 2025-02-18 18:11:22

如果您使用的是selectpdf 社区版,则在免费版本中有5页的限制( selectpdf社区版

商业版本但是他们不是自由的。

If you are using SelectPdf community edition, there is a limitation of 5 pages in the free version (SelectPdf community edition )

There are commercial versions of SelectPdf but they are not free.

selectpdf clainthtmlString方法截断PDF

甜嗑 2025-02-18 14:25:36

在EF Core中,您不再可以执行“免费” RAW SQL。您必须为该类定义POCO类和 dbset
在您的情况下,您需要定义等级

var ranks = DbContext.Ranks
   .FromSql("SQL_SCRIPT OR STORED_PROCEDURE @p0,@p1,...etc", parameters)
   .AsNoTracking().ToList();

因为肯定会阅读,其中包括 .asnotracking()呼叫将很有用。

编辑 - EF Core 3.0中的破坏变化:

dbquery()现在已过时,而应使用(再次) dbset()。如果您有一个无钥匙实体,则不需要主键,可以使用 hasnokey()方法:

ModelBuilder.Entity<SomeModel>().HasNoKey()

可以找到更多信息在这里

In EF Core you no longer can execute "free" raw sql. You are required to define a POCO class and a DbSet for that class.
In your case you will need to define Rank:

var ranks = DbContext.Ranks
   .FromSql("SQL_SCRIPT OR STORED_PROCEDURE @p0,@p1,...etc", parameters)
   .AsNoTracking().ToList();

As it will be surely readonly it will be useful to include the .AsNoTracking() call.

EDIT - Breaking change in EF Core 3.0:

DbQuery() is now obsolete, instead DbSet() should be used (again). If you have a keyless entity, i.e. it don't require primary key, you can use HasNoKey() method:

ModelBuilder.Entity<SomeModel>().HasNoKey()

More information can be found here

RAW SQL查询无DBSET-实体框架核心

甜嗑 2025-02-18 07:29:24

我无法在创建它时使该功能工作。问题的一部分是返回语句出现的位置。即使迭代仍未完成,使用返回即使迭代仍未完成,也会将其打破并退出功能。另一个问题可能是功能中的冗余逻辑。

我决定创建一个新的词典,并将列表用作DICT的值而不是集合。我简化了该功能中的逻辑,并从语句中摆脱了,根据尝试子句,这似乎是多余的。

from collections import defaultdict

cln_parent_dict = defaultdict(list)

def update_dict(parent_dict):
    for key in parent_dict:
        for value in parent_dict[key]:
            try:
                cln_parent_dict[key].append(pub_plat_dict[value])
            except:
                cln_parent_dict[key].append(value)    
    return(cln_parent_dict) 

当我运行功能时,我会得到我期望的:

函数输出

defaultdict(<class 'list'>, {'49d238407e0102ba': ['src_platform.opportunity_history'], 'f9d53c74ec1d2ff6': ['servicer.trial_balance', 'src_platform.loan_disbursement', 'src_platform.loan'], 'fc35a98e0cfaab3d': ['zodiac', 'src_platform_mosaic_live.loan_agreement', 'src_platform.opportunity_compliance_flag', 'src_platform.loan']})

总体而言,更改似乎适用于数据集中的100K项目。

感谢所有人的看看。

I couldn't get the function to work as I created it. Part of the issue is where the return statement appears. Using a return inside of a loop will break it and exit the function even if the iteration is still not finished. Another issue might be the redundant logic in the function.

I decided to create a new dictionary and use a list as the dict's values instead of sets. I simplified the logic in the function and got rid of the if statement which seemed redundant in light of the try clause.

from collections import defaultdict

cln_parent_dict = defaultdict(list)

def update_dict(parent_dict):
    for key in parent_dict:
        for value in parent_dict[key]:
            try:
                cln_parent_dict[key].append(pub_plat_dict[value])
            except:
                cln_parent_dict[key].append(value)    
    return(cln_parent_dict) 

when I run the function I get what I expect:

Function Output

defaultdict(<class 'list'>, {'49d238407e0102ba': ['src_platform.opportunity_history'], 'f9d53c74ec1d2ff6': ['servicer.trial_balance', 'src_platform.loan_disbursement', 'src_platform.loan'], 'fc35a98e0cfaab3d': ['zodiac', 'src_platform_mosaic_live.loan_agreement', 'src_platform.opportunity_compliance_flag', 'src_platform.loan']})

Overall the change seems to work for the 100K items in the dataset.

Thanks to everyone for taking a look.

python函数通过outs的字典循环删除和添加仅更新某些项目的项目

甜嗑 2025-02-18 07:24:26

这就是我想到的,我不知道它是否符合您的老师(我认为)指南,但应该起作用。也许可以作为起点。我添加了解释。

vippassengersAssignedTobusinessseats = vippassengers / businessSeatSperflight; < / code>的问题是您可能会收回浮点数。图片有3位VIP乘客和2个商业席位-3/2返回浮标。我将使用循环来解决这个问题。

免责声明:未经测试,我以前从未使用过操作员,但我相信您可以适应。

function Passengers() {

function distributeAllSeatsToAllPassengers(num_flights, economy_seats, business_seats, passengers_vip, passengers_regular) {

    // number of flights is completely redundant in this example
    
    let passengers_vip_seated_business = 0,
        passengers_vip_seated_economy = 0,
        passengers_regular_seated_business = 0,
        passengers_regular_seated_economy = 0,
        passengers_vip_unseated = 0, // not necessary but nice to have
        passengers_economy_unseated = 0; // see above

    // use a for..of loop, assuming passengers_vip is an array
    for (let passenger of passengers_vip) {
        if (business_seats > 0) {
            business_seats--; // reduce number of available business seats
            passengers_vip_seated_business++; // increase number of seated passengers
        } else if (economy_seats > 0) {
            // if there are no business seats available, assign to economy_seats
            economy_seats--;
            passengers_vip_seated_economy++;
        } else {
            // no more seats, bummer!
            passengers_vip_unseated++;
        }
    }
    // do the same for regular passengers
    for (let passenger of passengers_regular) {
        if (business_seats > 0) {
            business_seats--; // reduce number of available business seats
            passengers_regular_seated_business++; // increase number of seated passengers
        } else if (economy_seats > 0) {
            // if there are no business seats available, assign to economy_seats
            economy_seats--;
            passengers_regular_seated_economy++;
        } else {
            // no more seats, bummer!
            passengers_economy_unseated++;
        }
    }
    
    return {
        passengers_vip_seated_business: passengers_vip_seated_business,
        passengers_vip_seated_economy: passengers_vip_seated_economy,
        passengers_regular_seated_business: passengers_regular_seated_business,
        passengers_regular_seated_economy: passengers_regular_seated_economy
    }
}

// returns the function, idk why but okay, maybe for functional programming
return {distributeAllSeatsToAllPassengers}
}

This is what i came up with, i don't know if it is according to your teacher's (i assume) guidelines, but it should work. Maybe usable as a starting point. I added explanations.

The problem with your line vipPassengersAssignedToBusinessSeats = vipPassengers / businessSeatsPerFlight; is that you might get back a float number. Picture having 3 vip passengers and 2 business seats - 3/2 returns a float. I would use loops for the issue.

Disclaimer: Not tested, and I have not used % operator before, but I am sure you can adapt.

function Passengers() {

function distributeAllSeatsToAllPassengers(num_flights, economy_seats, business_seats, passengers_vip, passengers_regular) {

    // number of flights is completely redundant in this example
    
    let passengers_vip_seated_business = 0,
        passengers_vip_seated_economy = 0,
        passengers_regular_seated_business = 0,
        passengers_regular_seated_economy = 0,
        passengers_vip_unseated = 0, // not necessary but nice to have
        passengers_economy_unseated = 0; // see above

    // use a for..of loop, assuming passengers_vip is an array
    for (let passenger of passengers_vip) {
        if (business_seats > 0) {
            business_seats--; // reduce number of available business seats
            passengers_vip_seated_business++; // increase number of seated passengers
        } else if (economy_seats > 0) {
            // if there are no business seats available, assign to economy_seats
            economy_seats--;
            passengers_vip_seated_economy++;
        } else {
            // no more seats, bummer!
            passengers_vip_unseated++;
        }
    }
    // do the same for regular passengers
    for (let passenger of passengers_regular) {
        if (business_seats > 0) {
            business_seats--; // reduce number of available business seats
            passengers_regular_seated_business++; // increase number of seated passengers
        } else if (economy_seats > 0) {
            // if there are no business seats available, assign to economy_seats
            economy_seats--;
            passengers_regular_seated_economy++;
        } else {
            // no more seats, bummer!
            passengers_economy_unseated++;
        }
    }
    
    return {
        passengers_vip_seated_business: passengers_vip_seated_business,
        passengers_vip_seated_economy: passengers_vip_seated_economy,
        passengers_regular_seated_business: passengers_regular_seated_business,
        passengers_regular_seated_economy: passengers_regular_seated_economy
    }
}

// returns the function, idk why but okay, maybe for functional programming
return {distributeAllSeatsToAllPassengers}
}

如何使用JavaScript将乘客分配到航班

甜嗑 2025-02-17 17:11:16

您在子网的NSGS [ACL]中遇到的错误问题,这些错误将流量限制在流向Azure Management网络的流量使AKS创建工作。

这些NSG与您正在尝试为AK创建AK的VNET中的子网相关联。

显然,当我们创建一个带有所有默认的新AK(资源)时
通过创建一个没有NSG的新子网,可以使用。

AZ CLI代码

az aks create --resource-group v-rXXXXXtree --name Aks-moduleTf --max-count 1 --min-count 1 --network-plugin azure --vnet-subnet-id /subscriptions/b83cXXXXXXXXXXXXX074c23f/resourceGroups/v-rXXXXXXXXXe/providers/Microsoft.Network/virtualNetworks/Vnet1/subnets/Subnet1 --node-count 1 --node-vm-size Standard_B2s --dns-service-ip 10.2.0.10 --service-cidr 10.2.0.0/24 --generate-ssh-keys --enable-cluster-autoscaler 

解决方案:如果您正在使用现有 vnet/subnet 创建Azure Resoruce。您需要禁用子网NSG的(选择无)。

​/I.SSTATIC.NET/DDRVT.PNG“ ALT =“在此处输入图像说明”>

参考:您可以检查此

The Error you are getting beacuse issue with the NSGS [acls] of subnet that are restricting the traffic flow to the Azure management network to let the AKS creation work.

These NSGs are associated with the Subnet in Vnet that you are trying to create an AKS for.

Apparently, when we created a new AKS(resource) with all the default
options by creating a new subnet with no NSGs, It worked.

Az CLI code

az aks create --resource-group v-rXXXXXtree --name Aks-moduleTf --max-count 1 --min-count 1 --network-plugin azure --vnet-subnet-id /subscriptions/b83cXXXXXXXXXXXXX074c23f/resourceGroups/v-rXXXXXXXXXe/providers/Microsoft.Network/virtualNetworks/Vnet1/subnets/Subnet1 --node-count 1 --node-vm-size Standard_B2s --dns-service-ip 10.2.0.10 --service-cidr 10.2.0.0/24 --generate-ssh-keys --enable-cluster-autoscaler 

Solution : If you are creating Azure resoruce with existing vnet/subnet. you need to disable(Select None) for the NSG of subnet.

enter image description here

enter image description here

enter image description here

Reference : You can check this link one of the user faced this issue and went to Microsoft Support team and found the issue is with NSG

AKS在Azure上创建需要很长时间才能收到以下错误消息

甜嗑 2025-02-17 16:57:03

假设您使用 .Red .blue 具有相应边框颜色的类,则应在没有红色的地方添加蓝色:

$(".test:not(.red)").addClass("blue")

Assuming your using .red and .blue classes with corresponding border color, then this should add the blue where there is no red:

$(".test:not(.red)").addClass("blue")

更改未选中的文本的颜色

甜嗑 2025-02-17 15:32:15

您需要运行信号服务器,以便同行可以找到彼此并启动WEBRTC连接。没有标准解决方案,您需要选择一个或自己编写。这可能被用作起点:
https://github.com/aljanabim/simple_webre_webre_webre_webretc_signaling_signaling_server_signaling_server_signaling_server_server_server_server_server_server_server
您可以使用任何C#WebSocket库与它进行通信。

You need to run a signaling server so your peers could find each other and initiate a webrtc connection. There is no standard solution, you would need to choose one or write your own. This one might be used as a starting point:
https://github.com/aljanabim/simple_webrtc_signaling_server
You can use any c# websocket library to communicate with it.

如何发送和接收“ rtcSessionDescription”在C#中

甜嗑 2025-02-17 08:36:22
    Click.clicks = Click.clicks - ClickerPrice;

在这里,您试图将浮点值调查到整数字段,对此没有任何隐含的转换,您需要将(int)施放在某个地方以expilitially转换值:

Clicks.clicks = Click.clicks - (int)ClickerPrice;

Click.clicks = (int)(Click.clicks - ClickerPrice);
    Click.clicks = Click.clicks - ClickerPrice;

Here you are trying to assing float value to an integer field and there is no implicit conversion for that, you need to cast (int) somewhere to convert value expilictly:

Clicks.clicks = Click.clicks - (int)ClickerPrice;

or

Click.clicks = (int)(Click.clicks - ClickerPrice);

错误CS0266:无法隐式转换类型&#x27; float&#x27;到Int&#x27;。存在明确的转换(您是否缺少演员?)

甜嗑 2025-02-17 06:46:15

在您的情况下,可能会有所帮助

run_sdk_build_pipeline:
stage: trigger
trigger:
    strategy: depend
    include: "$CI_PROJECT_DIR/.gitlab-ci/pipelines/sdk.gitlab-ci.yml"
except:
    changes:
        - sdk/**/*  

In your case, only:changes / except:changes examples may help

run_sdk_build_pipeline:
stage: trigger
trigger:
    strategy: depend
    include: "$CI_PROJECT_DIR/.gitlab-ci/pipelines/sdk.gitlab-ci.yml"
except:
    changes:
        - sdk/**/*  

如何在.gitlab-ci.yml中添加逻辑否定规则

甜嗑 2025-02-17 00:01:12

尝试设置 wrap_content 通过 layoutparams ,如下所示。

    val startSleepTextView = TextView(context)
    //startSleepTextView.width = LayoutParams.WRAP_CONTENT
    //startSleepTextView.height = LayoutParams.WRAP_CONTENT
    startSleepTextView.layoutParams = LinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT)

Try setting WRAP_CONTENT via layoutParams as follows.

    val startSleepTextView = TextView(context)
    //startSleepTextView.width = LayoutParams.WRAP_CONTENT
    //startSleepTextView.height = LayoutParams.WRAP_CONTENT
    startSleepTextView.layoutParams = LinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT)

ViewGroup.AddView()正在工作,但儿童视图未显示

甜嗑 2025-02-16 15:50:59

名称是Terraform workspace 代码>默认值)。

当您在多个环境中使用相同的代码时,使用工作区将部署分开。

例如,如果您要使用配置的后端执行 Terraform Init ,它将使用 default workspace并创建 default.tfstate 水桶。

如果您要进行 Terraform Workspace新产品> 并执行 Terraform Init 您将针对 prod.tfstate 的状态文件工作。

您不必使用工作区,因为它们可以为管道增加复杂性。您可以很容易地拥有不同的后端或将状态文件放在不同的前缀下;您可以将GCS后端的前缀视为放置状态文件的目录结构。

例如 prefix = terraform/myproject/nonprod 将在非生产目录下保留 default.tfstate ,因此它与其他环境分开。什么对你有用。

前缀 - (可选)GCS前缀在存储桶内。命名工作区的状态存储在一个名为/.tfstate的对象中。< /p>

source

The name is the name of the Terraform workspace that you're working in (hence default).

You use workspaces to separate your deployments when you're using the same code for multiple environments.

For example, if you were to perform a terraform init with a backend configured, it would use the default workspace and create a default.tfstate within the bucket.

If you were to do a terraform workspace new prod and performed a terraform init you would be working against a state file of prod.tfstate.

You don't have to use workspaces though as they can add complexity to the pipeline. You could just as easily have a different backend or place the state file under a different prefix; you can think of prefix in regards to GCS backends as a directory structure to place the state file.

e.g. prefix=terraform/myproject/nonprod would keep a default.tfstate under a nonprod directory so it's separate from the other environments. Whatever works for you.

prefix - (Optional) GCS prefix inside the bucket. Named states for workspaces are stored in an object called /.tfstate.

source

如何在Terraform后端指定状态文件名?

甜嗑 2025-02-16 09:25:04

在PL/SQL进程上设置“当按钮”的服务器侧条件。这应确保仅在单击按钮时运行。但是,在提交页面后,成功消息将成为URL的一部分。因此,当您随后重新加载页面时,将再次显示成功消息。
发生的是以下

  1. 渲染页(第一次)
  2. 单击按钮以在处理点“过程”中提交页面
  3. 运行PL/SQL。在这一点上,成功消息将
  4. 重定向页面(同一页码 - 只是一个重新加载)。由于这是一个重定向,因此页面需求在实际URL中的所有信息。其中包括(3)中生成的成功消息。

因此,(4)之后,页面的URL是在URL本身中具有成功消息的页面URL。如果页面刷新,则该消息将再次显示。但是该过程不会重新运行(因为页面未重新提交)

Set a server side condition of "When Button Pressed" on the pl/sql process. That should ensure it only runs when the button is clicked. However, the success message will be part of the url when after the page is submitted. So when you reload the page afterwards, the success message will be shown again.
What happens is the following

  1. Render Page (first time)
  2. Click Button to submit page
  3. Run pl/sql in processing point "process". At this point the success message is set
  4. Redirect the page (to same page number - it's just a reload). Since this is a redirect, all the information the page needs is in the actual url. That includes the success message generated in (3).

So... after (4) the url of the page is the page url that has the success message in the url itself. If the page is refreshed, then the message will be shown again. But the process will not re-run (since page is not re-submitted)

如果页面刷新,请避免运行该过程

甜嗑 2025-02-16 02:39:52

可以使用图形的坐标系统灵活地指定字符串作为注释。类型包括数据,轴和图形区域。有关更多详细信息

plt.text(x=0, 
         y=60, # changes to this parameter has no effect
         s='Джерело: openbudget.gov.ua', ha='left', fontsize=9, alpha=0.7,)

如果坐标是在轴上指定的:

plt.text(x=0, y=-0.1, transform=ax.transAxes, s='Джерело: openbudget.gov.ua', ha='left', fontsize=9, alpha=0.7,)

Adding a string as an annotation can be specified flexibly by using the coordinate system of the graph. Types include data, axis, and graph area. See here for more details.

plt.text(x=0, 
         y=60, # changes to this parameter has no effect
         s='Джерело: openbudget.gov.ua', ha='left', fontsize=9, alpha=0.7,)

If the coordinates are specified in axes:.

plt.text(x=0, y=-0.1, transform=ax.transAxes, s='Джерело: openbudget.gov.ua', ha='left', fontsize=9, alpha=0.7,)

enter image description here

plt.text位置的y值的变化不影响文本位置

甜嗑 2025-02-16 00:19:12

我最近有同样的问题。我发现解决此问题的唯一方法是将包含的用户式更改为

#import "ORSSerialPacketDescriptor.h"

当然,这打破了Objective-C客户端的标题。但是由于Swift使用模块地图,因此您仍然可以从Swift代码中使用它。

I had the same issue recently. The only way I found to work around this was to change the includes to standard user-style includes

#import "ORSSerialPacketDescriptor.h"

Of course, this breaks the header for Objective-C clients. But since Swift uses the module map, you can still use it from Swift code.

当公共标头使用Angle括号(&lt;&gt;)#imports时

更多

推荐作者

櫻之舞

文章 0 评论 0

弥枳

文章 0 评论 0

m2429

文章 0 评论 0

野却迷人

文章 0 评论 0

我怀念的。

文章 0 评论 0

更多

友情链接

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文