围归者

文章 评论 浏览 28

围归者 2025-02-21 02:14:45

使用VH& CSS中图像的大众单元。

img{
width:50vh;
height:50vh;
/* your css*/
}

有关CSS

Use vh & vw units for your Image in css.

img{
width:50vh;
height:50vh;
/* your css*/
}

more details on css units

根据页面刻度调整图像大小

围归者 2025-02-20 23:06:42

假设您放入按钮和一个文本框来显示计数?

说,此标记:

        <asp:Label ID="Label1" runat="server" Text="Rows in database = "></asp:Label>
        <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
        <br />
        <asp:Button ID="Button1" runat="server" Text="Show table row count" OnClick="Button1_Click" />

和此代码:

    protected void Button1_Click(object sender, EventArgs e)
    {
        using (SqlConnection conn = new SqlConnection(Properties.Settings.Default.TEST4))
        {
            using (SqlCommand cmdSQL = new SqlCommand("SELECT COUNT(*) FROM tblHotelsA", conn))
            {
                conn.Open();
                int? RowCount = (int?)cmdSQL.ExecuteScalar();
                TextBox1.Text = RowCount.ToString();
            }
        }
        
    }

我们得到了:

​实际上是一样的 - 您在该表上进行计数(*) - 获取值,然后将其推入文本框,或在代码中使用或做任何您想做的事。

Assuming you drop in a button, and a text box to display the count?

Say, this markup:

        <asp:Label ID="Label1" runat="server" Text="Rows in database = "></asp:Label>
        <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
        <br />
        <asp:Button ID="Button1" runat="server" Text="Show table row count" OnClick="Button1_Click" />

And this code:

    protected void Button1_Click(object sender, EventArgs e)
    {
        using (SqlConnection conn = new SqlConnection(Properties.Settings.Default.TEST4))
        {
            using (SqlCommand cmdSQL = new SqlCommand("SELECT COUNT(*) FROM tblHotelsA", conn))
            {
                conn.Open();
                int? RowCount = (int?)cmdSQL.ExecuteScalar();
                TextBox1.Text = RowCount.ToString();
            }
        }
        
    }

And we get this:

enter image description here

Now, above is web forms, but the idea is really the same - you do a count(*) on that table - get the value and then shove it into a text box, or use in code, or do whatever you want.

在ASP.NET中显示数据库中的行数

围归者 2025-02-20 14:54:40

您可以在这种非常特殊的情况下做到这一点,但是Jmespath并不是这样做的最佳工具, JQ 可能是一个更好的选择。

从他们各自的网站中可以读取的内容:

,如果您正在寻找一个JSON处理器,您可能会得到 jq


也就是说,有一个 Merge 函数实现这一目标。
此处提出的解决方案中的警告是,由于 People 是一个数组,它将添加键/值对“ field1”:“ value1” 每个该数组的元素

给定查询:

{
  "people": people[].merge(
    @, {
      "data": merge(
        data, {"field1": 'field1'}
      )
    }
  )
}

在您的示例中,您会得到

{
  "people": [
    {
      "age": 20,
      "other": "foo.aaa",
      "name": "Bob",
      "data": {
        "field": "value",
        "field1": "field1"
      }
    }
  ]
}

You can do it in this very special case, but JMESPath is not really the best tool to do this, could possibly be a better suited alternative.

From what one can read in their respective site:

  • is a query language for JSON. You can extract and transform elements from a JSON document. reference
  • while is a lightweight and flexible command-line JSON processor. reference

So clearly, if you are looking for a JSON processor, you will probably be best served by .


This said, there is a merge function that you can use to achieve this.
The caveat in the proposed solution here is that, since people is an array, it will add the key/value pair "field1": "value1" to each element of that array.

Given the query:

{
  "people": people[].merge(
    @, {
      "data": merge(
        data, {"field1": 'field1'}
      )
    }
  )
}

On your example JSON, you will get

{
  "people": [
    {
      "age": 20,
      "other": "foo.aaa",
      "name": "Bob",
      "data": {
        "field": "value",
        "field1": "field1"
      }
    }
  ]
}

