甜点

文章 评论 浏览 28

甜点 2025-02-09 03:16:39

正如我提到的,我个人建议切换到有条件的聚合。然后,您只能 sum 总计:

SELECT [Date],
       Typology,
       Instrument,
       Market,
       Type,
       Curve,
       SUM(CASE Pillar WHEN '6M' THEN Amount END) AS [6M],
       SUM(CASE Pillar WHEN '1Y' THEN Amount END) AS [1Y],
       ...
       SUM(CASE Pillar WHEN '4Y' THEN Amount END) AS [40Y],
       SUM(Amount) AS Total
FROM dbo.tblActivePivotSensiBondDaily
WHERE [date] = '20220525' -- I assume the column [date] is the date data type.
GROUP BY [Date],
         Typology,
         Instrument,
         Market,
         Type,
         Curve
ORDER BY Instrument;

As I mentioned, I would personally suggest switching to conditional aggregation. Then you can just SUM for your total:

SELECT [Date],
       Typology,
       Instrument,
       Market,
       Type,
       Curve,
       SUM(CASE Pillar WHEN '6M' THEN Amount END) AS [6M],
       SUM(CASE Pillar WHEN '1Y' THEN Amount END) AS [1Y],
       ...
       SUM(CASE Pillar WHEN '4Y' THEN Amount END) AS [40Y],
       SUM(Amount) AS Total
FROM dbo.tblActivePivotSensiBondDaily
WHERE [date] = '20220525' -- I assume the column [date] is the date data type.
GROUP BY [Date],
         Typology,
         Instrument,
         Market,
         Type,
         Curve
ORDER BY Instrument;

添加来自Pivot的其他列的总和列

甜点 2025-02-09 01:32:52

我通过将对象播放器发送到类中的函数eneybullet,然后将其存储在类型的DisplayObject中,以将其存储在函数更新中。

.fla文件中的if statment的内容:

if (spaceBarPressed == true) {
    var eb = new EnemyBullet(player)
    stage.addChild(eb)
    eb.x = enemy.x + 120
    eb.y = enemy.y + 120
}

.as file 的内容

package  {
    
    import flash.display.MovieClip;
    import flash.display.DisplayObject;
    import flash.events.Event   
    
    public class EnemyBullet extends MovieClip {
        var $thing:DisplayObject
        
        public function EnemyBullet($testObject:DisplayObject) {
            $thing = $testObject
            addEventListener(Event.ENTER_FRAME, update)
        }
        function update(e:Event) {
            this.x+=5
            if ($thing.hitTestObject(this) ) {
                trace("HIT")
            }
        }

    }
    
}

I fixed it by sending the object player to the function EnemyBullet in the class, and stored it in a variable of type DisplayObject to reference it in the function update.

Contents of if Statment in .fla file:

if (spaceBarPressed == true) {
    var eb = new EnemyBullet(player)
    stage.addChild(eb)
    eb.x = enemy.x + 120
    eb.y = enemy.y + 120
}

Contents of .as file

package  {
    
    import flash.display.MovieClip;
    import flash.display.DisplayObject;
    import flash.events.Event   
    
    public class EnemyBullet extends MovieClip {
        var $thing:DisplayObject
        
        public function EnemyBullet($testObject:DisplayObject) {
            $thing = $testObject
            addEventListener(Event.ENTER_FRAME, update)
        }
        function update(e:Event) {
            this.x+=5
            if ($thing.hitTestObject(this) ) {
                trace("HIT")
            }
        }

    }
    
}

HittestObject在ActionScript类中不起作用

甜点 2025-02-08 16:42:30

首先...您可能应该从设置TLS和HTTP安全标头开始保护Web应用程序本身。 (我建议您查看SecurityHeaders.com,以便快速概述可能性),

其次...除此之外。如果您确实必须加密这些键,那么我可能会选择一个界面的组合,用于识别ID并为这些DTO( - > this接口)编写自定义JSONCONVERTER,以照顾加密/解密。

Microsoft在.net 6中有一个很好的文档

。 rel =“ nofollow noreferrer”>如何为json序列化编写自定义转换器

第三:如果您不希望ID猜测,则应使用GUID。它们甚至可以通过EF核心用作身份。

