是伱的

文章 评论 浏览 28

是伱的 2025-02-20 21:14:39

我不知道自己正在运行Microsoft.data.sqlclient(1.1.1)和Microsoft.data.sqlclient.sni(1.1.0)的古代版本。

将microsoft.data.sqlclient升级到4.1.0和microsoft.data.sqlclient.sni到4.0.0解决了问题。

I was unaware that I was running ancient versions of Microsoft.Data.SqlClient (1.1.1) and Microsoft.Data.SqlClient.SNI (1.1.0).

Upgrading Microsoft.Data.SqlClient to 4.1.0 and Microsoft.Data.SqlClient.SNI to 4.0.0 solved the problem.

实体框架核心:具有“执行超时过期”的sqlexception'尽管设置了更高的超时

是伱的 2025-02-20 19:54:05

您本可以使用 flex 来完成此操作,就我的知识而言,网格不是为此目的做的!

这是用 flex 制作的示例

body {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: #171615;
}

.header {
  /* If you don't want the header to be sticky on scroll remove these lines */
  position: sticky;
  top: 0;
  /* If you don't want the header to be sticky on scroll remove these lines */
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  width: 100%;
  background: #171615;
}

.header-logo {
  height: 55px;
}

.logo {
  height: 100%;
  width: 135px;
  object-fit: cover;
}

.header-menu {
  display: flex;
  flex-flow: row wrap;
}

.header-menu a {
  color: #f1f1f1;
  padding: 12px;
  text-decoration: none;
  border-radius: 4px;
  margin-right: 8px;
  white-space: nowrap;
}

.header a.active {
  background: dodgerblue;
}

.login {
  background-color: dodgerblue;
}

.header-menu a:hover {
  background-color: #ddd;
  color: black;
}

.wrapper {
  width: 70%;
  color: white;
}


/* you can remove this part */

.white-space {
  display: flex;
  height: 800px;
  font-size: 3rem;
  background: darkgray;
}


/* you can remove this part */
<div class="header">
  <div class="header-logo">
    <a href="#"><img class="logo" src="https://via.placeholder.com/135x55" alt="Logo" /></a>
  </div>
  <div class="header-menu">
    <a class="active" href="#">Home</a>
    <a class="active" href="#">Games</a>
    <a class="active" href="#">Web Projects</a>
    <a class="login" href="#">Login</a>
    <a href="#">Contact</a>
    <a href="#">About</a>
  </div>
</div>
<div class="wrapper">
  <!-- put your content here -->
  <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ac ut consequat semper viverra. Eget nunc scelerisque viverra mauris in aliquam sem fringilla ut.</p>
  <div class="white-space">
    <h2 style="margin: auto">White Space</h2>
  </div>
  <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ac ut consequat semper viverra. Eget nunc scelerisque viverra mauris in aliquam sem fringilla ut.</p>
  <!-- put your content here -->
</div>

更新:
为标题增加了自定义高度

body {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: #171615;
}

.header {
  /* If you don't want the header to be sticky on scroll remove these lines */
  position: sticky;
  top: 0;
  /* If you don't want the header to be sticky on scroll remove these lines */
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  width: 100%;
  background: #171615;
}

.header-logo {
  height: 55px;
}

.logo {
  height: 100%;
  width: 135px;
  object-fit: cover;
}

.header-menu {
  display: flex;
  flex-flow: row wrap;
  height: 100px;
  align-items: center;
}

.header-menu a {
  color: #f1f1f1;
  padding: 12px;
  text-decoration: none;
  border-radius: 4px;
  margin-right: 8px;
  white-space: nowrap;
}

.header a.active {
  background: dodgerblue;
}

.login {
  background-color: dodgerblue;
}

.header-menu a:hover {
  background-color: #ddd;
  color: black;
}

.wrapper {
  width: 70%;
  color: white;
}


/* you can remove this part */

.white-space {
  display: flex;
  height: 800px;
  font-size: 3rem;
  background: darkgray;
}


/* you can remove this part */
<div class="header">
  <div class="header-logo">
    <a href="#"><img class="logo" src="https://via.placeholder.com/135x55" alt="Logo" /></a>
  </div>
  <div class="header-menu">
    <a class="active" href="#">Home</a>
    <a class="active" href="#">Games</a>
    <a class="active" href="#">Web Projects</a>
    <a class="login" href="#">Login</a>
    <a href="#">Contact</a>
    <a href="#">About</a>
  </div>
