如何使多个带有 OR 的 LEFT JOIN 完全使用复合索引? (第2部分)

2024-01-12

它用于计算用户进入/离开工作场所时如何扫描指纹的系统。我不知道它的英文怎么称呼。我需要确定用户是否早上迟到,以及用户是否提前下班。

This tb_scan表包含用户扫描指纹的日期和时间。

CREATE TABLE `tb_scan` (
  `scpercode` varchar(6) DEFAULT NULL,
  `scyear` varchar(4) DEFAULT NULL,
  `scmonth` varchar(2) DEFAULT NULL,
  `scday` varchar(2) DEFAULT NULL,
  `scscantime` datetime,
  KEY `all` (`scyear`,`scmonth`,`scday`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1

它有 100,000 多行,像这样

scpercode scyear scmonth scday     scdateandtime
000001    2010      10     10      2016-01-10 08:02:00
000001    2010      10     10      2016-01-02 17:33:00
000001    2010      10     11      2016-01-11 07:48:00
000001    2010      10     11      2016-01-11 17:29:00
000002    2010      10     10      2016-01-10 17:31:00
000002    2010      10     10      2016-01-02 17:28:00
000002    2010      10     11      2016-01-11 05:35:00
000002    2010      10     11      2016-01-11 05:29:00

和这个tb_workday表包含每个日期

CREATE TABLE `tb_workday` (
  `wdpercode` varchar(6) DEFAULT NULL,
  `wdshift` varchar(1) DEFAULT NULL,
  `wddate` date DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1

它的行的日期顺序如下:

wdpercode  wdshift wddate
000001     1       2010-10-10
000001     1       2010-10-11
000001     1       2010-10-12
000001     1       2010-10-13
000002     2       2010-10-10
000002     2       2010-10-11
000002     2       2010-10-12
000002     2       2010-10-13

还有另一种tb_shift包含轮班时间的表

CREATE TABLE `tb_shift` (
  `shiftcode` varchar(1) DEFAULT NULL,
  `shiftbegin2` varchar(4) DEFAULT NULL,
  `shiftbegin` varchar(4) DEFAULT NULL,
  `shiftmid` varchar(4) DEFAULT NULL,
  `shiftend` varchar(4) DEFAULT NULL,
  `shiftend2` varchar(4) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1

shiftcode   shiftbegin2  shiftbegin  shiftmid  shiftend  shiftend2
        1     04:00:00     08:00:00  12:00:00  17:30:00  21:30:00 
        2     12:00:00     17:30:00  21:00:00  05:30:00  09:30:00

我想确定员工每天是迟到还是早下班,以及具体时间。

SELECT wdpercode,wddate,shiftbegin,shiftend,time(tlate.scscantime) wdlate,time(tearly.scscantime) wdearly
FROM tb_workday
LEFT JOIN tb_shift
  ON wdshift=shiftcode
LEFT JOIN tb_scan tlate 
  ON wdpercode=tlate.scpercode
  AND tlate.scyear=year(wddate)
  AND tlate.scmonth=month(wddate)
  AND (tlate.scday=day(wddate)
    OR tlate.scday=day(wddate)+1)
  AND tlate.scscantime>=ADDDATE(CONCAT(wddate,' ',shiftbegin),INTERVAL IF(shiftbegin2>shiftbegin,1,0) DAY)
  AND tlate.scscantime<=ADDDATE(CONCAT(wddate,' ',shiftmid),INTERVAL IF(shiftbegin2>shiftmid,1,0) DAY)
LEFT JOIN tb_scan tearly 
  ON wdpercode=tearly.scpercode
  AND tearly.scyear=year(wddate)
  AND tearly.scmonth=month(wddate)
  AND (tearly.scday=day(wddate)
    OR tearly.scday=day(wddate)+1)
  AND tearly.scscantime>ADDDATE(CONCAT(wddate,' ',shiftmid),INTERVAL IF(shiftbegin2>shiftmid,1,0) DAY)
  AND tearly.scscantime<ADDDATE(CONCAT(wddate,' ',shiftend),INTERVAL IF(shiftbegin2>shiftend,1,0) DAY)

这是输出的示例:

wdpercode wddate      shiftbegin  shiftend  wdlate    wdearly
000001    2016-01-10  08:00:00    17:30:00  08:02:00  (null)
000001    2016-01-11  08:00:00    17:30:00  (null)    17:29:00
000002    2016-01-11  17:30:00    05:30:00  17:31:00  (null)
000002    2016-01-11  17:30:00    05:30:00  (null)    05:29:00

this ADDDATE(CONCAT(wddate,' ',shiftbegin),INTERVAL IF(shiftbegin2>shiftbegin,1,0) DAY)是针对上夜班的员工,所以要加1天的轮班时间

问题是如果我为scscantime,MySQL拒绝使用它进行比较(>=,<=,>,<)。请参阅此线程为什么 MySQL 不使用索引进行大于比较? https://stackoverflow.com/questions/4691799/why-does-mysql-not-use-an-index-for-a-greater-than-comparison

正因为如此,我创建了scyear, scmonth, and scday字段并将它们组合在索引中scpercode。我必须确保它也计算在夜班工作的工人,所以我必须将其添加OR scday=day(wddate)+1健康)状况。

在我添加 OR 条件之前,EXPLAIN结果是 52 行。但是当我添加OR scday=day(wddate)+1条件下,将EXPLAIN结果变成了364行,这意味着MySQL没有使用索引的scday部分。有没有办法使用整个索引,所以EXPLAIN结果变得更高效,比如 52 行?我也尝试删除+1部分,结果也是 52。


首先,最好从你的其他人那里发布这个问题。您获得多条记录的原因是,一个人可能会根据轮班在同一天多次上下班。现在来说说如何解决这个问题。

在 MySQL 中,您可以使用“@”变量作为 select FROM 子句的一部分来进行内联变量声明和赋值。我首先是从工作日到轮班表的简单连接(并且我想我现在明白了),并带有一些@变量。

对于加入轮班的每个人,我都会预先计算轮班中间发生的位置,例如当天与第二天。此外,begin2 和 end2 似乎是可能的上班打卡与下班打卡的异常值。示例:人员 1 正在轮班 1 工作。轮班 1 对于任何给定的工作日定义为

shiftcode   shiftbegin2  shiftbegin  shiftmid  shiftend  shiftend2
        1     04:00:00     08:00:00  12:00:00  17:30:00  21:30:00 

所以,我将此解释为好像我在 6 月 28 日第 1 班工作,

June 28 @ 4am Earliest allowed clock-in time
June 28 @ 8am Actual beginning of shift
June 28 @ 12pm (afternoon) is the middle of the work day
June 28 @ 5:30pm is the end of the work day
June 28 @ 9:30pm is the max expected clock-out recognized for the shift

同样,对于第 2 班,将包含一个过夜的时间

shiftcode   shiftbegin2  shiftbegin  shiftmid  shiftend  shiftend2
        2     12:00:00     17:30:00  21:00:00  05:30:00  09:30:00

June 28 @ 12pm (afternoon) Earliest allowed clock-in time
June 28 @ 5:30pm Actual beginning of shift
June 28 @ 9pm is the middle of the shift
June 29 @ 5:30am (day roll-over) is the end of the work day 
June 29 @ 9:30am (day roll-over) is the max expected clock-out for the shift

因此,如果这一切都是正确的,我的内部查询是预先确定每个人的所有这些范围,因此无论通过下面的扫描次数如何,每个人每个工作日只会有 1 条记录。

select 
      wd.wdpercode,
      wd.wdshift,
      wd.wddate,
      s.shiftbegin,
      s.shiftend,
      s.shiftbegin2,
      s.shiftmid,
      s.shiftend2,
      @midDay := if( s.shiftbegin < s.shiftmid, wd.wddate, date_add( wd.wddate, interval 1 day )) as NewMidDay,
      @endDay := if( s.shiftbegin < s.shiftend, wd.wddate, date_add( wd.wddate, interval 1 day )) as NewEndDay,
      cast( concat(wd.wddate, ' ', s.shiftbegin2 ) as DateTime ) as EarliestClockIn,
      cast( concat(wd.wddate, ' ', s.shiftbegin ) as DateTime ) as BeginShift,
      cast( concat(@midDay, ' ', s.shiftmid ) as DateTime ) as MidShift,
      cast( concat( @endDay, ' ', s.shiftend ) as DateTime ) as EndShift,
      cast( concat( @endDay, ' ', s.shiftend2 ) as DateTime ) as MaxClockOut
   from
      ( select 
              @endDay := '', 
              @midDay := '' ) sqlvars,
      tb_workday wd
         join tb_shift s
            on wd.wdshift = s.shiftcode

@midDay 和 @endDay 的内联计算使我不必担心加入扫描的时钟表,并在考虑其他所有事情的过程中不断添加 1 天。所以,在这个查询结束时,我会得到类似的结果...... 请注意,在人员 1 正常轮班和人员 2 夜班之间,计算出的结束日期也显示了过渡日期

wdpercode  wdshift  wddate      shiftbegin  shiftend  shiftbegin2  shiftmid  shiftend2  NewMidDay   NewEndDay   EarliestClockIn   BeginShift        MidShift          EndShift          MaxClockOut
000001     1        2010-10-10  08:00       17:30     04:00        12:00     21:30      2010-10-10  2010-10-10  2010-10-10 04:00  2010-10-10 08:00  2010-10-10 12:00  2010-10-10 17:30  2010-10-10 21:30:00
000001     1        2010-10-11  08:00       17:30     04:00        12:00     21:30      2010-10-11  2010-10-11  2010-10-11 04:00  2010-10-11 08:00  2010-10-11 12:00  2010-10-11 17:30  2010-10-11 21:30:00
000001     1        2010-10-12  08:00       17:30     04:00        12:00     21:30      2010-10-12  2010-10-12  2010-10-12 04:00  2010-10-12 08:00  2010-10-12 12:00  2010-10-12 17:30  2010-10-12 21:30:00
000001     1        2010-10-13  08:00       17:30     04:00        12:00     21:30      2010-10-13  2010-10-13  2010-10-13 04:00  2010-10-13 08:00  2010-10-13 12:00  2010-10-13 17:30  2010-10-13 21:30:00

000002     2        2010-10-10  17:30       05:30     12:00        21:00     09:30      2010-10-10  2010-10-11  2010-10-10 12:00  2010-10-10 17:30  2010-10-10 21:00  2010-10-11 05:30  2010-10-11 09:30:00
000002     2        2010-10-11  17:30       05:30     12:00        21:00     09:30      2010-10-11  2010-10-12  2010-10-11 12:00  2010-10-11 17:30  2010-10-11 21:00  2010-10-12 05:30  2010-10-12 09:30:00
000002     2        2010-10-12  17:30       05:30     12:00        21:00     09:30      2010-10-12  2010-10-13  2010-10-12 12:00  2010-10-12 17:30  2010-10-12 21:00  2010-10-13 05:30  2010-10-13 09:30:00
000002     2        2010-10-13  17:30       05:30     12:00        21:00     09:30      2010-10-13  2010-10-14  2010-10-13 12:00  2010-10-13 17:30  2010-10-13 21:00  2010-10-14 05:30  2010-10-14 09:30:00

您可以从此查询中删除额外的列,但我包含了所有列,以便您可以查看/确认考虑每行和计划工作日期的值。我仍然需要的简短列表是

select 
      wd.wdpercode,
      @midDay := if( s.shiftbegin < s.shiftmid, wd.wddate, date_add( wd.wddate, interval 1 day )) as NewMidDay,
      @endDay := if( s.shiftbegin < s.shiftend, wd.wddate, date_add( wd.wddate, interval 1 day )) as NewEndDay,
      cast( concat(wd.wddate, ' ', s.shiftbegin2 ) as DateTime ) as EarliestClockIn,
      cast( concat(wd.wddate, ' ', s.shiftbegin ) as DateTime ) as BeginShift,
      cast( concat(@midDay, ' ', s.shiftmid ) as DateTime ) as MidShift,
      cast( concat( @endDay, ' ', s.shiftend ) as DateTime ) as EndShift,
      cast( concat( @endDay, ' ', s.shiftend2 ) as DateTime ) as MaxClockOut

因此,如果上述内容准确,我们现在必须根据此查询计算出的最大范围获取每个人的进出时钟,每个日期可能有多个记录

wdpercode  EarliestClockIn    MidShift          MaxClockOut
000001     2010-10-10 04:00   2010-10-10 12:00  2010-10-10 21:30:00
000002     2010-10-10 12:00   2010-10-10 21:00  2010-10-11 09:30:00

因此,在这里,我对最早上班时间和最长下班时间内的任何日期的扫描时间进行连接,并使用中班作为确定他们是否迟到或早退的基础。我为特定人员/班次的到达和离开添加了额外的 MIN() 和 MAX() 只是为了确认您的信息 做并且应该看到。

MAX( IF() ) 的目的是仅在发生时捕获晚/早状态。由于分组依据是按班次进行的,因此第一个记录(上班打卡)可能会迟到,而您需要该时间,但用于打卡下班的第二个记录不适用于中班时间,因此将为空白。类似地,用于检测提前离开班次。

select
      perPerson.wdPerCode,
      perPerson.BeginShift,
      perPerson.EndShift,
      min( TS.scScanTime ) as Arrival,
      max( TS.scScanTime ) as Departure,
      max( IF( TS.scScanTime > perPerson.BeginShift         
           AND TS.scScanTime <= perPerson.MidShift, TS.scScanTime, "" )) as LateArrival,
      max( IF( TS.scScanTime > perPerson.MidShift
           AND TS.scScanTime < perPerson.EndShift, TS.scScanTime, "" )) as EarlyDepart
   from
      ( select
              wd.wdpercode,
              @midDay := if( s.shiftbegin < s.shiftmid, wd.wddate, 
                 date_add( wd.wddate, interval 1 day )) as NewMidDay,
              @endDay := if( s.shiftbegin < s.shiftend, wd.wddate, 
                 date_add( wd.wddate, interval 1 day )) as NewEndDay,
              cast( concat(wd.wddate, ' ', s.shiftbegin2 ) as DateTime ) as EarliestClockIn,
              cast( concat(wd.wddate, ' ', s.shiftbegin ) as DateTime ) as BeginShift,
              cast( concat(@midDay, ' ', s.shiftmid ) as DateTime ) as MidShift,
              cast( concat( @endDay, ' ', s.shiftend ) as DateTime ) as EndShift,
              cast( concat( @endDay, ' ', s.shiftend2 ) as DateTime ) as MaxClockOut
           from
              ( select
                      @endDay := '',
                      @midDay := '' ) sqlvars,
              tb_workday wd
                 join tb_shift s
                    on wd.wdshift = s.shiftcode ) perPerson
         JOIN tb_scan TS
            on perPerson.wdpercode = TS.scpercode
            AND TS.scScanTime >= perPerson.EarliestClockIn
            AND TS.scScanTime <= perPerson.MaxClockOut
   group by
      perPerson.wdPerCode,
      perPerson.BeginShift;

我根据您提供的内容创建了表格和示例数据(其中一些数据与示例日期和范围不匹配,因此我进行了调整)。

CREATE TABLE `tb_scan` (
  `scpercode` varchar(6) DEFAULT NULL,
  `scscantime` datetime,
  KEY `all` (`scyear`,`scmonth`,`scday`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

insert into tb_scan 
( scpercode, scscantime ) 
values
( '000001', '2010-10-10 08:02:00' ),
( '000001', '2010-10-10 17:33:00' ),
( '000001', '2010-10-11 07:48:00' ),
( '000001', '2010-10-11 17:29:00' ),
( '000001', '2010-10-12 08:04:00' ),
( '000001', '2010-10-12 17:28:00' ),
( '000002', '2010-10-10 17:31:00' ),
( '000002', '2010-10-11 05:35:00' ),
( '000002', '2010-10-11 17:28:00' ),
( '000002', '2010-10-12 05:29:00' ),
( '000002', '2010-10-12 17:32:00' ),
( '000002', '2010-10-13 05:27:00' );

CREATE TABLE `tb_workday` (
  `wdpercode` varchar(6) DEFAULT NULL,
  `wdshift` varchar(1) DEFAULT NULL,
  `wddate` date DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

insert into tb_workday 
( wdpercode, wdshift, wddate )
values
( '000001', '1', '2010-10-10' ),
( '000001', '1', '2010-10-11' ),
( '000001', '1', '2010-10-12' ),
( '000001', '1', '2010-10-13' ),
( '000002', '2', '2010-10-10' ),
( '000002', '2', '2010-10-11' ),
( '000002', '2', '2010-10-12' ),
( '000002', '2', '2010-10-13' );


CREATE TABLE `tb_shift` (
  `shiftcode` varchar(1) DEFAULT NULL,
  `shiftbegin2` varchar(8) DEFAULT NULL,
  `shiftbegin` varchar(8) DEFAULT NULL,
  `shiftmid` varchar(8) DEFAULT NULL,
  `shiftend` varchar(8) DEFAULT NULL,
  `shiftend2` varchar(8) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

insert into tb_shift
( shiftcode, shiftbegin2, shiftbegin, shiftmid, shiftend, shiftend2 )
values
( '1', '04:00:00', '08:00:00', '12:00:00', '17:30:00', '21:30:00' ), 
( '2', '12:00:00', '17:30:00', '21:00:00', '05:30:00', '09:30:00' );

样本数据显示每个人的情况如下:1:迟到,2:早退,3:迟到并早退。

wdPerCode  BeginShift         EndShift           Arrival            Departure          LateArrival        EarlyDepart
000001     2010-10-10 08:00   2010-10-10 17:30   2010-10-10 08:02   2010-10-10 17:33   2010-10-10 08:02
000001     2010-10-11 08:00   2010-10-11 17:30   2010-10-11 07:48   2010-10-11 17:29                      2010-10-11 17:29
000001     2010-10-12 08:00   2010-10-12 17:30   2010-10-12 08:04   2010-10-12 17:28   2010-10-12 08:04   2010-10-12 17:28

000002     2010-10-10 17:30   2010-10-11 05:30   2010-10-10 17:31   2010-10-11 05:35   2010-10-10 17:31
000002     2010-10-11 17:30   2010-10-12 05:30   2010-10-11 17:28   2010-10-12 05:29                      2010-10-12 05:29
000002     2010-10-12 17:30   2010-10-13 05:30   2010-10-12 17:32   2010-10-13 05:27   2010-10-12 17:32   2010-10-13 05:27

为了优化查询,我会更改扫描表上的索引

CREATE TABLE `tb_scan` (
  `scpercode` varchar(6) DEFAULT NULL,
  `scscantime` datetime,
  KEY `personDate` (`scpercode`, `scscantime` )
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

如何使多个带有 OR 的 LEFT JOIN 完全使用复合索引? (第2部分) 的相关文章

  • 删除所有值比第二高值低 5 倍的记录

    我有一个表 价格 有两个字段 代码 字符 和价格 小数 我需要查找具有相同代码 价格比两个最高价格低 5 倍或更少的所有记录 例如 在这种情况下 我希望删除 id 1 id code price 1 1001 10 2 1001 101 3
  • sql/mysql 过滤器仅包含最大值

    我有一个像这样的结果集 ID name myvalue 1 A1 22 2 A2 22 3 A3 21 4 A4 33 5 A5 33 6 A6 10 7 A7 10 8 A8 10 9 A9 5 我想要的是仅包含包含可用的最高 myval
  • SQL选择符号||是什么意思意思是?

    什么是 在 SQL 中做什么 SELECT a b AS letter 表示字符串连接 不幸的是 字符串连接不能在所有 sql 方言之间完全移植 ANSI SQL 中缀运算符 mysql concat 可变参数函数 caution 表示 逻
  • PDO 如何在执行 rollBack() 函数之前回滚查询?

    这是我的脚本 try dbh con gt beginTransaction stmt1 dbh conn gt prepare UPDATE activate account num SET num num 1 stmt1 gt exec
  • 在 EXISTS 查询中使用 LIMIT 有什么意义吗?

    添加一个是否有任何性能优势LIMIT to an EXISTS查询 或者 MySQL 会自行应用限制吗 Example IF EXISTS SELECT 1 FROM my table LIMIT 1 can this improve pe
  • 如何在 MySQL 中使用 INET_ATON 进行通配符搜索 IP 地址?

    我发现这个方法可以使用 INET ATON 将 IP 地址作为整数存储在 MySQL 数据库中 https stackoverflow com a 5133610 4491952 https stackoverflow com a 5133
  • 按时间戳字段中的日期过滤结果

    我已经获得了一些帮助 但不确定为什么这不起作用 我正在尝试使用表单让用户过滤他们的活动 存储在数据库中 My code GET from 01 11 2013 GET to 25 11 2013 from DateTime createFr
  • 如何将mysql数据库移动到另一个安装点

    我有一个 MySQL 数据库 它变得越来越大 我想将整个数据库移动到另一个安装点 在那里我有足够的存储空间 我希望传输当前数据 并将新数据保存到新位置 软件堆栈 在 FreeBSD 6 上运行的 MySQL 5 当然其他答案也是有效的 但如
  • MySQL 连接逗号分隔字段

    我有两张桌子 第一个表是batch在字段 batch 中包含逗号分隔的学生 ID 的表 batch id batch 1 1 2 2 3 4 第二个表是分数 marks id studentid subject marks 1 1 Engl
  • 如何将Hive数据表迁移到MySql?

    我想知道如何将日期从 Hive 转移到 MySQL 我看过有关如何将 Hive 数据移动到 Amazon DynamoDB 的示例 但没有看到有关如何将 Hive 数据移动到 MySQL 等 RDBMS 的示例 这是我在 DynamoDB
  • 尝试在本地主机上测试我的 php 文件,但只出现一个空白页面,没有错误消息

    我正在运行 Apache 和 mySQL 因为我检查了所有日志 似乎没有任何错误 我的目标是每当有新的表单条目时就向特定地址发送电子邮件 我对后端和 PHP 缺乏经验 所以我不太确定哪里出了问题 任何帮助将不胜感激
  • 选择不带 FROM 但有多于一行的选择

    如何在不从现有表中进行选择的情况下生成 2 行 2 列的表 我正在寻找的是一个返回的选择语句 e g id value 1 103 2 556 Use UNION http dev mysql com doc refman 5 0 en u
  • 数据包无序。得到:80 预期:0 node.js

    这是我的 非常简单 代码 var connection mysql createConnection infosDB connection connect connection query SELECT FROM action functi
  • 如何在一对一关系上使用 onDelete: 'CASCADE'

    当用户被删除时 我尝试删除用户的个人资料 但它并没有删除个人资料上的任何内容 用户实体 Entity export class User PrimaryGeneratedColumn id number Column name string
  • 比较 PHP 中的 unix 时间戳 [关闭]

    很难说出这里问的是什么 这个问题是含糊的 模糊的 不完整的 过于宽泛的或修辞性的 无法以目前的形式得到合理的回答 如需帮助澄清此问题以便重新打开 访问帮助中心 help reopen questions 在 PHP 中我有 diff abs
  • 如何杀死Mysql“show processlist”中的所有进程?

    因为我在那里看到了很多进程 并且 时间 列显示了所有进程的大值 大规模屠杀操作节省时间 在 MySql 本身中执行此操作 运行这些命令 mysql gt select concat KILL id from information sche
  • 如何将从 MySQL 获取的数据以 JSON 形式返回到 php 文件中?

    我必须将从 MySQL 表中获取的数据作为 JSON 返回到 php 文件中 这是我连接到 mysql 并从中获取数据的代码 现在我怎么能将它作为 JSON 返回呢
  • WordPress 访问

    我正在与朋友一起开发一个网站 使用Wordpress我们正在尝试从我的计算机和他的计算机访问同一个 WordPress 帐户 以便我们可以一起在网站上工作 我们尝试将彼此添加为管理员 但只能从创建管理员的计算机上访问新帐户 有谁知道如何做到
  • 如何在 MySql Workbench 中禁用 INVISIBLE 索引选项?

    我刚刚安装了MySqlWorkbench我发现了实施INVISIBLE index所描述的here https dev mysql com doc refman 8 0 en invisible indexes html 我想禁用此功能 因
  • Mysql 连接到服务器:用户 root@localhost 的访问被拒绝

    edit9 是否有可能我只是缺少文件夹的一些权限 我真的非常非常感谢更多的建议 edit3 由于这篇文章没有得到足够的回复 而且这绝对是至关重要的 我尽快完成这件事 我重建了我的帖子以显示我认为到目前为止我已经扣除的内容 注意 通过许多不同

随机推荐

  • scipy.io.wavfile.read 返回的数据是什么意思?

    的文档scipy io wavfile read说它返回采样率和数据 但在这种情况下 数据实际上意味着什么 wav files 谁能用通俗的语言告诉我这些数据是如何准备的 附言 我在某处读到这意味着振幅 我读到的内容正确吗 如果是 那么该幅
  • Android Studio - 1.5.11 之前的 IBus 可能会导致输入问题。有关详细信息,请参阅 IDEA-78860 [重复]

    这个问题在这里已经有答案了 Android Studio 1 5 Build AI 141 2422023 built on November 12 2015 我刚刚更新了我的Android Studio on Ubuntu 15 10当它
  • MVC5 - 数据注释 - 客户端验证没有发生?

    我有一个 MVC 5 应用程序 我使用数据注释来进行大部分验证 我的班级中的属性之一如下所示 Required ErrorMessage Please enter a business name StringLength 80 public
  • 如何从选项卡排序列表中排除小部件?

    此图来自Qt官网 我以此为例 我想避免一些不重要的小部件以选项卡为中心 如果您有一个小部件想要在一些常用的之间快速旋转 则此策略非常有用QLineEdit输入数据并转义那些很少使用的设置 Take the picture as an exa
  • python 中具有无限初始条件的 ODE

    我有一个二阶微分方程 我想用 python 求解它 问题是对于其中一个变量我没有初始条件0但仅限于无穷大的值 谁能告诉我应该提供哪些参数scipy integrate odeint 能解决吗 Equation Theta 需要根据时间来找到
  • 在 Eclipse 中添加外部 jar

    我创建了一个连接 MySQL 的程序 我使用 eclipse 添加外部 jar 选项添加 Connector j 程序在eclipse中运行良好 但是当我使用 eclipse 创建可执行 jar 并运行它时 它总是给出 ClassNotFo
  • 打开文件失败是否必须使用die?

    大多数时候 我会做这样的事情 open FH gt file txt or die Cann t open file Does die必须使用吗 如果我希望我的脚本继续 并且如果无法打开文件则忽略错误 我应该做什么 你可能想做类似的事情 i
  • openSUSE 的构建必备

    我是 openSUSE 的新手 我需要获得系统的构建必要条件 但无法使用它sudo apt get install build essential或者甚至通过使用sudo apt get update然后按照前面的代码进行操作 我找到了一种
  • 无法使用 SSH 访问 AWS CodeCommit

    弄清楚如何让 AWS CodeCommit 与标准 SSH 身份验证配合使用非常困难 看到另一个类似的主题 但没有答案 我还不能发表评论 这是在 Windows 上使用 Git Bash 重现步骤 创建具有完全权限的 IAM 用户 AwsA
  • 如何从 dropzone.js 上传和删除文件

    我使用了下面的代码 图像已被删除 但缩略图仍然显示 Dropzone options myDropzone init function this on success function file response file serverId
  • 在 R 中将日期转换为星期几

    我的数据框中有一个这种格式的日期 02 July 2015 我需要将其转换为星期几 即 183 就像是 df day of week lt weekdays as Date df date column 但这不理解日期的格式 你可以使用lu
  • 防止引导程序弹出窗口中的默认值

    我正在使用 twitter bootstrap 并且我已经得到了这段代码 addYT on click function event var this this event preventDefault popover placement
  • 递归:如何避免Python设置在迭代过程中更改设置 RuntimeError

    背景及问题描述 我有一些代码可以解决图着色问题 广义上定义为将 颜色 分配给无向图的问题 确保由边连接的两个顶点没有相同的颜色 我正在尝试使用约束传播来实现一个解决方案 以提高标准递归回溯算法的效率 但遇到以下错误 File C Users
  • 我想将 Qt QML Combobox 设置为 PyQt5 对象属性

    我正在编写一个小程序 它使用 Qt5 QML 作为 GUI 层 并使用 Python3 PyQt5 来实现数据模型 我现在想显示一个ComboBox在 QML 中并将其模型设置为枚举列表 如何将枚举导出为 python 类的属性 以便我可以
  • Sling解析脚本调用顺序

    我正在研究 sling 如何根据 url 调用脚本 在选择器的情况下 它似乎工作正常 但如果我不使用选择器 它会让我难以理解 我有一个页面 content AEMProject English test html其中有资源类型AEMProj
  • 如何检查模型中是否存在 DbContext.Set

    我遇到的情况是 我可能正在使用多个 DbContext 这些 DbContext 可能包含也可能不包含 SomeEntity 的 DbSet 当然 如果我关闭 SaveChanges 并且该实体不存在 则会出现以下错误 实体类型 SomeE
  • 如何使用 Java 禁用 Selenium WebDriver 中的 Chrome 插件

    Chrome 插件弹出 https i stack imgur com jRBdG png 当我为此应用程序执行自动化代码时 会显示上面的弹出窗口 现在我需要知道如何使用 Java 禁用 Selenium WebDriver 中的 PDF
  • 使用 CMake 链接到 TBB 库

    I have tbb下载并放置在我的存储库目录中 gt tree deps tbb d deps tbb bin cmake templates include serial tbb tbb compat internal machine
  • Laravel 扩展 TestResponse 类

    我正在尝试添加自定义断言TestReponse https laravel com api 5 5 Illuminate Foundation Testing TestResponse html类所以我可以做这样的事情 response t
  • 如何使多个带有 OR 的 LEFT JOIN 完全使用复合索引? (第2部分)

    它用于计算用户进入 离开工作场所时如何扫描指纹的系统 我不知道它的英文怎么称呼 我需要确定用户是否早上迟到 以及用户是否提前下班 This tb scan表包含用户扫描指纹的日期和时间 CREATE TABLE tb scan scperc