First... You should probably start with securing the web application itself, by setting TLS and http security headers. (I'd recommend you to check securityheaders.com for a quick overview on the possibilities)

Second... Aside from that. If you really must encrypt these keys, then I'd probably choose a combination of an interface for identifying the ids and write a custom JsonConverter for these DTOs (-->this interface), that takes care of the encryption/decryption.

Microsoft has a pretty good documentation for this in .Net 6.

How to write custom converters for JSON serialization

Third: If you dont want the ids to be guessable, you should use GUIDs. They can even be used as identities by EF core.

DTO中的加密和解密敏感特性

甜点 2025-02-08 15:15:26

我已经在

另外,在搜索这些信息时,我从许多其他解决方案中学到了很多东西,例如打开VS时必须保留多少条条目以及删除它们的其他方法。
One of the references contains many ways to this issue is

但是,视觉工作室中的 clear recent 扩展是上述答案中给出的更好的解决方案。

I have posted the same question on Super User and that answer helped me to clear the recent projects history after opening the Visual Studio IDE.

Also, while searching for this information, I learnt a lot from many other solutions like How many recent entries we have to keep when opened the VS and the other ways to delete them.
One of the references contains many ways to this issue is C#Corner Article.

But the ClearRecent extension in Visual Studio is a better solution as given in the above answer.

如何从“ Visual Studio”打开窗口中删除旧项目条目/列表/历史记录?

甜点 2025-02-08 09:29:35

如果我正确阅读,那么您遇到的问题是,当播放器站在移动上时,播放器不会移动。要解决此问题,每当您移动平台时,都应检查玩家是否站在平台上(具有碰撞功能),那么如果玩家站在平台上您正在移动的平台。它看起来可能是这样的(我不知道您的代码,所以这是一个粗略的猜测):

function movePlatform(dx, dy) {
    if (collisionTop(player, platform)) {
        player.position.x += dx;
        player.position.y += dy;
        platform.position.x += dx;
        platform.position.y += dy;
    }
}

If I read correctly, the problem you have is that the player does not move when the platform it is standing on moves. To fix this problem, whenever you move the platform, you should check if the player is standing on the platform (with a collision function), then if the player is standing on the platform, move the play the same distance in the same direction as the platform you are moving. It might look something like this (I don't know your code, so this is a rough guess):

function movePlatform(dx, dy) {
    if (collisionTop(player, platform)) {
        player.position.x += dx;
        player.position.y += dy;
        platform.position.x += dx;
        platform.position.y += dy;
    }
}

我的播放器滑下移动平台。 JavaScript帆布游戏

甜点 2025-02-07 12:20:44

因为 tfds.load(....,as_supervised = true)返回数据集(tf.data),该数据集(tf.data)已经包含IMG和标签,但是 keras.datasets.cifar100.load_data() /代码>给您仅数组(IMG和标签),因此应该这样:

model.fit(x=x_train, y=y_train, validation_data=(x_test, y_test), epochs=NUM_EPOCHS)

Because tfds.load(.... , as_supervised=True ) returns datasets (tf.data) that already contains img and label together, but keras.datasets.cifar100.load_data() give you just arrays (img and label), so it should be like this:

model.fit(x=x_train, y=y_train, validation_data=(x_test, y_test), epochs=NUM_EPOCHS)

当我将`keras.datasets.cifar10`与model.fit一起生成错误时

甜点 2025-02-07 10:07:21

实际上,每当您按下时它会更改,但是每当值变为bloc 1和back 2时,您没有看到效果

只会将以下行更改

onPressed: () => BlocProvider.of<SecscreenBloc>(context).add(LoadSecscreenEvent(
                  numm
                )),

为这一数字:

 onPressed: () => BlocProvider.of<SecscreenBloc>(context)
                  .add(LoadSecscreenEvent(state.number)),

actually it is changed every time you press but every time the value gone to the bloc 1 and back 2 so you did not see the effection

just change the following line

onPressed: () => BlocProvider.of<SecscreenBloc>(context).add(LoadSecscreenEvent(
                  numm
                )),

to this one :

 onPressed: () => BlocProvider.of<SecscreenBloc>(context)
                  .add(LoadSecscreenEvent(state.number)),

如何使用Bloc扑波点单击按钮后如何更改文本

甜点 2025-02-06 17:01:35

将您的列表在 build()函数中移动,

请尝试以下操作:

import 'package:flutter/material.dart';

class ProfileScreen extends StatelessWidget {

  @override
  Widget build(BuildContext context) {
    List<dynamic> list = [
      {
        'id': 0,
        'title': 'Profile',
        'trailing': IconButton(icon: Icon(Icons.arrow_forward_ios_outlined), onPressed: () {}),
      },
      {
        'id': 1,
        'title': 'Change PIN',
        'trailing': IconButton(icon: Icon(Icons.arrow_forward_ios_outlined), onPressed: () {

        }),
      },
      {
        'id': 2,
        'title': 'Settings',
        'trailing': IconButton(icon: Icon(Icons.arrow_forward_ios_outlined), onPressed: () {
          Navigator.push(context, MaterialPageRoute (builder: (context) => SettingsScreen()));
        }),
      },
      {
        'id': 3,
        'title': 'Contact Us',
        'trailing': IconButton(icon: Icon(Icons.arrow_forward_ios_outlined), onPressed: () {}),
      },
      {
        'id': 4,
        'title': 'About NBS ',
        'trailing': IconButton(icon: Icon(Icons.arrow_forward_ios_outlined), onPressed: () {}),
      },
    ];
    return Scaffold(
      appBar: AppBar(
        backgroundColor: Colors.orange,
        leading: IconButton(onPressed: () {
          Navigator.pop(context);
        }, icon: const Icon(Icons.arrow_back_ios_new_outlined),
        ), ),
      body: ListView.builder(
        itemCount: list.length,
        itemBuilder: (BuildContext context, int index) {
          return Card(
            shadowColor: Colors.grey.shade300,
            child: ListTile(
              title: Text(
                list[index]['title'],
              ),


              trailing: list[index]['trailing'],
            ),
          );
        },
      ),
    );
  }
}

class SettingsScreen extends StatelessWidget {
  const SettingsScreen({ Key? key }) : super(key: key);

  @override
  Widget build(BuildContext context, { String title = ''}) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      title: 'Settings',
      home: Scaffold(
        appBar:
        AppBar(
            backgroundColor: Colors.orange,
            title: const Text('Settings',
                style: TextStyle( color: Colors.black, fontWeight: FontWeight.bold)),
            centerTitle: true,
            leading: GestureDetector(
              child: IconButton(
                icon: const Icon(Icons.arrow_back_ios_new_outlined,
                  size: 20,
                  color: Colors.white,),
                onPressed: () {
                  Navigator.pop(context);
                },),
            )),
        body: Column(
          children: const [
            // DetailsSettings(),
          ],
        ),
      ),

    );
  }
}