</div>
<div class="wrapper">
  <!-- put your content here -->
  <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ac ut consequat semper viverra. Eget nunc scelerisque viverra mauris in aliquam sem fringilla ut.</p>
  <div class="white-space">
    <h2 style="margin: auto">White Space</h2>
  </div>
  <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ac ut consequat semper viverra. Eget nunc scelerisque viverra mauris in aliquam sem fringilla ut.</p>
  <!-- put your content here -->
</div>

You could have done this with flex, To the best of my knowledge grid is not made for that purpose!

Here's an example made with flex

body {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: #171615;
}

.header {
  /* If you don't want the header to be sticky on scroll remove these lines */
  position: sticky;
  top: 0;
  /* If you don't want the header to be sticky on scroll remove these lines */
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  width: 100%;
  background: #171615;
}

.header-logo {
  height: 55px;
}

.logo {
  height: 100%;
  width: 135px;
  object-fit: cover;
}

.header-menu {
  display: flex;
  flex-flow: row wrap;
}

.header-menu a {
  color: #f1f1f1;
  padding: 12px;
  text-decoration: none;
  border-radius: 4px;
  margin-right: 8px;
  white-space: nowrap;
}

.header a.active {
  background: dodgerblue;
}

.login {
  background-color: dodgerblue;
}

.header-menu a:hover {
  background-color: #ddd;
  color: black;
}

.wrapper {
  width: 70%;
  color: white;
}


/* you can remove this part */

.white-space {
  display: flex;
  height: 800px;
  font-size: 3rem;
  background: darkgray;
}


/* you can remove this part */
<div class="header">
  <div class="header-logo">
    <a href="#"><img class="logo" src="https://via.placeholder.com/135x55" alt="Logo" /></a>
  </div>
  <div class="header-menu">
    <a class="active" href="#">Home</a>
    <a class="active" href="#">Games</a>
    <a class="active" href="#">Web Projects</a>
    <a class="login" href="#">Login</a>
    <a href="#">Contact</a>
    <a href="#">About</a>
  </div>
</div>
<div class="wrapper">
  <!-- put your content here -->
  <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ac ut consequat semper viverra. Eget nunc scelerisque viverra mauris in aliquam sem fringilla ut.</p>
  <div class="white-space">
    <h2 style="margin: auto">White Space</h2>
  </div>
  <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ac ut consequat semper viverra. Eget nunc scelerisque viverra mauris in aliquam sem fringilla ut.</p>
  <!-- put your content here -->
</div>

Updated:
added custom height to the header

body {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: #171615;
}

.header {
  /* If you don't want the header to be sticky on scroll remove these lines */
  position: sticky;
  top: 0;
  /* If you don't want the header to be sticky on scroll remove these lines */
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  width: 100%;
  background: #171615;
}

.header-logo {
  height: 55px;
}

.logo {
  height: 100%;
  width: 135px;
  object-fit: cover;
}

.header-menu {
  display: flex;
  flex-flow: row wrap;
  height: 100px;
  align-items: center;
}

.header-menu a {
  color: #f1f1f1;
  padding: 12px;
  text-decoration: none;
  border-radius: 4px;
  margin-right: 8px;
  white-space: nowrap;
}

.header a.active {
  background: dodgerblue;
}

.login {
  background-color: dodgerblue;
}

.header-menu a:hover {
  background-color: #ddd;
  color: black;
}

.wrapper {
  width: 70%;
  color: white;
}


/* you can remove this part */

.white-space {
  display: flex;
  height: 800px;
  font-size: 3rem;
  background: darkgray;
}


/* you can remove this part */
<div class="header">
  <div class="header-logo">
    <a href="#"><img class="logo" src="https://via.placeholder.com/135x55" alt="Logo" /></a>
  </div>
  <div class="header-menu">
    <a class="active" href="#">Home</a>
    <a class="active" href="#">Games</a>
    <a class="active" href="#">Web Projects</a>
    <a class="login" href="#">Login</a>
    <a href="#">Contact</a>
    <a href="#">About</a>
  </div>
</div>
<div class="wrapper">
  <!-- put your content here -->
  <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ac ut consequat semper viverra. Eget nunc scelerisque viverra mauris in aliquam sem fringilla ut.</p>
  <div class="white-space">
    <h2 style="margin: auto">White Space</h2>
  </div>
  <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ac ut consequat semper viverra. Eget nunc scelerisque viverra mauris in aliquam sem fringilla ut.</p>
  <!-- put your content here -->
