謌踐踏愛綪

文章 评论 浏览 28

謌踐踏愛綪 2025-02-20 16:19:56

如果wkorderlist.listindex<> -1 未测试列表框是否如您所建议的(在评论中)。它测试列表中是否选择了某些内容。

要测试不空,请使用

If Me.WkOrderList.ListCount > 0

If WkOrderList.ListIndex <> -1 doesn't test if the list box is empty as you suggest you expect (in a comment). It tests if something is selected in the list.

To test for not empty, use

If Me.WkOrderList.ListCount > 0

将列表框数据提交给工作表

謌踐踏愛綪 2025-02-20 11:56:06

它不会改变时间。 timestamp date 没有时区的概念,它们代表了自时代以来的时间(1970-01-01-01T00:00:00 Z)。

另一方面,他们的 .toString()方法有一个不良习惯,即在生成字符串表示时应用JVM的默认时区。我建议远离这些课程,而是使用 Java.Time ,现代Java DateTime API,自Java 8以来可用。

It does not change the time. Timestamp and Date don't have a concept of a timezone, they represent an instant of time since the Epoch(1970-01-01T00:00:00Z).

Their .toString() methods on the other hand, have the bad habit of applying the default timezone of the JVM, when generating the string representation. I would advise to stay away from those classes, and instead use java.time, the modern java datetime API, it's available since java 8.

与Java的UTC的时间戳约会

謌踐踏愛綪 2025-02-19 10:45:56

更新答案

解决方案1 ​​多亏了@Charlieface(问题是使用1或1,2,3在该条款中)

 SELECT h.uID, h.zipcode, h.saleyear, COUNT(c.IncidentID) AS Crime Occurrences At Zip
   FROM Housing h
   INNER JOIN Crime_Reports c
            ON h.zipcode = c.zipcode
            AND h.saleyear = c.occurredyear
 GROUP BY h.uID, h.zipcode, h.saleyear
 ORDER BY h.uID, h.zipcode, h.saleyear

解决方案2 多亏了 @艾登或

WITH CrimesCTE AS (
    SELECT COUNT(IncidentID) AS CrimeOccurrencesAtZip, occurredyear, zipcode 
    FROM Crime_Reports
    GROUP BY occurredyear, zipcode
)
    
SELECT * 
FROM 
    (SELECT * FROM Housing) h
    LEFT JOIN 
    (SELECT CrimeOccurrencesAtZip, occurredyear, zipcode FROM CrimesCTE) c
        ON h.zipcode = c.zipcode 
        AND h.saleyear = c.occurredyear

UPDATE ANSWERS

SOLUTION 1 Thanks to @Charlieface (The problem was using 1 or 1,2,3 in BY Clauses)

 SELECT h.uID, h.zipcode, h.saleyear, COUNT(c.IncidentID) AS Crime Occurrences At Zip
   FROM Housing h
   INNER JOIN Crime_Reports c
            ON h.zipcode = c.zipcode
            AND h.saleyear = c.occurredyear
 GROUP BY h.uID, h.zipcode, h.saleyear
 ORDER BY h.uID, h.zipcode, h.saleyear

SOLUTION 2 Thanks to @Aiden Or

WITH CrimesCTE AS (
    SELECT COUNT(IncidentID) AS CrimeOccurrencesAtZip, occurredyear, zipcode 
    FROM Crime_Reports
    GROUP BY occurredyear, zipcode
)
    
SELECT * 
FROM 
    (SELECT * FROM Housing) h
    LEFT JOIN 
    (SELECT CrimeOccurrencesAtZip, occurredyear, zipcode FROM CrimesCTE) c
        ON h.zipcode = c.zipcode 
        AND h.saleyear = c.occurredyear

SQL Server:加入两个表和最后一列计数总计(按​​年份,zip)

謌踐踏愛綪 2025-02-19 08:27:24

它之所以没有单击 6链接之后,单击Accion Poncome 是因为我们指定要单击表数据行 //*[@ID =“ miventanacontenido”]/div [2]/table/tbody/tr [1]/td 而不是 锚定链接 IE //*[@ID =“ Miventanacontenido”]/div [2]/table/tbody/tbody/tr [1]/td/a

您的解决方案看起来像