它将起作用!

Move your list inside build() function

Try this:

import 'package:flutter/material.dart';

class ProfileScreen extends StatelessWidget {

  @override
  Widget build(BuildContext context) {
    List<dynamic> list = [
      {
        'id': 0,
        'title': 'Profile',
        'trailing': IconButton(icon: Icon(Icons.arrow_forward_ios_outlined), onPressed: () {}),
      },
      {
        'id': 1,
        'title': 'Change PIN',
        'trailing': IconButton(icon: Icon(Icons.arrow_forward_ios_outlined), onPressed: () {

        }),
      },
      {
        'id': 2,
        'title': 'Settings',
        'trailing': IconButton(icon: Icon(Icons.arrow_forward_ios_outlined), onPressed: () {
          Navigator.push(context, MaterialPageRoute (builder: (context) => SettingsScreen()));
        }),
      },
      {
        'id': 3,
        'title': 'Contact Us',
        'trailing': IconButton(icon: Icon(Icons.arrow_forward_ios_outlined), onPressed: () {}),
      },
      {
        'id': 4,
        'title': 'About NBS ',
        'trailing': IconButton(icon: Icon(Icons.arrow_forward_ios_outlined), onPressed: () {}),
      },
    ];
    return Scaffold(
      appBar: AppBar(
        backgroundColor: Colors.orange,
        leading: IconButton(onPressed: () {
          Navigator.pop(context);
        }, icon: const Icon(Icons.arrow_back_ios_new_outlined),
        ), ),
      body: ListView.builder(
        itemCount: list.length,
        itemBuilder: (BuildContext context, int index) {
          return Card(
            shadowColor: Colors.grey.shade300,
            child: ListTile(
              title: Text(
                list[index]['title'],
              ),


              trailing: list[index]['trailing'],
            ),
          );
        },
      ),
    );
  }
}