</div>

我的CSS网格在内容高度方面不正确地尺度

是伱的 2025-02-20 10:26:40

我不知道为什么您要使用XML传递参数(在不推荐使用的文本数据类型中),但看起来您只需要 for xml Path 以及XQUERY每个列名的路径

DECLARE @myXmlStr nvarchar(max) = (
    SELECT
      @EndDate AS [Params/@Date],
      @OfficeFilterBy AS [Office/@KeyId],
      @DepartmentFilterBy AS [Department/@KeyId],
      @companyFilterBy AS [company/@KeyId],
      @CustomerIdFilterBy AS [Customer/@KeyId]
    FOR XML PATH(''), ROOT('XML')
);

EXEC Report_Invoice @Xml = @myXmlStr;

I have no idea why you are using XML to pass parameters (in the deprecated text datatype no less), but it looks like you just need FOR XML PATH along with a XQuery path for each column name

DECLARE @myXmlStr nvarchar(max) = (
    SELECT
      @EndDate AS [Params/@Date],
      @OfficeFilterBy AS [Office/@KeyId],
      @DepartmentFilterBy AS [Department/@KeyId],
      @companyFilterBy AS [company/@KeyId],
      @CustomerIdFilterBy AS [Customer/@KeyId]
    FOR XML PATH(''), ROOT('XML')
);

EXEC Report_Invoice @Xml = @myXmlStr;

db<>fiddle

如何从参数中格式化SQL Server中的XML?

是伱的 2025-02-20 01:21:29

It is a known issue, which will be fixed: https://developercommunity.visualstudio.com/t/10039228.

Visual Studio更新启动形式更改

是伱的 2025-02-19 15:40:39

USESTATE可以为您提供以前的数据,然后您可以将您想这样的东西附加。

setTitle((prev)=> prev + e.target.value);

useState can get you the previous data and then you can append what you want to it like this.

setTitle((prev)=> prev + e.target.value);

如何在不清除状态数据的情况下将输入的价值推向状态?

是伱的 2025-02-19 08:51:34

如果您查看 JSDOM 似乎无法实现 POINTEREVENT

您可以解决此问题

class MockPointerEvent {}

describe("PointerEvent", () => {
  beforeEach(() => {
    global.window.PointerEvent = MockPointerEvent as any;
  });

  it("confirms pointer event", () => {
    const pointerEvent = new PointerEvent("");

    expect(pointerEvent).toBeTruthy();
  });
});

If you look at this issue, you can see that jsdom appears to not implement PointerEvent

You can work around this this though

class MockPointerEvent {}

describe("PointerEvent", () => {
  beforeEach(() => {
    global.window.PointerEvent = MockPointerEvent as any;
  });

  it("confirms pointer event", () => {
    const pointerEvent = new PointerEvent("");

    expect(pointerEvent).toBeTruthy();
  });
});

如何用玩笑代替Pointerevent? (未定义pointerevent)

是伱的 2025-02-19 05:12:09

您可以编写自己的洗牌功能,但要小心进行均匀的分布。这是 durstenfeld shuffle shuffle algorithm:

def shuffle(arr):
    for i in range(len(arr) - 1, 0, -1):
        j = np.random.randint(0, i + 1)
        arr[[i, j]] = arr[[j, i]] # Swap 

然后在您的代码中:

Deck2 = np.copy(Deck1)
shuffle(Deck2)

You can write your own shuffle function, but be careful to have a homogeneous distribution. Here is an implementation of the Durstenfeld shuffle algorithm:

def shuffle(arr):
    for i in range(len(arr) - 1, 0, -1):
        j = np.random.randint(0, i + 1)
        arr[[i, j]] = arr[[j, i]] # Swap 

Then in your code:

Deck2 = np.copy(Deck1)
shuffle(Deck2)

从另一个数组创建一个随机数组

是伱的 2025-02-18 18:49:19

使用领先图标并放置图像代替图标

OutlinedTextField(
           value = username.value,
           onValueChange = { newText ->
               username.value = newText
           },
           label = { Text(text = "Username") },
           leadingIcon = { 
            Image(
                            modifier = Modifier.size(35.dp),
                            painter = painterResource(R.drawable.facebook),
                            contentDescription = "facebook icon",
                        )

    },
           modifier = Modifier
               .fillMaxWidth(180F)
       )

