羞稚

文章 评论 浏览 26

羞稚 2025-02-20 15:53:52

您可以尝试为model.gregion设置默认值:

public class YourModel{
    public int RegionID { get; set; }
    public Region Region { get; set; } = new Region();
}
public class Region {
    public string Name { get; set; }
}

You can try to set a default value for Model.Region:

public class YourModel{
    public int RegionID { get; set; }
    public Region Region { get; set; } = new Region();
}
public class Region {
    public string Name { get; set; }
}

System.NullReferenceException创建一个详细信息查看站点模型,该模型来自区域模型

羞稚 2025-02-20 14:55:13

老板看来你在寻找这个

 app.post('/api/data',(req,res)=>{
    console.log(req.body)
        res.send(req.body);
    });

Boss it looks like your looking for this

 app.post('/api/data',(req,res)=>{
    console.log(req.body)
        res.send(req.body);
    });

处理HTTP请求

羞稚 2025-02-20 07:35:54

我刚刚删除了unignts.txt文件中的版本,并且成功。

I just removed the version in the requirements.txt file and it was successful.

Azure管道因依赖性冲突而失败

羞稚 2025-02-19 23:29:32

没有明显的安全原因,这是不可能的。

No this is not possible for obvious security reasons.

下载后是否可以在模块中生成代码?

羞稚 2025-02-19 23:25:38

错误:java.lang.noclassDeffoundError在线程“ main” java.lang.noclassdeffounderror中的异常:org/slf4j/logger在com.azure.security.security.keyvault.secret.secrets.secrets.secrets.secrets.secrets.secrets.secrets.secretclientbuilder。 >

。找不到应用程序路径中的org/slf4j/logger类。此错误的最简单原因是缺少 slf4j.jar 文件。

  • 如果问题是由于丢失的slf4j.jar文件引起的,则可以通过在路径中添加相关版本的slf4j.jar来修复它。
  • 使用最新版本的JAR,其中应添加的JAR文件的版本取决于应用程序。

在Maven中,您还可以在pom.xml文件中添加以下依赖关系以下载sl4j.jar

<dependency>
    <groupId>org.slf4j</groupId>
    <artifactId>slf4j-api</artifactId>
    <version>1.7.36</version>
</dependency>

参考

error: java.lang.NoClassDefFoundError Exception in thread "main" java.lang.NoClassDefFoundError: org/slf4j/Logger at com.azure.security.keyvault.secrets.SecretClientBuilder.(SecretClientBuilder.java:110)

The above error indicates that JVM is not able to found org/slf4j/Logger class in your application's path.The simplest reason for this error is the missing Slf4j.jar file.

  • If the problem is caused due to the missing slf4j.jar file then you can fix it by adding a relevant version of slf4j.jar into your path.
  • Use the latest version of the jar in which version of the JAR file you should add will depend upon the application.

In Maven , you can also add the following dependency in your pom.xml file to download sl4j.jar

<dependency>
    <groupId>org.slf4j</groupId>
    <artifactId>slf4j-api</artifactId>
    <version>1.7.36</version>
</dependency>

Reference:
java.lang.NoClassDefFoundError: org.slf4j.LoggerFactory - Stack Overflow

Azure KeyVault库,到Atlassian Confluence插件POM.xml

羞稚 2025-02-19 21:04:55

一个解决方案似乎强制显示picker在单击上使用onclick =“ this.showpicker()”

  <button @click="$refs.fileRef.click()">file</button>
  <input type="file" ref="fileRef" style="display: none">


  <button @click="$refs.dateRef.click()">date</button>
  <input type="date" ref="dateRef" style="display: none" onclick="this.showPicker()">

,但是如doc https://developer.mozilla.org/en-us/docs/web/api/htmlinputelement/showpicker
如果您尝试在框架中打电话,您将有一个安全例外

注意:启动日期,日期本地,月,时间,一周的选择器
以同样的方式。他们不能在这里显示,因为实时示例运行
在交叉框架中,会导致SecurityError

a solution seems to force display the picker on click with onclick="this.showPicker()"

  <button @click="$refs.fileRef.click()">file</button>
  <input type="file" ref="fileRef" style="display: none">


  <button @click="$refs.dateRef.click()">date</button>
  <input type="date" ref="dateRef" style="display: none" onclick="this.showPicker()">