class SettingsScreen extends StatelessWidget {
  const SettingsScreen({ Key? key }) : super(key: key);

  @override
  Widget build(BuildContext context, { String title = ''}) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      title: 'Settings',
      home: Scaffold(
        appBar:
        AppBar(
            backgroundColor: Colors.orange,
            title: const Text('Settings',
                style: TextStyle( color: Colors.black, fontWeight: FontWeight.bold)),
            centerTitle: true,
            leading: GestureDetector(
              child: IconButton(
                icon: const Icon(Icons.arrow_back_ios_new_outlined,
                  size: 20,
                  color: Colors.white,),
                onPressed: () {
                  Navigator.pop(context);
                },),
            )),
        body: Column(
          children: const [
            // DetailsSettings(),
          ],
        ),
      ),

    );
  }
}

It will work!

是否可以在列表中使用iconbutton导航到其他屏幕

甜点 2025-02-06 11:43:24

我认为您正在混合CV2和Matplotlib。如果您只想显示图像,则可以这样做:

使用CV2:

import cv2
I = cv2.imread('path/to/img')
cv2.imshow('window_name', I)
cv2.waitKey(0)

,也可以通过@Jeruluke指出的末尾添加plt.show()来使用matplotlib。请记住,OpenCV将图像读为BGR,这将使您显示图像时会使颜色变得奇怪。您可以使用 cv2.imread('path/to/to/to/image.jpg',color_bgr2rgb)如果您使用matplotlib设置了。

I think you are mixing cv2 and matplotlib. If you just want to display the image you can do it like so:

Using cv2:

import cv2
I = cv2.imread('path/to/img')
cv2.imshow('window_name', I)
cv2.waitKey(0)

or you can use matplotlib by simply adding plt.show() at the end as @JeruLuke pointed out. Just remember that OpenCV reads the image as BGR and this would make the colors show up weird when you display the image. You can use cv2.imread('path/to/image.jpg', COLOR_BGR2RGB) if you are set on using matplotlib.

vscode matplotlib未显示图形窗口

甜点 2025-02-06 08:55:15

显然,如果SQL Server已配置了A 服务帐户。

将其更改为服务下的域\用户名后,TFS备份工具可以正确处理它,并且可以(重新)配置备份

Apparently the TFS Backup tool cannot handle it if the SQL Server has been configured with a [email protected] service account.

After changing it to DOMAIN\Username under services, the TFS Backup tool could handle it properly and the backups could be (re)configured

Azure Devops Server 2020-无法配置备份

甜点 2025-02-06 01:48:27

在您的情况下,使用以下样品公式怎么样?

样品公式:

使用样品电子表格时,请将此公式放在单元格“ G3”中。

=ARRAYFORMULA(IF((D3:D="Yes")*(E3:E="Yes")*(F3:F="Yes")=1,C3:C,""))
  • 在此公式中,列“ D”,“ E”和“ F”是是YES ,列列列的值。

测试:

使用此公式时,将检索值如下。并使用“ B”,“ C”和“ G”列创建图表。而且,当列“ G”值的圆圈很大时,将获得以下结果。

注意:

  • 当您使用 X 标记为“ G”列的图时,您可以使用 X 获得图表。

In your situation, how about using the following sample formula?

Sample formula:

When your sample Spreadsheet is used, please put this formula to the cell "G3".

=ARRAYFORMULA(IF((D3:D="Yes")*(E3:E="Yes")*(F3:F="Yes")=1,C3:C,""))
  • In this formula, the columns "D", "E", and "F" are yes, and the value of column "C" is returned.

Testing:

When this formula is used, the values are retrieved as follows. And, create a chart using the columns "B", "C" and "G". And, when the circle of the values of column "G" is large, the following result is obtained.

enter image description here

Note:

  • When you use X mark as the plot of column "G", you can obtain the chart with X.

在Google表中绘制条件图并自动化绘图

甜点 2025-02-06 00:37:03

由于 testfct 在线程job的范围中不存在,因此您需要首先存储函数的定义,然后将其传递到Runspace范围并定义该功能,如此答案

另一个问题是尝试多次引用相同的 $输入。由于自动变量 $ input ,您只能在 script block

由于 $ input 是枚举者,因此访问其任何属性原因 $ input 不再可用。您可以将 $输入存储在另一个变量中以重复使用 $ input properties。

作为解决方法,您可以将变量包裹在 array subxpression operator @() noreflow noreferrer“> subexpression opertress” >将枚举的输出存储在新变量中。

这是上面解释的一个简单示例:

Start-ThreadJob -InputObject 'Hello World' -ScriptBlock {
    "1. $input"
    "2. $input"
} | Receive-Job -AutoRemoveJob -Wait

# This outputs:
# 1. Hello World
# 2.

# And the workaround
Start-ThreadJob -InputObject 'Hello World' -ScriptBlock {
    # This would also work:
    # $thisInput = foreach($i in $input) { $i }

    $thisInput = $($input)
    "1. $thisInput"
    "2. $thisInput"
} | Receive-Job -AutoRemoveJob -Wait

# Outputs:
# 1. Hello World
# 2. Hello World

最后,您的脚本实际上不是多线程,这是因为您将作业存储在循环中,然后顺序等待而不是立即开始所有工作,然后等待所有工作

class BackupContentData {
    [ValidateNotNullOrEmpty()] [string] $What
    [ValidateNotNullOrEmpty()] [string] $ZipSource
}
function testFct {
    param([string]$What, [string]$ZipSource, [string]$ZipDest, [string]$Timestamp)
    Write-Host "inside: -What: $What -ZipSource $ZipSource -ZipDest $ZipDest -Timestamp $Timestamp"
}

# definition of the function is stored here
$def = ${function:testFct}.ToString()

$bcd = @(
    [BackupContentData]@{ What="Data A"; ZipSource="$env:USERPROFILE\Documents\a_file.txt" }
    [BackupContentData]@{ What="Data B"; ZipSource="$env:USERPROFILE\Documents\b_file.txt" }
)

$job = foreach ($e in $bcd) {
    Start-ThreadJob -Name $e.What -InputObject $e -ScriptBlock {
        $thisObject = $($input)
        # Define a new function with name `getTest` in this scope using `testFct` definition
        ${function:getTest} = $using:def
        Write-Host "outside: -What: $($thisObject.What) -ZipSource $($thisObject.ZipSource) -ZipDest $env:Temp -Timestamp $(get-date -f yyyyMMdd-HHmmss)"
        getTest -What $thisObject.What -ZipSource $thisObject.ZipSource -ZipDest $env:Temp -Timestamp (Get-Date -f yyyyMMdd-HHmmss)
    }
}
$job | Receive-Job -AutoRemoveJob -Wait

您可以从中可以期望的输出:

outside: -What: Data A -ZipSource C:\Users\user\Documents\a_file.txt -ZipDest C:\Users\user\AppData\Local\Temp -Timestamp 20220516-202251
inside: -What: Data A -ZipSource C:\Users\user\Documents\a_file.txt -ZipDest C:\Users\user\AppData\Local\Temp -Timestamp 20220516-202251
outside: -What: Data B -ZipSource C:\Users\user\Documents\b_file.txt -ZipDest C:\Users\user\AppData\Local\Temp -Timestamp 20220516-202251
inside: -What: Data B -ZipSource C:\Users\user\Documents\b_file.txt -ZipDest C:\Users\user\AppData\Local\Temp -Timestamp 20220516-202251

Since testFct doesn't exist in the scope of your ThreadJob, you need to first store the function's definition and then pass it to the runspace scope and define the function there as demonstrated in this answer.

The other issue is trying to reference the same $input more than one time. Due to the nature of the automatic variable $input, you can only reference this variable once in your script block:

Since $input is an enumerator, accessing any of its properties causes $input to no longer be available. You can store $input in another variable to reuse the $input properties.

As a workaround you could wrap the variable in the Array subexpression operator @( ) or the Subexpression operator $( ) to store the enumerated output in a new variable.

Here is a simple example of what's explained above:

Start-ThreadJob -InputObject 'Hello World' -ScriptBlock {
    "1. $input"
    "2. $input"
} | Receive-Job -AutoRemoveJob -Wait

# This outputs:
# 1. Hello World
# 2.

# And the workaround
Start-ThreadJob -InputObject 'Hello World' -ScriptBlock {
    # This would also work:
    # $thisInput = foreach($i in $input) { $i }

    $thisInput = $($input)
    "1. $thisInput"
    "2. $thisInput"
} | Receive-Job -AutoRemoveJob -Wait

# Outputs:
# 1. Hello World
# 2. Hello World

Lastly, your script is not actually multi-threading, this is because you're storing the job inside your loop and then waiting for it sequentially instead of starting all jobs at once and then waiting for all of them.

class BackupContentData {
    [ValidateNotNullOrEmpty()] [string] $What
    [ValidateNotNullOrEmpty()] [string] $ZipSource
}
function testFct {
    param([string]$What, [string]$ZipSource, [string]$ZipDest, [string]$Timestamp)
    Write-Host "inside: -What: $What -ZipSource $ZipSource -ZipDest $ZipDest -Timestamp $Timestamp"
}

# definition of the function is stored here
$def = ${function:testFct}.ToString()

$bcd = @(
    [BackupContentData]@{ What="Data A"; ZipSource="$env:USERPROFILE\Documents\a_file.txt" }
    [BackupContentData]@{ What="Data B"; ZipSource="$env:USERPROFILE\Documents\b_file.txt" }
)

$job = foreach ($e in $bcd) {
    Start-ThreadJob -Name $e.What -InputObject $e -ScriptBlock {
        $thisObject = $($input)
        # Define a new function with name `getTest` in this scope using `testFct` definition
        ${function:getTest} = $using:def
        Write-Host "outside: -What: $($thisObject.What) -ZipSource $($thisObject.ZipSource) -ZipDest $env:Temp -Timestamp $(get-date -f yyyyMMdd-HHmmss)"
        getTest -What $thisObject.What -ZipSource $thisObject.ZipSource -ZipDest $env:Temp -Timestamp (Get-Date -f yyyyMMdd-HHmmss)
    }
}
$job | Receive-Job -AutoRemoveJob -Wait

The output you can expect from this:

outside: -What: Data A -ZipSource C:\Users\user\Documents\a_file.txt -ZipDest C:\Users\user\AppData\Local\Temp -Timestamp 20220516-202251
inside: -What: Data A -ZipSource C:\Users\user\Documents\a_file.txt -ZipDest C:\Users\user\AppData\Local\Temp -Timestamp 20220516-202251
outside: -What: Data B -ZipSource C:\Users\user\Documents\b_file.txt -ZipDest C:\Users\user\AppData\Local\Temp -Timestamp 20220516-202251
inside: -What: Data B -ZipSource C:\Users\user\Documents\b_file.txt -ZipDest C:\Users\user\AppData\Local\Temp -Timestamp 20220516-202251

为什么启动线程job调用该函数?

甜点 2025-02-05 22:24:50

我能够通过在GraphQL架构中创建一个新模型来完成所需的工作。

这是我所做的:


    type MeetSessionGymnastScore @model {
      id: ID!
      meetId: ID! @index(name: "byMeet", sortKeyFields: ["id"])
      meet: Meet @belongsTo(fields: ["meetId"])
      meetSessionId: ID! @index(name: "byMeetSession", sortKeyFields: ["id"])
      meetSession: MeetSession @belongsTo(fields: ["meetSessionId"])
      gymnastId: ID! @index(name: "byGymnast", sortKeyFields: ["id"])
      gymnast: Gymnast @belongsTo(fields: ["gymnastId"])
      meetScoreId: ID @index(name: "byMeetScore", sortKeyFields: ["id"])
      meetScore: MeetScore @belongsTo(fields: ["meetScoreId"])
    }