Use leading Icon and put Image instead of Icon

OutlinedTextField(
           value = username.value,
           onValueChange = { newText ->
               username.value = newText
           },
           label = { Text(text = "Username") },
           leadingIcon = { 
            Image(
                            modifier = Modifier.size(35.dp),
                            painter = painterResource(R.drawable.facebook),
                            contentDescription = "facebook icon",
                        )

    },
           modifier = Modifier
               .fillMaxWidth(180F)
       )

如何在JetPack组成的Textfield旁边添加可绘制的可绘制的添加?

是伱的 2025-02-18 17:16:11

我得到了解决方案,刚刚对此 libmicrosoft.cognitiveservices.speech.core.so 库中库中/usr/lib 文件夹和修改 binding.gyp 文件。正常工作。

{
  "targets": [
    {
      "target_name": "transcription",
      "sources": ["src/streamingAsr.cpp"],
      "cflags": ["-Wall", "-std=c++17"],
      "cflags!": ["-fno-exceptions"],
      "cflags_cc!": ["-fno-exceptions"],
      "include_dirs": [
        "/home/delaplexTransation/speechsdk/include/cxx_api",
        "/home/delaplexTransation/speechsdk/include/c_api",
        "<!(node -e \"require('nan')\")",
        "<!(node -e \"require('streaming-worker-sdk')\")"
      ],
      "libraries": [
        "/usr/lib/libMicrosoft.CognitiveServices.Speech.core.so"
      ]
    }
  ]
}

I got the solution, Just coped this libMicrosoft.CognitiveServices.Speech.core.so library into /usr/lib folder and modified binding.gyp file. it is working fine.

{
  "targets": [
    {
      "target_name": "transcription",
      "sources": ["src/streamingAsr.cpp"],
      "cflags": ["-Wall", "-std=c++17"],
      "cflags!": ["-fno-exceptions"],
      "cflags_cc!": ["-fno-exceptions"],
      "include_dirs": [
        "/home/delaplexTransation/speechsdk/include/cxx_api",
        "/home/delaplexTransation/speechsdk/include/c_api",
        "<!(node -e \"require('nan')\")",
        "<!(node -e \"require('streaming-worker-sdk')\")"
      ],
      "libraries": [
        "/usr/lib/libMicrosoft.CognitiveServices.Speech.core.so"
      ]
    }
  ]
}

nodejs/c&#x2b;&#x2b; addon-获取错误&quot'undectined符号:speech_config_from_subscription&quot;来自Ubuntu上的Microsoft Speech SDK 18.4服务器

是伱的 2025-02-18 06:52:35

当Array.fill通过一个对象时,它将复制引用并用对该对象的引用填充数组。

您可以使用以下内容:

 products = Array.from({length:7},()=> ({'keepOpen':false}))

When Array.fill gets passed an object, it will copy the reference and fill the array with references to that object.

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/fill#using_fill

You could instead use something like:

 products = Array.from({length:7},()=> ({'keepOpen':false}))

更新一系列对象内的对象属性

是伱的 2025-02-18 04:01:14

尝试:

df = df.pivot_table(index="A", columns="B", values="C", aggfunc=list)
df = df.explode(df.columns.to_list()).reset_index()
df.columns.name = None
print(df)

打印:

    A    1    2    3
0  A1  1.3  1.4  1.3
1  A1  1.0  2.7  2.4
2  A2  1.7  1.6  1.5
3  A2  1.6  1.7  1.2

Try:

df = df.pivot_table(index="A", columns="B", values="C", aggfunc=list)
df = df.explode(df.columns.to_list()).reset_index()
df.columns.name = None
print(df)

Prints:

    A    1    2    3
0  A1  1.3  1.4  1.3
1  A1  1.0  2.7  2.4
2  A2  1.7  1.6  1.5
3  A2  1.6  1.7  1.2

熊猫函数以基于单列创建多个列

是伱的 2025-02-18 02:24:18

VS代码将Open 文件夹作为工作区。因此,请在VS代码中打开整个文件夹,而不仅仅是 .py 文件,那么VS代码将无法找到您的工作区,并且默认情况下将使用计算机用户目录作为工作区。因此,自然而然的是,您会发现错误的脚本路径。

示例:

作为工作区打开文件夹:

< img src =“ https://i.sstatic.net/lcfra.png” alt =“在此处输入图像说明”>

