你如我软肋

文章 评论 浏览 30

你如我软肋 2025-02-20 23:40:20

您是否在库的根索引中正确导出了LIB的代码?
如果不是,则在库的索引上,只需像这样导出您的代码:

export { Something } from 'your/path'

或者如果您已经在库中导出,则可以使用通配符 *。

之后,删除行
@backend/kernel/“:[“ libs/kernel/src/”]
来自您的tsconfig.base.json
干杯

Have you export the code correctly from your lib in the root index of your library ?
If not, at the index.ts at the root of your library, just export your code like this :

export { Something } from 'your/path'

or if you already export inside your library you can use a wildcard *.

After that, remove the line
@backend/kernel/": ["libs/kernel/src/"]
from your tsconfig.base.json
Cheers

NX框架-TS2307从非根进口时编译期间

你如我软肋 2025-02-20 17:41:54

为什么要全球?如果您担心,因为您想在某些原因下将变量的值保持在函数呼叫时的全局值,则将它们在函数签名中的混音可以解决速度降低问题:

function tryit(PRISONERS = PRISONERS, ATTEMPTS = ATTEMPTS, DEBUG = DEBUG)
   ...

Why globals? If you are concerned because you want to keep the variables' values global at function call for some reason, aliasing them in your function signature can fix the slowdown problem:

function tryit(PRISONERS = PRISONERS, ATTEMPTS = ATTEMPTS, DEBUG = DEBUG)
   ...

朱莉娅的全局变量使代码变慢较慢

你如我软肋 2025-02-20 14:55:14

您的后端没有邮政方法的路线

you don't have a route for post method in your backend

处理HTTP请求

你如我软肋 2025-02-20 12:55:07

没有确切的估计。
您可以将所有实例旋转,假设它们全部60次运行不同的代码,对其进行压力测试,并监视CPU + MEM,然后加倍,以使它们有呼吸的空间。这也可能证明是不够的,取决于不同 在每个吊舱的代码上。

因此 优化豆荚,以便使用更少的资源,更好的代码等...

There is no exact estimate.
You can spin up all your instances, assuming they all 60 run different code, stress-test them, and monitor the CPU + Mem, then double that just so they have room to breathe.. which might also prove to not be enough, depending on your code for each pod..

So, test, adjust, test again, adjust again (with some buffer in mind, so pods do not die due to resource exhaustion), repeat, repeat again, and again :)

If you can, optimize the pods so they use less resources, better code, etc...

估计Kubernetes资源用于微服务

你如我软肋 2025-02-20 00:04:50

如果服务器返回错误,则GetAsync将引发异常,因为它不是RESTCLIENT接口的一部分,并且返回 task< int> 即无法设置和响应状态代码。

如果服务器返回错误,则

executeGetAsync将不会引发异常,因为它的返回类型是restresponse,并且它具有响应率属性来设置错误。

有关更多信息:
<

GetAsync will throw an exception if the server returns an error because it is not part of RestClient interface and return Task<int> i.e. there is no way to set and response status code.

while

ExecuteGetAsync will not throw an exception if the server return an error because it's return type is RestResponse and it has ResponseStatus property to set an error.

For more information:
https://restsharp.dev/error-handling.html

RESTSHARP中的“ getAsync”和“ executeGetAsync”有什么区别?

你如我软肋 2025-02-19 21:15:17
  1. 移动这些文件
  • detectoverflow.d.ts
  • detectoverflow.js
  • detectoverflow.js.flow

来自 node_modules@popperjs \ core \ core \ core \ lib \ lib \ lib \ lib \ lib \ utils <代码> node_modules@popperjs \ core \ lib \ lib

  1. 重新启动服务器
    NPM Start
  1. Move these file
  • detectOverflow.d.ts
  • detectOverflow.js
  • detectOverflow.js.flow

From node_modules@popperjs\core\lib\utils to node_modules@popperjs\core\lib

  1. Restart the server
    npm start

谁能帮助我解决此错误,我安装了Angular材料后出现此错误?

你如我软肋 2025-02-19 15:57:35

我正在使用Angular 14,实际上这个问题来自Angular。源的角度外观资产/文件夹。
我解决了这样的问题。我将Res文件夹移至资产文件夹。我的工作代码:

<img class="handimg" src="../../assets/res/hand.png" alt="hand" />

I'm using Angular 14 and actually this problem coming from Angular. Angular looking assets/ folder for source.
I solved this problem like this; I moved my res folder to assets folder. My working code:

<img class="handimg" src="../../assets/res/hand.png" alt="hand" />

IMG标签不起作用,而是背景图像工作

你如我软肋 2025-02-19 08:47:03

查询参数最初是空的,或者不首先加载值,因为在应用实际路由之前,组件会加载。

解决方案1 ​​

等待导航使用事件属性导航

constructor(private route: ActivatedRoute, private router:Router) { }
ngOnInit(): void {  
    this.router.events.subscribe(
      (event: RouterEvent) => {
        if (event instanceof NavigationEnd) {
          this.route.queryParamMap.subscribe(params => { //You may also use simply route.params as well instead of queryParamMap
                    let myparam = params.get('param');
          });
      }
   })
}

解决方案2

另一种方法可能是延迟,例如订阅。尝试避免这种方法,除非并且直到您对pageload有某种延迟为止。

ngOnInit(): void {
    setTimeout(() => {
      this.route.queryParamMap.subscribe(params => { 
                    let myparam = params.get('param');
          });
    }, 10);   // A delay of 10ms is provided here
}

希望它有帮助!

The query parameters are initially empty or does not load the values first because the components loads before the actual routing is applied.

Solution 1

Wait for the navigation to end using event property NavigationEnd

constructor(private route: ActivatedRoute, private router:Router) { }
ngOnInit(): void {  
    this.router.events.subscribe(
      (event: RouterEvent) => {
        if (event instanceof NavigationEnd) {
          this.route.queryParamMap.subscribe(params => { //You may also use simply route.params as well instead of queryParamMap
                    let myparam = params.get('param');
          });
      }
   })
}

Solution 2

Another approach could be adding a delay,say .10s to the subscription. Try avoiding this approach unless and until you have a pre requirement of some kind of delay on pageload.

ngOnInit(): void {
    setTimeout(() => {
      this.route.queryParamMap.subscribe(params => { 
                    let myparam = params.get('param');
          });
    }, 10);   // A delay of 10ms is provided here
}

Hope it helps!

无法检索Queryparams Angular 14

你如我软肋 2025-02-19 06:47:35

这就是事件的工作方式:唯一允许举办活动的课程是定义该事件的类。

将事件重命名以删除“ On”前缀,然后添加一个专门的方法来提高它 - 通常可以理解“ On”前缀以确定一种提高事件的方法(或者根据您的命名约定,可以处理事件的方法 - 但是事件本身不应具有任何前缀方案):

protected void OnAnimationStateChanged(string state)
{
    AnimationStateChanged?.Invoke(state);
}

然后,继承的类可以访问并调用此方法以提高事件。

That's how events work: the only class that's allowed to raise an event, is the class that defines that event.

Rename the event to drop the "On" prefix, then add a dedicated method to raise it - the "On" prefix is usually understood to identify a method that raises an event (or one that handles an event, depending on your naming convention - but the event itself shouldn't have any prefixing scheme):

protected void OnAnimationStateChanged(string state)
{
    AnimationStateChanged?.Invoke(state);
}

Inherited classes can then access and invoke this method to get the event raised.

不可能使用父班的事件吗?

你如我软肋 2025-02-19 02:22:24

您可以做到这一点的一种方法是使用额外的日志表和一个应用程序脚本。

这是我在您的工作表的副本中编写和测试的一个:

/** @OnlyCurrentDoc */

function onEdit(e) {
  var ss = SpreadsheetApp.getActiveSpreadsheet();
  var blad1 = ss.getSheetByName('Blad1');
  var editHistory = ss.getSheetByName('editHistory');
  var editRange = blad1.getRange('E1:L1');

  var eRange = e.range;
  var eRow = eRange.getRow();
  var eCol = eRange.getColumn();

  if (eCol >= editRange.getColumn() && eCol <= editRange.getLastColumn() && eRow >= editRange.getRow() && eRow <= editRange.getLastRow() && !eRange.isBlank()) {
    var newVal = eRange.getValue();
    editHistory.appendRow([newVal]);
  }
}

此脚本采用任何放置在编辑范围中的值(在您的情况下是 e1:l1 ),并将其附加到额外的工作表中。由此,您可以使用 unique()公式,该公式指向此表中的列表,以获取所有输入值的完整唯一历史记录。


One way you can do this is with an extra log sheet and an Apps Script script.

Here is one that I have written and tested in a copy of your sheet:

/** @OnlyCurrentDoc */

function onEdit(e) {
  var ss = SpreadsheetApp.getActiveSpreadsheet();
  var blad1 = ss.getSheetByName('Blad1');
  var editHistory = ss.getSheetByName('editHistory');
  var editRange = blad1.getRange('E1:L1');

  var eRange = e.range;
  var eRow = eRange.getRow();
  var eCol = eRange.getColumn();

  if (eCol >= editRange.getColumn() && eCol <= editRange.getLastColumn() && eRow >= editRange.getRow() && eRow <= editRange.getLastRow() && !eRange.isBlank()) {
    var newVal = eRange.getValue();
    editHistory.appendRow([newVal]);
  }
}

This script takes any value that's placed into the edit range (in your case that's E1:L1) and appends it to the extra sheet. From this, you can use a UNIQUE() formula that points to the list in this sheet in order to get a full unique history of all the entered values.

