小编Har*_*ris的帖子

Eslint 不使用 TypeScript 语法

我正在尝试eslint为我的REACT-TypeScript项目进行配置。它以前使用过tslint,很快就会被弃用。我浏览了网络,终于能够创建我的.eslintrc.json

{
  "parser": "@typescript-eslint/parser",
  "parserOptions": {
    "ecmaFeatures": {
      "jsx": true
    },
    "project": "./tsconfig.json",
    "ecmaVersion": 2018,
    "sourceType": "module"
  },
  "env": {
    "browser": true,
    "jest/globals": true
  },
  "extends": [
    "airbnb",
    "plugin:react/recommended",
    "plugin:@typescript-eslint/recommended",
    "plugin:import/typescript",
    "prettier/@typescript-eslint",
    "plugin:prettier/recommended"
  ],
  "plugins": ["@typescript-eslint", "react-hooks", "jest", "prettier"],
  "ignorePatterns": ["src/serviceWorker.ts", "src/enums.ts", "node_modules/"],

  "rules": { },
  "settings": {
    "import/extensions": [".js", ".jsx", ".ts", ".tsx"],
    "import/parsers": {
      "@typescript-eslint/parser": [".ts", ".tsx"]
    },
    "import/resolver": {
      "node": {
        "extensions": [".js", ".jsx", ".ts", ".tsx"]
      }
    }
  },
  "prettier/prettier": …
Run Code Online (Sandbox Code Playgroud)

typescript eslint

10
推荐指数
1
解决办法
6715
查看次数

蝗虫:ConnectionError(ProtocolError('Connection aborted。',BadStatusLine(“''”,)),)

我正在表演Load-tests一些Rest APIs使用Locust。除了使我感到困惑的错误外,其他所有东西都工作正常:

ConnectionError(ProtocolError('Connection aborted.', BadStatusLine("''",)),)
Run Code Online (Sandbox Code Playgroud)

我已经阅读了有关此问题的其他问题,并发现以下事实:

当python无法理解服务器响应时,会出现此错误。

我想知道的是:

1)如果此问题与服务器有关,可以采取什么措施?

2)这个问题是由测试的故障代码引起的吗?

我想知道此错误是由于test写入错误Locust或服务器出现故障。如果我不清楚的话,请告诉我。

python load-testing python-2.7 locust

5
推荐指数
0
解决办法
456
查看次数

隐藏jQuery dataTables中的列?

我想隐藏的列中jQuery DataTables包含地理区在它的th.这就是我在做的事情:

$(document).ready(function(){

        if(geo_zone_on_off==0){
            var _index=$("#datatable_ajax .heading th:contains(GeoZone)").index();
            var oTable=$("#datatable_ajax").DataTable();
            if(_index != -1){
                 oTable.column(_index).visible(false);
     }
        }
    });
Run Code Online (Sandbox Code Playgroud)

加载了dataTable,但该列未被隐藏.在这之前我尝试在表格渲染时隐藏它并且它工作正常.我当时做的是:

 "initComplete": function(settings, json) {
                       if(geo_zone_on_off==0){
                        var _index=$("th.sorting:contains(GeoZone),th.no-sort:contains(GeoZone)").index();

                           if(_index != -1){
                             grid.getDataTable().column(_index).visible(false);
                           }
                       }
                       },
Run Code Online (Sandbox Code Playgroud)

但它有一个问题,它在表加载时显示隐藏的列.为了避免这个问题,我使用了首先提到的解决方案.但它没有工作,虽然我正在使索引正确.它不会给出任何错误.

javascript jquery datatables

5
推荐指数
1
解决办法
4825
查看次数

MySQL:比较运算符不工作

我正在使用以下代码.它工作正常,但当我使用日期过滤器时,它停止工作.我在sql中使用了比较运算符.我搜索了一些问题,但没有找到理想的答案.

        SELECT SUM(retailerData.poster), SUM(retailerData.banners), SUM(retailerData.tradeLetters), SUM(retailerData.stickers) , 
    SUM(retailerData.buntings),SUM(retailerData.dangler) FROM retailerData INNER 
    JOIN retailer ON retailer.retailerID=retailerData.retailerID WHERE
   '2016-08- 24'<= retailerData.visitDate <='2016-09-03' 
    AND retailer.retailerID IN( SELECT 
    retailer.retailerID FROM retailer INNER JOIN office ON office.officeID= 
    retailer.officeID WHERE office.officeID IN( SELECT officeID FROM office          
    WHERE 
    parentOfficeID IN( SELECT officeID FROM office WHERE parentOfficeID IN    
    (SELECT 
    officeID FROM office WHERE officeName='Faisalabad Belt') ) ))
Run Code Online (Sandbox Code Playgroud)

请帮我解决这个问题.

mysql sql

0
推荐指数
1
解决办法
57
查看次数