driver = webdriver.Chrome()  
driver.get('https://aplicaciones007.jne.gob.pe/srop_publico/Consulta/PadronAfiliado#') 
driver.maximize_window()
wait =WebDriverWait(driver, 5) 
wait.until(
EC.presence_of_element_located((By.XPATH, "//div[text()='ACCION POPULAR']"))
).click()
wait.until(EC.presence_of_element_located((By.XPATH, "//table[@class='table table-striped table-bordered']/descendant::a")))
list = driver.find_elements(By.XPATH, "//table[@class='table table-striped table-bordered']/descendant::a") 
for file in list:
 print(file.text)
 file.click()

The reason it is not clicking on the 6 links after clicking on ACCION POPULAR is because we are specifying to click on the table data row //*[@id="MiVentanaContenido"]/div[2]/table/tbody/tr[1]/td instead of the anchor link present in the row i.e //*[@id="MiVentanaContenido"]/div[2]/table/tbody/tr[1]/td/a

Your solution would look like

driver = webdriver.Chrome()  
driver.get('https://aplicaciones007.jne.gob.pe/srop_publico/Consulta/PadronAfiliado#') 
driver.maximize_window()
wait =WebDriverWait(driver, 5) 
wait.until(
EC.presence_of_element_located((By.XPATH, "//div[text()='ACCION POPULAR']"))
).click()
wait.until(EC.presence_of_element_located((By.XPATH, "//table[@class='table table-striped table-bordered']/descendant::a")))
list = driver.find_elements(By.XPATH, "//table[@class='table table-striped table-bordered']/descendant::a") 
for file in list:
 print(file.text)
 file.click()

下载使用Selenium在内部窗口中打开的文件

謌踐踏愛綪 2025-02-19 05:47:04

如果 lst1 lst2 共享相同的x值( lst0 ),则可以使用简单的数学来完成:只需获取每个斜坡和偏移行段( m lst1 vs. lst0 ,以及 k lst2 vs lst0 分别为 lst2 )。通过等于两个段方程,您可以获得 x 交叉点的坐标( xs ),然后从 m n y 坐标:

import pandas as pd
import numpy as np

lst0 = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]
lst1 = [2,4,1,4,1,5,7,8,3,2,4,7,8,2,1]
lst2 = [9,1,3,7,8,2,0,1,2,5,9,3,5,2,6]
data = {"index":lst0,
        "list1":lst1,
        "list2":lst2}
df = pd.DataFrame(data)

x = df['index'].to_numpy()
y = df.list1.to_numpy()
z = df.list2.to_numpy()

# slopes and offsets lst1 vs lst0
m = np.diff(y)/np.diff(x)
n = y[1:] - m * x[1:]

# slopes and offsets lst2 vs lst0
k = np.diff(z)/np.diff(x)
l = z[1:] - k * x[1:]

# intersections
with np.errstate(divide='ignore'):
    xs = (n - l) / (k - m)
    ys = m * xs + n

# only take intersections that lie in the respective segment
mask = (xs >= x[:-1]) & (xs <= x[1:])
intersections = np.unique(np.row_stack((xs[mask], ys[mask])), axis=1)

# display result
ax = df.set_index('index').plot(legend=False)
ax.plot(intersections[0], intersections[1], 'ro')

”在此处输入图像说明”

If lst1 and lst2 share the same x values (lst0), you can do it with simple maths: just get the slope and offset for each line segment (m and n for lst1 vs. lst0, and k and l for lst2 vs lst0, respectively). By equaling the two segment equations you get the x coords of the intersections (xs) and then from m and n the y coords:

import pandas as pd
import numpy as np

lst0 = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]
lst1 = [2,4,1,4,1,5,7,8,3,2,4,7,8,2,1]
lst2 = [9,1,3,7,8,2,0,1,2,5,9,3,5,2,6]
data = {"index":lst0,
        "list1":lst1,
        "list2":lst2}
df = pd.DataFrame(data)

x = df['index'].to_numpy()
y = df.list1.to_numpy()
z = df.list2.to_numpy()

# slopes and offsets lst1 vs lst0
m = np.diff(y)/np.diff(x)
n = y[1:] - m * x[1:]

# slopes and offsets lst2 vs lst0
k = np.diff(z)/np.diff(x)
l = z[1:] - k * x[1:]