but as say in the doc https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/showPicker
if you try call in a frame you will have a security exception

Note: Pickers for date, datetime-local, month, time, week are launched
in the same way. They cannot be shown here because live examples run
in a cross-origin frame, and would cause a SecurityError

如何在REF中使用输入类型日期?

羞稚 2025-02-19 19:27:42

藏族仍在开发中。请参阅支持语言的完整列表在这里

虽然还有其他支持藏族的OCR。尝试例如eg tesseract

Tibetan is still under development. See the full list of supported languages here.

There are other OCRs that support Tibetan though. Try e.g. Tesseract.

Google Cloud Vision不认识藏语字符

羞稚 2025-02-19 14:11:59

一种解决方案是在tailwind.config.js中添加一个前缀:

module.exports = {
  prefix: 'tw-',
}

这将使之成为可能只有在添加前缀时才能引用尾风效用类别,例如TW-M-2,应该(希望)防止与其他站点样式发生任何冲突。

有关更多详细信息,请参见:

One solution is to add a prefix in tailwind.config.js:

module.exports = {
  prefix: 'tw-',
}

This would make it so that the Tailwind utility classes can only be referenced if the prefix is added, e.g. tw-m-2, which should (hopefully) prevent any conflicts with the other site styles.

For more details, see: https://tailwindcss.com/docs/configuration#prefix

有没有一种方法可以在根类中包装产生的尾风类?

羞稚 2025-02-19 02:26:35

不久前这里问了这个问题,希望这会有所帮助:
错误

This question was asked here a while back, hope this helps:
Error when submitting "new" form to SQL

PowerApps会在保存到SQL数据库时的错误

羞稚 2025-02-18 21:16:25

这可以在Google Apps脚本中轻松完成。 Google Apps脚本是一个基于云的JavaScript平台,可让您与Google产品跨越并自动化任务。

要转到Google Apps脚本

  1. 转到扩展名 - &gt;应用脚本。
  2. 删除代码中的代码。gs文件
  3. 粘贴以下代码。
  4. 运行并授权

代码:

function myFunction() {
//this code will insert hi to the next available row of active sheet
  var sheet = SpreadsheetApp.getActiveSheet()
  var greet = "hi"
  sheet.appendRow([greet])
}

示例:

“在此处输入图像描述”

输出:

​:如果Google Apps脚本不是适合您的选项,则必须使用 google sheets api api

参考:

This can easily be done in Google Apps Script. Google Apps Script is a cloud-based JavaScript platform that lets you integrate with and automate tasks across Google products.

To go to Google Apps Script

  1. Go to Extensions -> Apps Script.
  2. Remove the code in Code.gs file
  3. Paste the code below.
  4. Run and authorize

Code:

function myFunction() {
//this code will insert hi to the next available row of active sheet
  var sheet = SpreadsheetApp.getActiveSheet()
  var greet = "hi"
  sheet.appendRow([greet])
}

Example:

enter image description here

Output:

enter image description here

Note: If Google Apps Script is not an option for you, you have to use the Google Sheets API

References:

有没有办法在Google表中添加jQuery字符串?

羞稚 2025-02-18 16:51:18

事实并非如此。

每次输入循环的主体时,都会在堆栈上创建两个变量。当循环击中结束}时,这些变量然后被破坏。测试循环条件并重新输入身体后,创建了新的变量。

This is not the case.

Each time the body of the loop is entered, two variables are created on the stack. Those variables are then destroyed when the loop hits the ending }. After the loop condition is tested and the body is reentered, a new pair of variables are created.

将在C中无限循环中的可变声明导致堆栈溢出

羞稚 2025-02-18 09:42:22

感谢 @273k的解决方案。

此错误的原因是,我没有将帖子数据转换为JSON格式。使用JSON_ENCODE将POST数据转换为JSON格式后,我可以从URL获得响应。

Thanks @273K for the solution.

The reason for this error is, I didn't convert the POST data to JSON format. After converting the POST data to JSON format using json_encode it worked and I am able to get the response from the URL.

php curl_exec返回“ http/1.1 100继续”其次是“ http/1.1 404”

羞稚 2025-02-18 08:43:55

第1:停止使用dnre.xxxx以定义记录的前缀,您可以使用dnre_xxxxx定义。当您使用dnre.xxxx odoo定义记录时,请尝试找到xxxx dnre dnre 模块并覆盖它,这就是外部的方式IDS在ODOO中起作用。不要弄乱这一点,否则您会遇到比现在更多的问题。