使用jmespath更新JSON对象

围归者 2025-02-20 10:53:48

请参阅调用实例方法的呼叫者实例(对象),您不能在类中使用此方法,并参考声明的变量 f1

您可以测试是否完成任务,然后打印结果,否则打印另一个消息,3秒钟以确保将完成:例如:

f1.thenRun(() -> {
        try {
            Thread.currentThread().sleep(3000);
        } catch (InterruptedException e1) {
            // TODO Auto-generated catch block
            e1.printStackTrace();
        }

        try {
            if (f1.isDone())
                System.out.println(f1.get());
            else
                System.out.println("Not Done");
        } catch (InterruptedException | ExecutionException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    });

this refer to the caller instance(object) who call the instance method, you cannot use this inside a class and refer to the declared variable f1.

You can test if the task is done then print the result else print another message, giving it 3 seconds to be sure that it will be done for example :

f1.thenRun(() -> {
        try {
            Thread.currentThread().sleep(3000);
        } catch (InterruptedException e1) {
            // TODO Auto-generated catch block
            e1.printStackTrace();
        }

        try {
            if (f1.isDone())
                System.out.println(f1.get());
            else
                System.out.println("Not Done");
        } catch (InterruptedException | ExecutionException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    });

Java Future可以在其其他成员中称其get()功能吗?

围归者 2025-02-19 22:53:26

使用此代码:

window.location.href === `${res.data.storeRegistrationLink}`

Use this code:

window.location.href === `${res.data.storeRegistrationLink}`

导航到React JS中的外部链接

围归者 2025-02-19 20:28:45

如果您不想使用查询来选择省= null的结果,则还可以在($ data-&gt; province == null){...}中检查foreach循环,并且仅在此之前显示显示。
希望这对您有意义。

if you don't want to use the query to select the results where province = NULL, you could also check in the foreach loop if($data->province==NULL){...} and only display if that's true.
Hope that makes sense to you.

如果计数为0 mysql |拉拉维尔

围归者 2025-02-19 19:18:44

如果您要删除“ -trim”将删除的内容,但仅从图像的底部边缘中删除,则该命令应为您提供结果...

convert input.png -background none -set page %[@] \
   -set option:distort:viewport %[w]x%[fx:page.y+page.height] \
   +repage -distort SRT 0 result.png                

首先设置一些包含“ - ”结果的变量。修剪操作,但实际上没有删除任何东西。然后,它使用这些变量来计算输出视口的三个后尺寸。然后,它使用no-op“ -distort”有效地将图像裁剪到计算的输出尺寸上,仅将多余的透明像素朝向底部。

If you're trying to remove what a "-trim" would remove, but only from the bottom edge of an image, this command should give you that result...

convert input.png -background none -set page %[@] \
   -set option:distort:viewport %[w]x%[fx:page.y+page.height] \
   +repage -distort SRT 0 result.png                

It starts by setting some variables that contain the results of a "-trim" operation, but without actually removing anything. Then it uses those variables to calculate the after-trim dimensions for the output viewport. Then it uses a no-op "-distort" to effectively crop the image to the calculated output dimensions, removing only the excess transparent pixels toward the bottom.

ImageMagick从透明png底部修剪底部

围归者 2025-02-19 03:35:36

您可以使用以下代码:
此功能是您输入的一般处理程序,只要每个输入元素具有与对象属性相同的名称值,

 const handleChanges = ({ currentTarget }) => {
    const info = { ...data };
    info[currentTarget.name] = currentTarget.value;
    setData(info);
  };

就必须使用此功能来处理OnChange事件。
然后,您可以像这样在handlesubmit中调用axios.post:

const {data: post} = await axios.post(YourUrl, data}

然后您可以使用帖子结果,例如将其推入将更新UI的帖子状态。

You can use the following code :
This function is general handler for your inputs, as long as each input element have the same value of name as your object properties

 const handleChanges = ({ currentTarget }) => {
    const info = { ...data };
    info[currentTarget.name] = currentTarget.value;
    setData(info);
  };

You must use this function to handle the onChange event.
Then you can call axios.post inside your handleSubmit like this :

const {data: post} = await axios.post(YourUrl, data}

Then you can use your post result, for example to push it in a posts state that will update your UI.

如何使用Axios将REACT向(本地)DB.JSON文件形成数据?

围归者 2025-02-18 06:58:48

当您拥有AZ PowerShell时,为什么要维护密码文件或手动输入存储密钥。只需使用AZ Powershell登录,设置订阅并享受!

$ResourceGroupName = "YOURRESOURCEGROUPNAME"
$StorageAccountName = "YOURSTORAGEACCOUNTNAME"
$ContainerName = "YOURCONTAINERNAME"
$LocalPath = "D:\Temp"
        
Write-Output 'Downloading Content from Azure blob to local...'
$storageKey = (Get-AzStorageAccountKey -ResourceGroupName $ResourceGroupName -AccountName $StorageAccountName).value[0]
$storageContext = New-AzStorageContext -StorageAccountName $StorageAccountName -StorageAccountKey $storageKey
$blobs = Get-AzStorageBlob -Container $ContainerName -Context $storageContext
foreach($blob in $blobs)
{
        Get-AzStorageBlobContent -Container $ContainerName -Context $storageContext -Force -Destination $LocalPath -Blob $blob.Name
}
Write-Output 'Content Downloaded Successfully !!!'

Why would you maintain the password files or enter storage key manually when you have az powershell. Just login using az powershell, set the subscription and enjoy !

$ResourceGroupName = "YOURRESOURCEGROUPNAME"
$StorageAccountName = "YOURSTORAGEACCOUNTNAME"
$ContainerName = "YOURCONTAINERNAME"
$LocalPath = "D:\Temp"
        
Write-Output 'Downloading Content from Azure blob to local...'
$storageKey = (Get-AzStorageAccountKey -ResourceGroupName $ResourceGroupName -AccountName $StorageAccountName).value[0]
$storageContext = New-AzStorageContext -StorageAccountName $StorageAccountName -StorageAccountKey $storageKey
$blobs = Get-AzStorageBlob -Container $ContainerName -Context $storageContext
foreach($blob in $blobs)
{
        Get-AzStorageBlobContent -Container $ContainerName -Context $storageContext -Force -Destination $LocalPath -Blob $blob.Name
}
Write-Output 'Content Downloaded Successfully !!!'

PowerShell脚本中的Azure存储帐户密钥加密

围归者 2025-02-17 05:39:19

怎么样:

library(ggplot2)

N = 10000
totalinc_02 <- rnorm(N)
totalinc_04 <- rnorm(N)

remained_agri <- rbinom(n = N, size = 1, prob = 0.05)
reallocated_manu <- rbinom(n = N, size = 1, prob = 0.05)

inc0204_p_agri <- data.frame(totalinc_02 , totalinc_04 , remained_agri, reallocated_manu)

ggplot(inc0204_p_agri, aes(log(totalinc_02), fill = factor(remained_agri))) +
  geom_density(alpha = 0.2) +
  labs(x = "(log) Annual Income in 2001",
       y = "Density") +
  scale_fill_discrete(type = c("blue", "red"), 
                      name="",
                      breaks=c("1", "0"),
                      labels=c("Will not reallocate", "Will reallocate"))
#> Warning in log(totalinc_02): NaNs produced

#> Warning in log(totalinc_02): NaNs produced
#> Warning: Removed 5022 rows containing non-finite values (stat_density).

“”

ggplot(inc0204_p_agri, aes(log(totalinc_04), fill = factor(reallocated_manu))) +
  geom_density(alpha = 0.2) +
  labs(x = "(log) Annual Income in 2003",
       y = "Density") +
  scale_fill_discrete(type = c("green", "blue"),
                      name="",
                      breaks=c("0", "1"),
                      labels=c("Did not reallocate", "Reallocated"))
#> Warning in log(totalinc_04): NaNs produced
#> Warning in log(totalinc_04): NaNs produced
#> Warning: Removed 5021 rows containing non-finite values (stat_density).

在2022-06-24创建的

How about this:

library(ggplot2)

N = 10000
totalinc_02 <- rnorm(N)
totalinc_04 <- rnorm(N)

remained_agri <- rbinom(n = N, size = 1, prob = 0.05)
reallocated_manu <- rbinom(n = N, size = 1, prob = 0.05)

inc0204_p_agri <- data.frame(totalinc_02 , totalinc_04 , remained_agri, reallocated_manu)

ggplot(inc0204_p_agri, aes(log(totalinc_02), fill = factor(remained_agri))) +
  geom_density(alpha = 0.2) +
  labs(x = "(log) Annual Income in 2001",
       y = "Density") +
  scale_fill_discrete(type = c("blue", "red"), 
                      name="",
                      breaks=c("1", "0"),
                      labels=c("Will not reallocate", "Will reallocate"))
#> Warning in log(totalinc_02): NaNs produced

#> Warning in log(totalinc_02): NaNs produced
#> Warning: Removed 5022 rows containing non-finite values (stat_density).

ggplot(inc0204_p_agri, aes(log(totalinc_04), fill = factor(reallocated_manu))) +
  geom_density(alpha = 0.2) +
  labs(x = "(log) Annual Income in 2003",
       y = "Density") +
  scale_fill_discrete(type = c("green", "blue"),
                      name="",
                      breaks=c("0", "1"),
                      labels=c("Did not reallocate", "Reallocated"))
#> Warning in log(totalinc_04): NaNs produced
#> Warning in log(totalinc_04): NaNs produced
#> Warning: Removed 5021 rows containing non-finite values (stat_density).

Created on 2022-06-24 by the reprex package (v2.0.1)

是否有一种方法可以改变GGPLOT上内核密度估算的曲线下的区域的颜色?

围归者 2025-02-16 21:51:36

错误说:
The calling method's class, org.springframework.cloud.bootstrap.BootstrapApplicationListener, was loaded from the following location:

jar:file:/Users/patangav/.m2/repository/org/springframework/cloud/spring-cloud-context /1.1.0.release/spring-cloud-context-context-1.1.0.release.jar!/org/springframework/cloud/bootstrap/bootstrap/bootstrap/bootstrapapplicationlistener.class.class

= =&gt; spring-cloud-context/1.1.0.Release

您的pom.xml参考:

<artifactId>spring-cloud-consul-dependencies</artifactId>
<version>3.1.1</version>

因此,您应该使用最新的spring-cloud-context版本:
https://mvnrepository.com/artifact/org.springframework.cloud/ spring-cloud-context

您的pom.xml看起来一致。
尝试清洁 /重建,如果可能的话,请删除IDE缓存。

如果仍然发生错误,请使用MVN依赖关系:TREE命令找出为什么仍在使用Spring-Cloud-Context库的1.1.0版本。

The error says :
The calling method's class, org.springframework.cloud.bootstrap.BootstrapApplicationListener, was loaded from the following location:

jar:file:/Users/patangav/.m2/repository/org/springframework/cloud/spring-cloud-context/1.1.0.RELEASE/spring-cloud-context-1.1.0.RELEASE.jar!/org/springframework/cloud/bootstrap/BootstrapApplicationListener.class

=> spring-cloud-context/1.1.0.RELEASE

Your pom.xml references :

<artifactId>spring-cloud-consul-dependencies</artifactId>
<version>3.1.1</version>

So you should be using the latest spring-cloud-context version :
https://mvnrepository.com/artifact/org.springframework.cloud/spring-cloud-context

Your pom.xml looks consistent.
Try to clean / rebuild, delete IDE cache if possible.

If the error still occurs, use the mvn dependency:tree command to find out why you are still using a 1.1.0 version of the spring-cloud-context library.

正确的class路径,以便包含类的兼容版本BootstrapapplicationListener和SpringApplicationBuilder

围归者 2025-02-16 21:00:17

我建议使用 pandas 。此软件包具有 to_excel 数据的方法。看看

I would recommend using the pandas. This package has a to_excel method for data. Take a look at the documentation.

如何在Python中的Excel文件中写入日期

围归者 2025-02-16 13:29:31

您应该能够用替换

require('child_process').execSync(`echo hello 
world 
to
all > /home/kali/Desktop/output`.replace(/(\r\n|\n|\r)/gm, ``));

等同于运行

require('child_process').execSync(`echo hello world to all > /home/kali/Desktop/output`);

you should be able to remove the line breaks with a replace

require('child_process').execSync(`echo hello 
world 
to
all > /home/kali/Desktop/output`.replace(/(\r\n|\n|\r)/gm, ``));

which would be equivalent to running

require('child_process').execSync(`echo hello world to all > /home/kali/Desktop/output`);

字符串传递给execsync有新行,我想将字符串作为单个命令执行

围归者 2025-02-16 07:07:41

我能够使用这个

df2 = df1.groupby('category')['Quantity'].sum().reset_index()
df_con = pd.concat([df1, df2]).fillna('Total').sort_values('category', ascending = False)
df_con.set_index(['category', 'species'])

I was able to get it using this

df2 = df1.groupby('category')['Quantity'].sum().reset_index()
df_con = pd.concat([df1, df2]).fillna('Total').sort_values('category', ascending = False)
df_con.set_index(['category', 'species'])

Pandas:Concat在Groupby DataFrame上的总和

围归者 2025-02-16 06:23:54

server.port 属性仅控制Spring Boot应用程序中嵌入式服务器的侦听端口(Tomcat,Jetty等)。

在部署期间指定了独立应用程序服务器中的应用程序端口。在Wildfly上执行此操作的最简单方法是通过 wildfly-maven-plugin

<build>
    <plugins>
        <!-- ... -->
        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
        </plugin>
        <plugin>
            <groupId>org.wildfly.plugins</groupId>
            <artifactId>wildfly-maven-plugin</artifactId>
            <version>2.1.0.Final</version>
            <executions>
                <execution>
                    <phase>install</phase>
                    <goals>
                        <goal>deploy</goal>
                    </goals>
                </execution>
            </executions>
            <configuration>
                <filename>${project.build.finalName}.war</filename>
                <hostname>127.0.0.1</hostname>
                <port>8093</port>       <!-- <<<<<<<< -->
                <username>my-wildfly-user</username>
                <password>my-wildfly-password</password>
            </configuration>
        </plugin>
        <!-- ... -->
    </plugins>
</build>

The server.port property only controls the listening port of an embedded server in a Spring boot app (tomcat, jetty, etc.).

The app's port in a standalone application server is specified during the deployment. The easiest way to do this on Wildfly is via the wildfly-maven-plugin (https://docs.jboss.org/wildfly/plugins/maven/latest/deploy-mojo.html):

<build>
    <plugins>
        <!-- ... -->
        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
        </plugin>
        <plugin>
            <groupId>org.wildfly.plugins</groupId>
            <artifactId>wildfly-maven-plugin</artifactId>
            <version>2.1.0.Final</version>
            <executions>
                <execution>
                    <phase>install</phase>
                    <goals>
                        <goal>deploy</goal>
                    </goals>
                </execution>
            </executions>
            <configuration>
                <filename>${project.build.finalName}.war</filename>
                <hostname>127.0.0.1</hostname>
                <port>8093</port>       <!-- <<<<<<<< -->
                <username>my-wildfly-user</username>
                <password>my-wildfly-password</password>
            </configuration>
        </plugin>
        <!-- ... -->
    </plugins>
</build>

更改Wildfly上部署的春季项目的港口

更多

推荐作者

櫻之舞

文章 0 评论 0

弥枳

文章 0 评论 0

m2429

文章 0 评论 0

野却迷人

文章 0 评论 0

我怀念的。

文章 0 评论 0

更多

友情链接

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