# intersections
with np.errstate(divide='ignore'):
    xs = (n - l) / (k - m)
    ys = m * xs + n

# only take intersections that lie in the respective segment
mask = (xs >= x[:-1]) & (xs <= x[1:])
intersections = np.unique(np.row_stack((xs[mask], ys[mask])), axis=1)

# display result
ax = df.set_index('index').plot(legend=False)
ax.plot(intersections[0], intersections[1], 'ro')

enter image description here

如何在数据框中找到两个柱子之间的交点

謌踐踏愛綪 2025-02-19 02:55:16

您可以使用GetX库,可以相应地对其进行自定义。

 Get.snackbar(
              "Title of Snackbar",
               "Message of SnackBar",
               icon: Icon(Icons.person, color: Colors.white),
               snackPosition: SnackPosition.TOP,
                 );

You can use Getx library for it, you can customize it accordingly.

 Get.snackbar(
              "Title of Snackbar",
               "Message of SnackBar",
               icon: Icon(Icons.person, color: Colors.white),
               snackPosition: SnackPosition.TOP,
                 );

屏幕顶部的Flutter shownackbar?

謌踐踏愛綪 2025-02-19 00:44:48

切勿使用 evar()

它是的“ Nofollow Noreferrer”>,它还说:

幸运的是,有一个很好的替代方法 eval():使用函数构造函数。

因此,您可以替换 eval()这样:

let result= '';
try {
    result = Function(`"use strict";return (${document.getElementById('input').value})`)();
}
catch (error) {
    result = error;
}

它与 eval 几乎相同,除了:

在没有 eval()的功能中,该对象正在全局范围中评估,因此它是安全的

Never use eval()!

It is from MDN, and it also said:

Fortunately, there's a very good alternative to eval(): using the Function constructor.

So, you can replace eval() like this:

let result= '';
try {
    result = Function(`"use strict";return (${document.getElementById('input').value})`)();
}
catch (error) {
    result = error;
}

It's almost the same as the eval, except that:

In the function without the eval(), the object is being evaluated in the global scope, so it is safe

用于客户端JavaScript计算器的评估安全吗?

謌踐踏愛綪 2025-02-18 23:18:55

如果您检查IERROR接口,则级别是可选属性,这意味着某些错误可能不包含错误级别。要处理此类方案,请使用其他条件,或者如果要处理任何特定错误,请使用“消息”或“详细信息”。

示例:

if (error.level) {
    if (error.level >= models.TraceType.Fatal) {
        // DO SOMETHING
    }
    else if (error.level < models.TraceType.Fatal) {
        // DO SOMETHING
    }
}
else {
    if (error.detailedMessage === "Can't display the visual.. Could not render a report visual titled: undefined") {
        // DO SOMETHING
    }
}

参考:

iError接口|微软文档

If you check the IError interface, level is an optional property, it means that some error may not contain error level. to handle such scenarios use else condition, or if you want to handle any specific error use the "message" or "detailedMessage".

Example:

if (error.level) {
    if (error.level >= models.TraceType.Fatal) {
        // DO SOMETHING
    }
    else if (error.level < models.TraceType.Fatal) {
        // DO SOMETHING
    }
}
else {
    if (error.detailedMessage === "Can't display the visual.. Could not render a report visual titled: undefined") {
        // DO SOMETHING
    }
}

Reference:

IError interface | Microsoft Docs

自定义错误处理中的Power BI错误级别

謌踐踏愛綪 2025-02-18 19:17:10

尝试一下,

第一个初始化您的状态并使用有条件的操作员在身份验证的情况下, to splashscreen else else authenticate


void initState() {
    super.initState();   
    var _isAuth = user != null && user.isVerified;
    Navigator.push(
      context,
      MaterialPageRoute(
          builder: (context) => _isAuth ? SplashScreen() : Authenticate()),
    );
  }

Try this,

first initialize your state and use conditional operator if it is authenticated than go to splashScreen else authenticate .


void initState() {
    super.initState();   
    var _isAuth = user != null && user.isVerified;
    Navigator.push(
      context,
      MaterialPageRoute(
          builder: (context) => _isAuth ? SplashScreen() : Authenticate()),
    );
  }

身份验证加载时如何显示颤动的本机飞溅屏幕?

謌踐踏愛綪 2025-02-18 15:58:30