ex
ex2

创建唯一值列表

你如我软肋 2025-02-18 21:35:20

下面的方法使用 将每个Unicode字符转换为其规范分解形式和 encodeuricomponent() 将编码编码的UTF-8字符应用于整个URL,而无需更改/和<</code>和<代码>:字符在更改 space 字符+字符时。源URL是 split()使用/ space> space 作为定界数。 / space 作为定界符,来自 split()的输出中,以及URL的片段不是/ space 定界符具有 normalize('nfc') encodeuricomponent() /代码>应用。

const splits = '[\/: ]';
const splitter = new RegExp(`(?=${splits})|(?<=${splits})`, 'g');

export function s3Url(url: string): string {
  return url.split(splitter).reduce((s3Url: string, segment: string) => s3Url + (' ' === segment ? '+' : '\/' === segment || ':' === segment ? segment : encodeURIComponent(segment.normalize('NFC'))), '');
}

The approach below uses normalize('NFC') to translate each Unicode character into its canonical decomposed form and encodeURIComponent() to apply the UTF-8 character encoding to the entire URL without altering the / and the : characters while changing space characters to + characters. The source url is split() using / : space as delimiters. The / : space as delimiter are included in the output from split() and the segments of the URL that are not a / : space delimiter have normalize('NFC') and encodeURIComponent() applied.

const splits = '[\/: ]';
const splitter = new RegExp(`(?=${splits})|(?<=${splits})`, 'g');

export function s3Url(url: string): string {
  return url.split(splitter).reduce((s3Url: string, segment: string) => s3Url + (' ' === segment ? '+' : '\/' === segment || ':' === segment ? segment : encodeURIComponent(segment.normalize('NFC'))), '');
}

使用浏览器使用TypeScript(JavaScript)访问S3 Multibyte Unicode FileName文件

你如我软肋 2025-02-18 04:30:39

Discord将删除所有普通消息的领先空间。

您可以尝试将其包装在代码块中。

@client.command()
async def name(ctx):

    message = "```\n"
    message += "       ____        __________            ____   ____   ____   \n"
    message += "      /   /       /         /           /   /  /   /  /   /   \n"
    message += "     /   /       /   _____ /           /   /  /   /  /   /    \n"
    message += "    /   /       /_____    /           /   /  /   /  /   /     \n"
    message += "   /   /____   /         /           /   /__/   /__/   /      \n"
    message += "  /________/  /_________/           /_________________/       \n"
    message += "                        ============                          \n"
    message += "                                                              \n"
    message += "```"

    await ctx.send(message)

Discord will delete leading spaces for all normal messages.

You could try enclosing it in a code block.

@client.command()
async def name(ctx):

    message = "```\n"
    message += "       ____        __________            ____   ____   ____   \n"
    message += "      /   /       /         /           /   /  /   /  /   /   \n"
    message += "     /   /       /   _____ /           /   /  /   /  /   /    \n"
    message += "    /   /       /_____    /           /   /  /   /  /   /     \n"
    message += "   /   /____   /         /           /   /__/   /__/   /      \n"
    message += "  /________/  /_________/           /_________________/       \n"
    message += "                        ============                          \n"
    message += "                                                              \n"
    message += "```"

    await ctx.send(message)

机器人可以发送从终端复制的消息吗?

你如我软肋 2025-02-18 02:13:12

您知道如何使用Sass吗?
不久前,我遇到了同样的问题,我以这种方式解决了。好吧,您必须更改Bootstrap版本5版本的突破点,但这很容易。

我这样做:

h1.title{
    @include fontSize(16px, 16px, 20px, 24px, 32px);
}

p{
    @include fontSize(12px, 12px, 14px, 14px, 16px);
}

mixin-fontSize.scss v1
@mixin fontSize($all: '', $sm: '', $md: '', $lg: '', $xl: ''){
    @if($all != ''){
        font-size:$all;
    };
    @if($sm != ''){
        @media all and(min-width:576px){font-size:$sm}
    };
    @if($md != ''){
        @media all and(min-width:768px){font-size:$md}
    };
    @if($lg != ''){
        @media all and(min-width:992px){font-size:$lg}
    };
    @if($xl != ''){
        @media all and(min-width:1200px){font-size:$xl}
    };
};

h1.title {
  font-size: 16px;
}
@media all and (min-width: 576px) {
  h1.title {
    font-size: 16px;
  }
}
@media all and (min-width: 768px) {
  h1.title {
    font-size: 20px;
  }
}
@media all and (min-width: 992px) {
  h1.title {
    font-size: 24px;
  }
}
@media all and (min-width: 1200px) {
  h1.title {
    font-size: 32px;
  }
}

p {
  font-size: 12px;
}
@media all and (min-width: 576px) {
  p {
    font-size: 12px;
  }
}
@media all and (min-width: 768px) {
  p {
    font-size: 14px;
  }
}
@media all and (min-width: 992px) {
  p {
    font-size: 14px;
  }
}
@media all and (min-width: 1200px) {
  p {
    font-size: 16px;
  }
}
<h1 class="title">Test</h1>
<p>Test</p>

Do you know how to use SASS?
I had the same problem a while ago and I solved it this way. Well, you'll have to change the break points for version 5 of bootstrap, but it's easy.

I do it this way:

h1.title{
    @include fontSize(16px, 16px, 20px, 24px, 32px);
}

p{
    @include fontSize(12px, 12px, 14px, 14px, 16px);
}

mixin-fontSize.scss v1
@mixin fontSize($all: '', $sm: '', $md: '', $lg: '', $xl: ''){
    @if($all != ''){
        font-size:$all;
    };
    @if($sm != ''){
        @media all and(min-width:576px){font-size:$sm}
    };
    @if($md != ''){
        @media all and(min-width:768px){font-size:$md}
    };
    @if($lg != ''){
        @media all and(min-width:992px){font-size:$lg}
    };
    @if($xl != ''){
        @media all and(min-width:1200px){font-size:$xl}
    };
};

h1.title {
  font-size: 16px;
}
@media all and (min-width: 576px) {
  h1.title {
    font-size: 16px;
  }
}
@media all and (min-width: 768px) {
  h1.title {
    font-size: 20px;
  }
}
@media all and (min-width: 992px) {
  h1.title {
    font-size: 24px;
  }
}
@media all and (min-width: 1200px) {
  h1.title {
    font-size: 32px;
  }
}

p {
  font-size: 12px;
}
@media all and (min-width: 576px) {
  p {
    font-size: 12px;
  }
}
@media all and (min-width: 768px) {
  p {
    font-size: 14px;
  }
}
@media all and (min-width: 992px) {
  p {
    font-size: 14px;
  }
}
@media all and (min-width: 1200px) {
  p {
    font-size: 16px;
  }
}
<h1 class="title">Test</h1>
<p>Test</p>

H1-H6字体大小的引导断点

你如我软肋 2025-02-17 20:04:20

在内部您 if(ISSET($ _ post ['country'])))

incode> include() do:

$checkedSkills = implode(", ", $_POST['skills']);

...

$statement->execute(
    array(
        ':country'      =>  $_POST['country'],
        ':state'        =>  $_POST['state'],
        ':city'         =>  $_POST['hidden_city'],
        ':skills'           =>  $checkedSkills,
    )
);

Inside you're if(isset($_POST['country']))

After you're include() do:

$checkedSkills = implode(", ", $_POST['skills']);

...

$statement->execute(
    array(
        ':country'      =>  $_POST['country'],
        ':state'        =>  $_POST['state'],
        ':city'         =>  $_POST['hidden_city'],
        ':skills'           =>  $checkedSkills,
    )
);

爆破数组如何使其正确?

更多

推荐作者

櫻之舞

文章 0 评论 0

弥枳

文章 0 评论 0

m2429

文章 0 评论 0

野却迷人

文章 0 评论 0

我怀念的。

文章 0 评论 0

更多

友情链接

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