第二:请注意您在哪里定义视图,Odoo尊重您的定义从顶部到底部。 OP1:如果您在一个文件中工作,则不需要外部ID,则应在顶部定义您的视图并在底部使用。 OP2:使用更多文件,如果您需要调用文件中定义的一些视图,则需要使用此模式module_name.view_id > __ manfiest __ 您应该将文件定义为第一个文件B。

如果是OP1。您可以使用这种定义模式:

  1. 树,形式,kamban,搜索,枢轴,图形视图(顺序无关紧要)。
  2. 动作。
  3. 菜单

我希望这个答案可以帮助您。

1st: stop using dnre.xxxx prefix for define a record, you could use dnre_xxxx definition. When you define a record with dnre.xxxx Odoo with try to find the view xxxx for the dnre module and override it, this is how external ids works in Odoo. Don't mess with that or you will get more problems than now.

2nd: be aware where you define a view, Odoo respects your definitions from the top to the bottom. Op1: if you are working in one file you don't need externals ids, you sould define your view on top and use then on the bottom. Op2: working with more files, if you need to call some views defined in the file A from the file B you need to use externals ids, using this pattern module_name.view_id, in this case in __manfiest__ file you should define file A first an then file B.

If it is Op1. you could use this pattern of definitions:

  1. tree, form, kamban, search, pivots, graph view(the order don't matters).
  2. actions.
  3. Menus

I hope this answer can help you.

ODOO15-我尝试安装模块时错误

羞稚 2025-02-18 05:46:30

您不能使用计算属性或@click函数转换它。

要添加和加载外部脚本,您可以使用创建已安装 hook for vue2 设置 vue3

这是它的示例代码:

mounted() {
  let externalScript = document.createElement('script')
  externalScript.setAttribute('src', 'YOUR-LINK')
  document.head.appendChild(externalScript)
},

您还可以在函数中添加相同的逻辑,并

用于 vue2 =&gt;在创建安装钩中调用它。

对于 vue3 =&gt;在setup函数中调用它,因为设置函数在其他任何内容之前都运行

单击此处以获取来源

You cannot convert it using computed property or @click function.

To add and load external scripts, you can use created or mounted hook for Vue2 and setup function for Vue3

Here is the sample code for it:

mounted() {
  let externalScript = document.createElement('script')
  externalScript.setAttribute('src', 'YOUR-LINK')
  document.head.appendChild(externalScript)
},

You can also add the same logic in a function and

For Vue2 => call it in the created or mounted hook.

For Vue3 => call it in the setup function, as the setup function runs before anything else

Click here for source

如何将此外部脚本添加到vuejs

羞稚 2025-02-18 05:12:26

我看不到用户$点$流的点。

同样,ngoninit中的逻辑似乎太复杂了(通常是嵌套的订阅不是一个好模式)。

我已经进行了一些更改,但我无法真正测试任何事情,所以如果您有问题,请告诉我。也许您可以适应它的工作。

import {
    Observable,
    of,
    Subject,
} from 'rxjs';
import {
    switchMap,
    takeUntil,
    tap,
} from 'rxjs/operators';

import {
    Component,
    OnDestroy,
    OnInit,
} from '@angular/core';
import {
    AuthService,
    CmsComponent,
    UserIdService,
} from '@spartacus/core';
import { CmsComponentData } from '@spartacus/storefront';
import { UserAccountFacade } from '@spartacus/user/account/root';

import { PointsRetrievalService } from '../points-retrieval.service';

export interface CustomerPoints {
    points: number;
}


export interface CmsSlpCustomUserPointsComponent4 extends CmsComponent {
    title: string;
    headerText: string;
    footerText: string;
}

const customerPointsKey = 'CUSTOMER_POINTS_KEY';

@Component({
    selector: 'app-userpoints',
    templateUrl: './userpoints.component.html',
    styleUrls: ['./userpoints.component.scss']
})
export class UserpointsComponent implements OnInit, OnDestroy {
    data$: Observable<CmsSlpCustomUserPointsComponent4> = this.component.data$;
    private customerPointsRetrieved = localStorage.getItem(customerPointsKey) ?? 0;
    private _destroyed$ = new Subject<void>();
    constructor(
        public component: CmsComponentData<CmsSlpCustomUserPointsComponent4>, private pointsRetrievalService: PointsRetrievalService,
        protected auth: AuthService,
        protected userAccount: UserAccountFacade,
        protected userIdService: UserIdService,
    ) { }

    ngOnInit(): void {
        this.auth.isUserLoggedIn().pipe(
            switchMap(isUserLoggedIn => {
                if (isUserLoggedIn) {
                    return this.userAccount.get().pipe(
                        switchMap(user => {
                            if (user && user?.customerId) {
                                return this.pointsRetrievalService.getPointsForCustomerId(user.customerId).pipe(
                                    tap(userPoints => {
                                        console.log("New points:" userPoints.points)
                                        console.log(userPoints.points)
                                        this.customerPointsRetrieved = userPoints.points;
                                        localStorage.setItem(customerPointsKey, userPoints.points);
                                    })
                                )
                            }

                            return of(undefined);
                        })
                    )
                }

                return of(undefined);
            }),
            takeUntil(this._destroyed$),
        ).subscribe();
    }

    ngOnDestroy(): void {
        this._destroyed$.next();
    }

    getCustomerPoints() {
        return this.customerPointsRetrieved;
    }

}

<div class="box">
  <p>{{getCustomerPoints()}}</p> 
</div>

I don't see the point of user$ and point$ streams.

Also, the logic in ngOnInit seems a bit too complicated (usually nested subscribes are not a good pattern).

I've made some changes but I can't really test anything, so if you have issues let me know. Maybe you can adapt it to work.

import {
    Observable,
    of,
    Subject,
} from 'rxjs';
import {
    switchMap,
    takeUntil,
    tap,
} from 'rxjs/operators';

import {
    Component,
    OnDestroy,
    OnInit,
} from '@angular/core';
import {
    AuthService,
    CmsComponent,
    UserIdService,
} from '@spartacus/core';
import { CmsComponentData } from '@spartacus/storefront';
import { UserAccountFacade } from '@spartacus/user/account/root';

import { PointsRetrievalService } from '../points-retrieval.service';

export interface CustomerPoints {
    points: number;
}


export interface CmsSlpCustomUserPointsComponent4 extends CmsComponent {
    title: string;
    headerText: string;
    footerText: string;
}

const customerPointsKey = 'CUSTOMER_POINTS_KEY';

@Component({
    selector: 'app-userpoints',
    templateUrl: './userpoints.component.html',
    styleUrls: ['./userpoints.component.scss']
})
export class UserpointsComponent implements OnInit, OnDestroy {
    data$: Observable<CmsSlpCustomUserPointsComponent4> = this.component.data$;
    private customerPointsRetrieved = localStorage.getItem(customerPointsKey) ?? 0;
    private _destroyed$ = new Subject<void>();
    constructor(
        public component: CmsComponentData<CmsSlpCustomUserPointsComponent4>, private pointsRetrievalService: PointsRetrievalService,
        protected auth: AuthService,
        protected userAccount: UserAccountFacade,
        protected userIdService: UserIdService,
    ) { }

    ngOnInit(): void {
        this.auth.isUserLoggedIn().pipe(
            switchMap(isUserLoggedIn => {
                if (isUserLoggedIn) {
                    return this.userAccount.get().pipe(
                        switchMap(user => {
                            if (user && user?.customerId) {
                                return this.pointsRetrievalService.getPointsForCustomerId(user.customerId).pipe(
                                    tap(userPoints => {
                                        console.log("New points:" userPoints.points)
                                        console.log(userPoints.points)
                                        this.customerPointsRetrieved = userPoints.points;
                                        localStorage.setItem(customerPointsKey, userPoints.points);
                                    })
                                )
                            }

                            return of(undefined);
                        })
                    )
                }

                return of(undefined);
            }),
            takeUntil(this._destroyed$),
        ).subscribe();
    }

    ngOnDestroy(): void {
        this._destroyed$.next();
    }

    getCustomerPoints() {
        return this.customerPointsRetrieved;
    }

}

<div class="box">
  <p>{{getCustomerPoints()}}</p> 
</div>

链接可观察的结果

更多

推荐作者

櫻之舞

文章 0 评论 0

弥枳

文章 0 评论 0

m2429

文章 0 评论 0

野却迷人

文章 0 评论 0

我怀念的。

文章 0 评论 0

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