Hölscher先生在descond.python.org中解决了我的问题,
论坛,即,在等离子体中的应用程序名称之后,我不得不添加一个“%u”
应用列表设置。此“%u”参考绑定URL
称呼。

my problem was solved, by Mr. Hölscher in discuss.python.org,
forum namely, I had to add a "%u" after the app name in the plasma
app list settings. This "%u" references the binding URL at
call.

我的TKINTER应用程序应该成为一个URL转发应用程序,让我们选择浏览器以获取链接,我只是无法隔离系统URL参数

謌踐踏愛綪 2025-02-18 07:54:17

您可以使用

flow.request.headers.set_all(
    "cookie", 
    ["first cookie", "second cookie", "third cookie"]
)

You can use Headers.set_all:

flow.request.headers.set_all(
    "cookie", 
    ["first cookie", "second cookie", "third cookie"]
)

mitmproxy多个饼干标头

謌踐踏愛綪 2025-02-18 02:27:09

看看此线程 https://github.com/prettier/prettier/prettier/prettier/prettier/4870 <4870 < /a>,很好地解释了为什么这仍然是不存在的功能。

格式化者没有简单的方法来确定要保留什么以及要删除什么。

因此

  • 接受空线会崩溃(由于可读性差,仍然很糟糕)

  • 禁用此功能并自己保持空线(替代编辑器)。在我看来,这个“可以说”似乎是最简单的(最佳)选择。

Take a look on this thread https://github.com/prettier/prettier/issues/4870, it's pretty good explaining why this is still non-existing feature.

There is no simple way for formatter to determine what to keep and what to remove.

So the only practical things you can do

  • Add comments to disable formatting in certain places (which is bad idea and never work well, dev gents become annoyed with this super quickly).

  • Accept that empty lines would be collapsed (still bad, because of poor readability)

  • Disable this feature and maintain empty lines yourself (alternative editor). This one "arguably" seems to me the simplest (best) option in a long-term.

Prettier-允许HTML元素之间的线路断裂

謌踐踏愛綪 2025-02-18 02:01:31
SELECT o.*
FROM `DocumentStatusLogs` o                   
  LEFT JOIN `DocumentStatusLogs` b                   
  ON o.DocumentID = b.DocumentID AND o.DateCreated < b.DateCreated
 WHERE b.DocumentID is NULL ;

如果您只想通过DateCreated返回最近的文档订单,它将仅返回DocumentID的前1个文档

SELECT o.*
FROM `DocumentStatusLogs` o                   
  LEFT JOIN `DocumentStatusLogs` b                   
  ON o.DocumentID = b.DocumentID AND o.DateCreated < b.DateCreated
 WHERE b.DocumentID is NULL ;

If you want to return only recent document order by DateCreated, it will return only top 1 document by DocumentID

获取每个组的顶部1行

謌踐踏愛綪 2025-02-17 15:44:03

只是做:

for item in (d1,d2):
    d3.update(item)
print(d3)

Just do:

for item in (d1,d2):
    d3.update(item)
print(d3)

我尝试使用更新方法使用现有词典更新字典,但显示错误:typeError:不可用的类型:&#x27; dict&#x27;

謌踐踏愛綪 2025-02-17 15:05:57

ASP.NET Core具有内置的HTML.GetEnumSelectList()方法,我们可以使用枚举成员选择列表项目。

            <label asp-for="Type" class="control-label"></label>
            <select asp-for="Type" 
                    class="form-control" 
                    asp-items="Html.GetEnumSelectList<EnumName>()">
                <option>Select Gender</option>
            </select>

使用.net core中的枚举

ASP.NET Core has built-in Html.GetEnumSelectList() method we can use to turn enum members to select list items.

            <label asp-for="Type" class="control-label"></label>
            <select asp-for="Type" 
                    class="form-control" 
                    asp-items="Html.GetEnumSelectList<EnumName>()">
                <option>Select Gender</option>
            </select>

Using Enum in .NET Core

如何在ASP.NET Core 6身份中添加枚举属性

更多

推荐作者

櫻之舞

文章 0 评论 0

弥枳

文章 0 评论 0

m2429

文章 0 评论 0

野却迷人

文章 0 评论 0

我怀念的。

文章 0 评论 0

更多

友情链接

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