I was able to do what I needed by created a new model in the graphql schema.

Here is what I did:


    type MeetSessionGymnastScore @model {
      id: ID!
      meetId: ID! @index(name: "byMeet", sortKeyFields: ["id"])
      meet: Meet @belongsTo(fields: ["meetId"])
      meetSessionId: ID! @index(name: "byMeetSession", sortKeyFields: ["id"])
      meetSession: MeetSession @belongsTo(fields: ["meetSessionId"])
      gymnastId: ID! @index(name: "byGymnast", sortKeyFields: ["id"])
      gymnast: Gymnast @belongsTo(fields: ["gymnastId"])
      meetScoreId: ID @index(name: "byMeetScore", sortKeyFields: ["id"])
      meetScore: MeetScore @belongsTo(fields: ["meetScoreId"])
    }

Angular AWS放大GraphQl查询未使用API​​服务返回预期数据

甜点 2025-02-05 13:50:21

您还可以使用 query 组件或 hoc 。但是请注意,由于基于班级的组件被认为是遗产,这些遗产不再收到任何更新。

使用查询组件:

import { Query } from '@apollo/client/react/components';

export class ProductListing extends Component {

  render() {
    return (
      <Query query={LOAD_PRODUCTS}>
          {({data}) => <div>Render data here ...</div>}
      </Query>
    )
  }
}

使用HOC:

import { graphql } from '@apollo/client/react/hoc';

class ProductListing extends Component {

  render() {
    const data = this.props.data;

    return <div>Render data here ...</div>;
  }
}

export default graphql(LOAD_PRODUCTS)(ProductListing);

You can also query a graphql endpoint using the Query component or the HOC. But note that since class based components are considered legacy those do not receive any updates anymore.

Using the Query component:

import { Query } from '@apollo/client/react/components';

export class ProductListing extends Component {

  render() {
    return (
      <Query query={LOAD_PRODUCTS}>
          {({data}) => <div>Render data here ...</div>}
      </Query>
    )
  }
}

Using the HOC:

import { graphql } from '@apollo/client/react/hoc';

class ProductListing extends Component {

  render() {
    const data = this.props.data;

    return <div>Render data here ...</div>;
  }
}

export default graphql(LOAD_PRODUCTS)(ProductListing);

如何从基于类的React组件查询GraphQl端台

甜点 2025-02-05 01:42:43

我认为在技术上不像您这样的格式在技术上无效。也就是说,我会质疑任何访客的实用性,无论他们是否被看到。

如果您想减少详细的内容,则可以使用Unicode字符,但是请注意,HTML确实会剥离额外的空格,而连续多个空间的唯一方法是使用非断裂空间(> > &amp; nbsp; )字符。

<title>contact • company</title>

至于正确是否正确,Whatwg HTML 5规范指出&lt; title&gt; 元素的 content模式为“ text” ,但是文本内容模型的定义指出它还包括措辞内容

W3C HTML验证器似乎并未抱怨标题元素中包含的内容。搜索引擎可能以不同的方式处理此操作,有些可能会根据字符或像素宽度的长度截断您的内容。

I don't believe that it's technically invalid to include formatting like you're doing. That said, I'd question the utility of this approach for any visitor regardless of whether they are sighted or not.

If you want to make it less verbose, you could use unicode characters, but be aware that HTML does strip out extra whitespace, and the only way to make more than one consecutive space is to use the non-breaking-space ( ) character.

<title>contact • company</title>

As far as whether it's correct or not, the WHATWG HTML 5 specification states that the <title> element's content mode is "Text", however the definition of a Text content model states that it also includes Phrasing content.

The W3C HTML validator doesn't seem to complain about phrasing content being included in the title element. Search engines may handle this differently, and some may truncate your content based on length of characters or pixel widths.

用额外的间距制作标题标签,并且可以访问子弹

更多

推荐作者

櫻之舞

文章 0 评论 0

弥枳

文章 0 评论 0

m2429

文章 0 评论 0

野却迷人

文章 0 评论 0

我怀念的。

文章 0 评论 0

更多

友情链接

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