只需打开一个.py文件:

vs代码打开folde:

”在此处输入图像说明”

VS Code takes the open folder as the workspace. So please open the whole folder in VS Code, not just a .py file, then VS Code will not be able to find your workspace and will use the computer user directory as the workspace by default. So naturally you get the wrong script path.

Example:

Open the folder as a workspace:

enter image description here

Just open a .py file:

enter image description here

VS Code open folde:

enter image description here

Python文件总是在C:/用户/用户中运行,而不是在工作目录中运行

是伱的 2025-02-18 01:55:11

请求对象在整个会话中共享。设置 request.session ['name'] ='srj'应该允许您在另一个视图中捕获以请求对象为参数的名称,例如,在设置 之后您可以在另一个视图中检查它:

if request.session['name'] == 'SRJ':
    pass

您还可以删除类似的会话变量: del request.session ['name']

django和drf没有区别,他们都使用相同的django请求对象。这就是我可以从问题中给您的一切,让我知道这是否不是您的问题。

The request object is shared throughout the session. Setting request.session['name'] = 'SRJ' should allow you to grab the name in another view that has the request object as parameter, for example after setting name you can check it in another view with:

if request.session['name'] == 'SRJ':
    pass

You can also delete the session variable like this: del request.session['name']

Django and DRF do not make a difference, they both use the same django request object. This is all I can give you from the question, let me know if this is not your problem.

在Django REST框架中设置会话变量

是伱的 2025-02-17 22:34:01

这是您在订购ID时可以尝试的另一种选择,

%dw 2.0
output application/json
---
payload groupBy ((item, index) -> item.Order.Id) 
    mapObject ((value, key, index) ->  
            {"Id": value.Order.Id[0], 
            "Order Name": value.Order.Account_Name__c[0],
            "Line Items": value map ({
                                Id: $.Id, 
                                ItemNumber: $.OrderItemNumber,
                                Name: $.Product2.Name
 
                            })}
)

”在此处输入图像描述”

Here is one more option that you can try when ordered Id's are not the same

%dw 2.0
output application/json
---
payload groupBy ((item, index) -> item.Order.Id) 
    mapObject ((value, key, index) ->  
            {"Id": value.Order.Id[0], 
            "Order Name": value.Order.Account_Name__c[0],
            "Line Items": value map ({
                                Id: $.Id, 
                                ItemNumber: $.OrderItemNumber,
                                Name: $.Product2.Name
 
                            })}
)

enter image description here

DataWeave未贴图的映射

是伱的 2025-02-17 22:23:51

您可以将对象存储在a 价格。存储独特的价格后,将地图的迭代器成一个新数组以获得结果。

const offersStep = [
     {a: 1, price: 67.10},
     {a: 3, price: 88.20},
     {a: 5, price: 88.20}, 
     {a: 7, price: 57.10},
     {a: 13, price: 57.10},
     {a: 15, price: 57.10},
     {a: 29, price: 57.10},
     {a: 30, price: 57.10},
];

function filterOffers(offers) {
  let offersByPrice = new Map();
  for (let offer of offers) {
    if (!offersByPrice.has(offer.price)) {
      // Store the offer
      offersByPrice.set(offer.price, offer);
    }
  }
  
  return [...offersByPrice.values()];
}

console.log(filterOffers(offersStep));

You can store the objects in a Map keyed off its price. After you have stored unique prices, spread the values() iterator of the Map into a new array to get your result.

const offersStep = [
     {a: 1, price: 67.10},
     {a: 3, price: 88.20},
     {a: 5, price: 88.20}, 
     {a: 7, price: 57.10},
     {a: 13, price: 57.10},
     {a: 15, price: 57.10},
     {a: 29, price: 57.10},
     {a: 30, price: 57.10},
];

function filterOffers(offers) {
  let offersByPrice = new Map();
  for (let offer of offers) {
    if (!offersByPrice.has(offer.price)) {
      // Store the offer
      offersByPrice.set(offer.price, offer);
    }
  }
  
  return [...offersByPrice.values()];
}

console.log(filterOffers(offersStep));

如何过滤每个匹配的项目仅存储一次的对象数组

更多

推荐作者

櫻之舞

文章 0 评论 0

弥枳

文章 0 评论 0

m2429

文章 0 评论 0

野却迷人

文章 0 评论 0

我怀念的。

文章 0 评论 0

更多

友情链接

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