问:
How to eliminate blanks from SQL Summary Row with Totals with ROLLUP
I have the following SQL in Sql server 2016. I am trying to capture Totals of Site in Column and then Sum total in Row with ROLLUP. However, I am getting Nulls as well. I am providing sample data here:

```<code>            create table #tempSite
                (
                Report_Date smalldatetime null,
                Code varchar(10) null,
                DepSite varchar(10) null
                )

                INSERT INTO #tempSite (Report_Date, Code, DepSite) values ('2020-05-22', 'ABCDE', 'NC')
                INSERT INTO #tempSite (Report_Date, Code, DepSite) values ('2020-05-22', 'ABCDE', 'SC')
                INSERT INTO #tempSite (Report_Date, Code, DepSite) values ('2020-05-22', 'ABCDE', 'FL')
                INSERT INTO #tempSite (Report_Date, Code, DepSite) values ('2020-05-22', 'ABCDE', 'SC')
                INSERT INTO #tempSite (Report_Date, Code, DepSite) values ('2020-05-22', 'ABCDE', 'FL')
                INSERT INTO #tempSite (Report_Date, Code, DepSite) values ('2020-05-22', 'ABCDE', 'NC')
                INSERT INTO #tempSite (Report_Date, Code, DepSite) values ('2020-05-22', 'ABCDE', 'SC')
                INSERT INTO #tempSite (Report_Date, Code, DepSite) values ('2020-05-22', 'ABCDE', 'NC')
                INSERT INTO #tempSite (Report_Date, Code, DepSite) values ('2020-05-22', 'UVXYZ', 'NC')
                INSERT INTO #tempSite (Report_Date, Code, DepSite) values ('2020-05-22', 'UVXYZ', 'SC')
                INSERT INTO #tempSite (Report_Date, Code, DepSite) values ('2020-05-22', 'UVXYZ', 'NC')

                INSERT INTO #tempSite (Report_Date, Code, DepSite) values ('2020-05-23', 'ABCDE', 'NC')
                INSERT INTO #tempSite (Report_Date, Code, DepSite) values ('2020-05-23', 'ABCDE', 'SC')
                INSERT INTO #tempSite (Report_Date, Code, DepSite) values ('2020-05-23', 'ABCDE', 'FL')
                INSERT INTO #tempSite (Report_Date, Code, DepSite) values ('2020-05-23', 'ABCDE', 'SC')
                INSERT INTO #tempSite (Report_Date, Code, DepSite) values ('2020-05-23', 'PQRST', 'FL')
                INSERT INTO #tempSite (Report_Date, Code, DepSite) values ('2020-05-23', 'ABCDE', 'NC')
                INSERT INTO #tempSite (Report_Date, Code, DepSite) values ('2020-05-23', 'ABCDE', 'SC')
                INSERT INTO #tempSite (Report_Date, Code, DepSite) values ('2020-05-23', 'ABCDE', 'NC')
                INSERT INTO #tempSite (Report_Date, Code, DepSite) values ('2020-05-23', 'UVXYZ', 'NC')
                INSERT INTO #tempSite (Report_Date, Code, DepSite) values ('2020-05-23', 'PQRST', 'SC')
                INSERT INTO #tempSite (Report_Date, Code, DepSite) values ('2020-05-23', 'UVXYZ', 'NC')
                INSERT INTO #tempSite (Report_Date, Code, DepSite) values ('2020-05-23', 'UVXYZ', 'CA')
                INSERT INTO #tempSite (Report_Date, Code, DepSite) values ('2020-05-23', 'PQRST', 'CA')
                INSERT INTO #tempSite (Report_Date, Code, DepSite) values ('2020-05-23', 'UVXYZ', 'MD')

                INSERT INTO #tempSite (Report_Date, Code, DepSite) values ('2020-05-24', 'ABCDE', 'NC')
                INSERT INTO #tempSite (Report_Date, Code, DepSite) values ('2020-05-24', 'ABCDE', 'SC')
                INSERT INTO #tempSite (Report_Date, Code, DepSite) values ('2020-05-24', 'ABCDE', 'FL')
                INSERT INTO #tempSite (Report_Date, Code, DepSite) values ('2020-05-24', 'ABCDE', 'SC')
                INSERT INTO #tempSite (Report_Date, Code, DepSite) values ('2020-05-24', 'PQRST', 'FL')
                INSERT INTO #tempSite (Report_Date, Code, DepSite) values ('2020-05-24', 'ABCDE', 'NC')
                INSERT INTO #tempSite (Report_Date, Code, DepSite) values ('2020-05-24', 'ABCDE', 'SC')
                INSERT INTO #tempSite (Report_Date, Code, DepSite) values ('2020-05-24', 'ABCDE', 'NC')
                INSERT INTO #tempSite (Report_Date, Code, DepSite) values ('2020-05-24', 'UVXYZ', 'NC')
                INSERT INTO #tempSite (Report_Date, Code, DepSite) values ('2020-05-24', 'PQRST', 'SC')
                INSERT INTO #tempSite (Report_Date, Code, DepSite) values ('2020-05-24', 'UVXYZ', 'NC')
                INSERT INTO #tempSite (Report_Date, Code, DepSite) values ('2020-05-24', 'UVXYZ', 'CA')
                INSERT INTO #tempSite (Report_Date, Code, DepSite) values ('2020-05-24', 'PQRST', 'CA')
                INSERT INTO #tempSite (Report_Date, Code, DepSite) values ('2020-05-24', 'UVXYZ', 'MD')

                SELECT Report_Date, Code, DepSite, count(DepSite) TOT_SITE
                FROM #tempSite
                WHERE Code ='ABCDE'in
                and Report_Date in ('2020-05-22', '2020-05-24')
                group by ROLLUP(Report_Date, Code, DepSite)
</code>```

How can I eliminate NULLS?
Is there a way to get results like:

```<code>Report_Date         Code    DepSite TOT_SITE
2020-05-22 00:00:00 ABCDE   FL      2
2020-05-22 00:00:00 ABCDE   NC      3
2020-05-22 00:00:00 ABCDE   SC      3
2020-05-22 00:00:00 NULL    NULL    8
2020-05-24 00:00:00 ABCDE   FL      1
2020-05-24 00:00:00 ABCDE   NC      3
2020-05-24 00:00:00 ABCDE   SC      3
2020-05-24 00:00:00 NULL    NULL    7
NULL                NULL    NULL    15
</code>```

答:
You can filter the GROUP BY via a HAVING clause using the GROUPING function:

```<code>SELECT Report_Date, Code, DepSite, count(DepSite) TOT_SITE
FROM #tempSite
WHERE Code ='ABCDE'
and Report_Date in ('2020-05-22', '2020-05-24')
group by ROLLUP(Report_Date, Code, DepSite)
having grouping(DepSite) = 0
or grouping (Code) = 1
</code>```

GROUPING is 1 when the column is being totalled in that row as part of the ROLLUP. So here you check that either the final column (DepSite) is not being totalled by the ROLLUP (and is thus a standard aggregated row output by the GROUP BY) or that Code is being totalled and thus that DepSite must be too (because you are doing a ROLLUP not a CUBE and Code precedes DepSite)

Body:
I have the following SQL in Sql server 2016. I am trying to capture Totals of Site in Column and then Sum total in Row with ROLLUP. However, I am getting Nulls as well. I am providing sample data here:

            create table #tempSite
                (
                Report_Date smalldatetime null,
                Code varchar(10) null,
                DepSite varchar(10) null
                )

                INSERT INTO #tempSite (Report_Date, Code, DepSite) values ('2020-05-22', 'ABCDE', 'NC')
                INSERT INTO #tempSite (Report_Date, Code, DepSite) values ('2020-05-22', 'ABCDE', 'SC')
                INSERT INTO #tempSite (Report_Date, Code, DepSite) values ('2020-05-22', 'ABCDE', 'FL')
                INSERT INTO #tempSite (Report_Date, Code, DepSite) values ('2020-05-22', 'ABCDE', 'SC')
                INSERT INTO #tempSite (Report_Date, Code, DepSite) values ('2020-05-22', 'ABCDE', 'FL')
                INSERT INTO #tempSite (Report_Date, Code, DepSite) values ('2020-05-22', 'ABCDE', 'NC')
                INSERT INTO #tempSite (Report_Date, Code, DepSite) values ('2020-05-22', 'ABCDE', 'SC')
                INSERT INTO #tempSite (Report_Date, Code, DepSite) values ('2020-05-22', 'ABCDE', 'NC')
                INSERT INTO #tempSite (Report_Date, Code, DepSite) values ('2020-05-22', 'UVXYZ', 'NC')
                INSERT INTO #tempSite (Report_Date, Code, DepSite) values ('2020-05-22', 'UVXYZ', 'SC')
                INSERT INTO #tempSite (Report_Date, Code, DepSite) values ('2020-05-22', 'UVXYZ', 'NC')

                INSERT INTO #tempSite (Report_Date, Code, DepSite) values ('2020-05-23', 'ABCDE', 'NC')
                INSERT INTO #tempSite (Report_Date, Code, DepSite) values ('2020-05-23', 'ABCDE', 'SC')
                INSERT INTO #tempSite (Report_Date, Code, DepSite) values ('2020-05-23', 'ABCDE', 'FL')
                INSERT INTO #tempSite (Report_Date, Code, DepSite) values ('2020-05-23', 'ABCDE', 'SC')
                INSERT INTO #tempSite (Report_Date, Code, DepSite) values ('2020-05-23', 'PQRST', 'FL')
                INSERT INTO #tempSite (Report_Date, Code, DepSite) values ('2020-05-23', 'ABCDE', 'NC')
                INSERT INTO #tempSite (Report_Date, Code, DepSite) values ('2020-05-23', 'ABCDE', 'SC')
                INSERT INTO #tempSite (Report_Date, Code, DepSite) values ('2020-05-23', 'ABCDE', 'NC')
                INSERT INTO #tempSite (Report_Date, Code, DepSite) values ('2020-05-23', 'UVXYZ', 'NC')
                INSERT INTO #tempSite (Report_Date, Code, DepSite) values ('2020-05-23', 'PQRST', 'SC')
                INSERT INTO #tempSite (Report_Date, Code, DepSite) values ('2020-05-23', 'UVXYZ', 'NC')
                INSERT INTO #tempSite (Report_Date, Code, DepSite) values ('2020-05-23', 'UVXYZ', 'CA')
                INSERT INTO #tempSite (Report_Date, Code, DepSite) values ('2020-05-23', 'PQRST', 'CA')
                INSERT INTO #tempSite (Report_Date, Code, DepSite) values ('2020-05-23', 'UVXYZ', 'MD')

                INSERT INTO #tempSite (Report_Date, Code, DepSite) values ('2020-05-24', 'ABCDE', 'NC')
                INSERT INTO #tempSite (Report_Date, Code, DepSite) values ('2020-05-24', 'ABCDE', 'SC')
                INSERT INTO #tempSite (Report_Date, Code, DepSite) values ('2020-05-24', 'ABCDE', 'FL')
                INSERT INTO #tempSite (Report_Date, Code, DepSite) values ('2020-05-24', 'ABCDE', 'SC')
                INSERT INTO #tempSite (Report_Date, Code, DepSite) values ('2020-05-24', 'PQRST', 'FL')
                INSERT INTO #tempSite (Report_Date, Code, DepSite) values ('2020-05-24', 'ABCDE', 'NC')
                INSERT INTO #tempSite (Report_Date, Code, DepSite) values ('2020-05-24', 'ABCDE', 'SC')
                INSERT INTO #tempSite (Report_Date, Code, DepSite) values ('2020-05-24', 'ABCDE', 'NC')
                INSERT INTO #tempSite (Report_Date, Code, DepSite) values ('2020-05-24', 'UVXYZ', 'NC')
                INSERT INTO #tempSite (Report_Date, Code, DepSite) values ('2020-05-24', 'PQRST', 'SC')
                INSERT INTO #tempSite (Report_Date, Code, DepSite) values ('2020-05-24', 'UVXYZ', 'NC')
                INSERT INTO #tempSite (Report_Date, Code, DepSite) values ('2020-05-24', 'UVXYZ', 'CA')
                INSERT INTO #tempSite (Report_Date, Code, DepSite) values ('2020-05-24', 'PQRST', 'CA')
                INSERT INTO #tempSite (Report_Date, Code, DepSite) values ('2020-05-24', 'UVXYZ', 'MD')

                SELECT Report_Date, Code, DepSite, count(DepSite) TOT_SITE
                FROM #tempSite
                WHERE Code ='ABCDE'in
                and Report_Date in ('2020-05-22', '2020-05-24')
                group by ROLLUP(Report_Date, Code, DepSite)

How can I eliminate NULLS?
Is there a way to get results like:

Report_Date         Code    DepSite TOT_SITE
2020-05-22 00:00:00 ABCDE   FL      2
2020-05-22 00:00:00 ABCDE   NC      3
2020-05-22 00:00:00 ABCDE   SC      3
2020-05-22 00:00:00 NULL    NULL    8
2020-05-24 00:00:00 ABCDE   FL      1
2020-05-24 00:00:00 ABCDE   NC      3
2020-05-24 00:00:00 ABCDE   SC      3
2020-05-24 00:00:00 NULL    NULL    7
NULL                NULL    NULL    15

Body:
You can filter the GROUP BY via a HAVING clause using the GROUPING function:

SELECT Report_Date, Code, DepSite, count(DepSite) TOT_SITE
FROM #tempSite
WHERE Code ='ABCDE'
and Report_Date in ('2020-05-22', '2020-05-24')
group by ROLLUP(Report_Date, Code, DepSite)
having grouping(DepSite) = 0
or grouping (Code) = 1

GROUPING is 1 when the column is being totalled in that row as part of the ROLLUP. So here you check that either the final column (DepSite) is not being totalled by the ROLLUP (and is thus a standard aggregated row output by the GROUP BY) or that Code is being totalled and thus that DepSite must be too (because you are doing a ROLLUP not a CUBE and Code precedes DepSite)


来源: stackexchange

问:
Error when running (open-mmlab) C:\mmdetection>python setup.py develop - raise RuntimeError(message)
I get the following error in the last stage of the mmdetection install from
https://github.com/open-mmlab/mmdetection/blob/master/docs/install.md

when running

```<code>C:\...\mmdetection\python setup.py develop
running develop
running egg_info
writing mmdet.egg-info\PKG-INFO
writing dependency_links to mmdet.egg-info\dependency_links.txt
writing requirements to mmdet.egg-info\requires.txt
writing top-level names to mmdet.egg-info\top_level.txt
reading manifest file 'mmdet.egg-info\SOURCES.txt'
writing manifest file 'mmdet.egg-info\SOURCES.txt'
running build_ext
C:\...\torch\utils\cpp_extension.py:237: UserWarning: Error checking compiler version for cl: [WinError 2] The system cannot find the file specified

warnings.warn('Error checking compiler version for {}: {}'.format(compiler, error))

building 'mmdet.ops.utils.compiling_info' extension
Emitting ninja build file C:\...\mmdetection\build\temp.win-amd64-3.7\Release\build.ninja...
Compiling objects...
Allowing ninja to set a default number of workers... (overridable by setting the environment variable MAX_JOBS=N)

FAILED: C:/.../mmdetection/build/temp.win-amd64-3.7/Release/mmdet/ops/utils/src/compiling_info.obj
cl /showIncludes /nologo /Ox /W3 /GL /DNDEBUG /MD /MD /wd4819 /EHsc -DWITH_CUDA -IC:\torch\include -

CreateProcess failed: The system cannot find the file specified.
ninja: build stopped: subcommand failed.

Traceback (most recent call last):
  File "C:...\torch\utils\cpp_extension.py", line 1400, in _run_ninja_build
    check=True)
  File "C:\anaconda3\envs\open-mmlab\lib\subprocess.py", line 512, in run
    output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['ninja', '-v']' returned non-zero exit status 1.

During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "setup.py", line 300, in <module>
    zip_safe=False)
  File "C:...\setuptools\__init__.py", line 144, in setup
    return distutils.core.setup(**attrs)
  File "C:\...\anaconda3\envs\open-mmlab\lib\distutils\core.py", line 148, in
  File "C:\...\torch\utils\cpp_extension.py", line 1140, in _write_ninja_file_and_compile_objects
    ..............
    error_prefix='Error compiling objects for extension')
  File "C:\...\torch\utils\cpp_extension.py", line 1413, in _run_ninja_build

raise RuntimeError(message)
RuntimeError: Error compiling objects for extension
</code>```

I was wondering if anyone knows what could be the cause of this error message ?

I am using windows 10

答:
In github https://github.com/open-mmlab/mmdetection/blob/v2.0.0/docs/install.md

by following the instructions, but this time switching github tag to v2.0.0 and cloning it

typing in this

```<code>pip install -v -e .
</code>```

gives the following.  :-

```#sha256=a37ee82f1b8ed4b4645619c504311e71ce845b78f40055e78d71add5fab7da82 (from https://pypi.org/simple/opencv-python/)
  Skipping link: none of the wheel's tags match: cp36-cp36m-manylinux1_x86_64: https://files.pythonhosted.org/packages/72/c2/e9cf54ae5b1102020ef895866a67cb2e1aef72f16dd1fde5b5fb1495ad9c/opencv_python-4.2.0.34-cp36-cp36m-manylinux1_x86_64.whl#sha256=dcb8da8c5ebaa6360c8555547a4c7beb6cd983dd95ba895bb78b86cc8cf3de2b (from https://pypi.org/simple/opencv-python/)
  ... lots more link skipping
  Skipping link: none of the wheel's tags match: cp38-cp38-win32: https://files.pythonhosted.org/packages/e6/d6/516883f8d2f255c41d8c560ef70c91085f2ceac7b70b7afe41432bd8adbb/opencv_python-4.2.0.34-cp38-cp38-win32.whl#sha256=1ab92d807427641ec45d28d5907426aa06b4ffd19c5b794729c74d91cd95090e (from https://pypi.org/simple/opencv-python/)
  Skipping link: none of the wheel's tags match: cp38-cp38-win_amd64: https://files.pythonhosted.org/packages/df/9e/56d8b98652ecac8c8f9e59b7f00d5d99a9fa86661adcf324b8dc73351a6b/opencv_python-4.2.0.34-cp38-cp38-win_amd64.whl#sha256=e2206bb8c17c0f212f1f356d82d72dd090ff4651994034416da9bf0c29732825 (from https://pypi.org/simple/opencv-python/)
Given no hashes to check 18 links for project 'opencv-python': discarding no candidates
Using version 4.2.0.34 (newest of versions: bunch of versions....)
Collecting opencv-python>=3
  Created temporary directory: C:\Users\OneWorld\AppData\Local\Temp\pip-unpack-y8apfmt3
  Looking up "https://files.pythonhosted.org/packages/85/17/bad54f67bbe27d88ba520c3f59315e95b4e254cd28767c20accacb0597d8/opencv_python-4.2.0.34-cp37-cp37m-win_amd64.whl" in the cache
  Current age based on date: 1902095
  Ignoring unknown cache-control directive: immutable
  Freshness lifeOneWorlde from max-age: 365000000
  The response is "fresh", returning cached response
  365000000 > 1902095
  Using cached opencv_python-4.2.0.34-cp37-cp37m-win_amd64.whl (33.0 MB)
  Added opencv-python>=3 from https://files.pythonhosted.org/packages/85/17/bad54f67bbe27d88ba520c3f59315e95b4e254cd28767c20accacb0597d8/opencv_python-4.2.0.34-cp37-cp37m-win_amd64.whl#sha256=d8a55585631f9c9eca4b1a996e9732ae023169cf2f46f69e4518d67d96198226 (from mmcv>=0.5.1->mmdet==2.0.0+unknown) to build tracker 'C:\\Users\\OneWorld\\AppData\\Local\\Temp\\pip-req-tracker-6eq3f7le'
  Removed opencv-python>=3 from https://files.pythonhosted.org/packages/85/17/bad54f67bbe27d88ba520c3f59315e95b4e254cd28767c20accacb0597d8/opencv_python-4.2.0.34-cp37-cp37m-win_amd64.whl#sha256=d8a55585631f9c9eca4b1a996e9732ae023169cf2f46f69e4518d67d96198226 (from mmcv>=0.5.1->mmdet==2.0.0+unknown) from build tracker 'C:\\Users\\OneWorld\\AppData\\Local\\Temp\\pip-req-tracker-6eq3f7le'
Requirement already satisfied: future in c:\users\OneWorld\anaconda3\envs\open-mmlab2\lib\site-packages (from torch>=1.3->mmdet==2.0.0+unknown) (0.18.2)
Building wheels for collected packages: mmcv
  Created temporary directory: C:\Users\OneWorld\AppData\Local\Temp\pip-wheel-93yp2cnh
  Building wheel for mmcv (setup.py) ...   Destination directory: C:\Users\OneWorld\AppData\Local\Temp\pip-wheel-93yp2cnh
  Running command 'C:\Users\OneWorld\anaconda3\envs\open-mmlab2\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\OneWorld\\AppData\\Local\\Temp\\pip-install-voimjxde\\mmcv\\setup.py'"'"'; __file__='"'"'C:\\Users\\OneWorld\\AppData\\Local\\Temp\\pip-install-
amd64-3.7\mmcv\video\optflow_warp
  copying mmcv\video\optflow_warp\flow_warp_module.pyx -> build\lib.win-amd64-3.7\mmcv\video\optflow_warp
....etc.

  running build_ext
  skipping './mmcv/video/optflow_warp\flow_warp_module.cpp' Cython extension (up-to-date)
  building 'mmcv._ext' extension
  creating build\temp.win-amd64-3.7
  creating build\temp.win-amd64-3.7\Release
  creating build\temp.win-amd64-3.7\Release\mmcv
  creating build\temp.win-amd64-3.7\Release\mmcv\video
  creating build\temp.win-amd64-3.7\Release\mmcv\video\optflow_warp
  C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -IC:\Users\OneWorld\anaconda3\envs\open-mmlab2\lib\site-packages\numpy\core\include -IC:\Users\OneWorld\anaconda3\envs\open-mmlab2\include -IC:\Users\OneWorld\anaconda3\envs\open-mmlab2\include "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\winrt" /EHsc /Tp./mmcv/video/optflow_warp/flow_warp.cpp /Fobuild\temp.win-amd64-3.7\Release\./mmcv/video/optflow_warp/flow_warp.obj
  flow_warp.cpp
  ./mmcv/video/optflow_warp/flow_warp.cpp(37): warning C4244: '=': conversion from 'double' to 'int', possible loss of data
  ./mmcv/video/optflow_warp/flow_warp.cpp(38): warning C4244: '=': conversion from 'double' to 'int', possible loss of data
  ./mmcv/video/optflow_warp/flow_warp.cpp(59): warning C4244: '=': conversion from 'double' to 'int', possible loss of data
  ./mmcv/video/optflow_warp/flow_warp.cpp(60): warning C4244: '=': conversion from 'double' to 'int', possible loss of data
  C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -IC:\Users\OneWorld\anaconda3\envs\open-mmlab2\lib\site-packages\numpy\core\include -IC:\Users\OneWorld\anaconda3\envs\open-mmlab2\include -IC:\Users\OneWorld\anaconda3\envs\open-mmlab2\include "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\winrt" /EHsc /Tp./mmcv/video/optflow_warp\flow_warp_module.cpp /Fobuild\temp.win-amd64-3.7\Release\./mmcv/video/optflow_warp\flow_warp_module.obj
  flow_warp_module.cpp
  c:\users\OneWorld\anaconda3\envs\open-mmlab2\lib\site-packages\numpy\core\include\numpy\npy_1_7_deprecated_api.h(14) : Warning Msg: Using deprecated NumPy API, disable it with #define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION
  C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\link.exe /nologo /INCREMENTAL:NO /LTCG /DLL /MANIFEST:EMBED,ID=2 /MANIFESTUAC:NO /LIBPATH:C:\Users\OneWorld\anaconda3\envs\open-mmlab2\libs /LIBPATH:C:\Users\OneWorld\anaconda3\envs\open-mmlab2\PCbuild\amd64 "/LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\LIB\amd64" "/LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\LIB\amd64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.10240.0\ucrt\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\lib\um\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.10240.0\um\x64" /EXPORT:PyInit__ext build\temp.win-amd64-3.7\Release\./mmcv/video/optflow_warp/flow_warp.obj build\temp.win-amd64-3.7\Release\./mmcv/video/optflow_warp\flow_warp_module.obj /OUT:build\lib.win-amd64-3.7\mmcv\_ext.cp37-win_amd64.pyd /IMPLIB:build\temp.win-amd64-3.7\Release\./mmcv/video/optflow_warp\_ext.cp37-win_amd64.lib
  flow_warp_module.obj : warning LNK4197: export 'PyInit__ext' specified multiple OneWorldes; using first specification
     Creating library build\temp.win-amd64-3.7\Release\./mmcv/video/optflow_warp\_ext.cp37-win_amd64.lib and object build\temp.win-amd64-3.7\Release\./mmcv/video/optflow_warp\_ext.cp37-win_amd64.exp
  Generating code
  Finished generating code
  installing to build\bdist.win-amd64\wheel
  running install
  running install_lib
  creating build\bdist.win-amd64
  creating build\bdist.win-amd64\wheel
  creating build\bdist.win-amd64\wheel\mmcv
  creating build\bdist.win-amd64\wheel\mmcv\arraymisc
  copying build\lib.win-amd64-3.7\mmcv\arraymisc\quantization.py -> build\bdist.win-amd64\wheel\.\mmcv\arraymisc
...
... bunch of copying and creating...
...
  running install_egg_info
  Copying mmcv.egg-info to build\bdist.win-amd64\wheel\.\mmcv-0.5.8-py3.7.egg-info
  running install_scripts
  C:\Users\OneWorld\anaconda3\envs\open-mmlab2\lib\site-packages\wheel\pep425tags.py:82: RunOneWorldeWarning: Config variable 'Py_DEBUG' is unset, Python ABI tag may be incorrect
    warn=(impl == 'cp')):
  C:\Users\OneWorld\anaconda3\envs\open-mmlab2\lib\site-packages\wheel\pep425tags.py:87: RunOneWorldeWarning: Config variable 'WITH_PYMALLOC' is unset, Python ABI tag may be incorrect
    sys.version_info < (3, 8))) \
  creating build\bdist.win-amd64\wheel\mmcv-0.5.8.dist-info\WHEEL
  creating 'C:\Users\OneWorld\AppData\Local\Temp\pip-wheel-93yp2cnh\mmcv-0.5.8-cp37-cp37m-win_amd64.whl' and adding 'build\bdist.win-amd64\wheel' to it
  adding 'mmcv/__init__.py'
  adding 'mmcv/_ext.cp37-win_amd64.pyd'
  adding 'mmcv/version.py'
  adding 'mmcv/arraymisc/__init__.py'
  adding 'mmcv/arraymisc/quantization.py'
  adding 'mmcv/cnn/__init__.py'
etc...
  adding 'mmcv/visualization/optflow.py'
  adding 'mmcv-0.5.8.dist-info/METADATA'
  adding 'mmcv-0.5.8.dist-info/WHEEL'
  adding 'mmcv-0.5.8.dist-info/top_level.txt'
  adding 'mmcv-0.5.8.dist-info/RECORD'
  removing build\bdist.win-amd64\wheel
done
  Created wheel for mmcv: filename=mmcv-0.5.8-cp37-cp37m-win_amd64.whl size=184354 sha256=023fa1fdb01a9fbf7d833975737bc93003c5f1c813ce8c4ae27340b19ddb9cc3
  Stored in directory: c:\users\OneWorld\appdata\local\pip\cache\wheels\cc\7c\4c\a2cc81d990c63b3d157ab3c6e2cc4b5b298c0a4a13e6a46e38
Successfully built mmcv
Installing collected packages: addict, pyyaml, yapf, opencv-python, mmcv, Pillow, terminaltables, mmdet
  Created temporary directory: C:\Users\OneWorld\AppData\Local\Temp\pip-unpacked-wheel-n1vstot6

  Created temporary directory: C:\Users\OneWorld\AppData\Local\Temp\pip-unpacked-wheel-qqv40s97

  Created temporary directory: C:\Users\OneWorld\AppData\Local\Temp\pip-unpacked-wheel-yk9n5qrl

  Created temporary directory: C:\Users\OneWorld\AppData\Local\Temp\pip-unpacked-wheel-dmbql_3c

  Created temporary directory: C:\Users\OneWorld\AppData\Local\Temp\pip-unpacked-wheel-6vlnr7x0

  Attempting uninstall: Pillow
    Found existing installation: Pillow 7.1.2
    Uninstalling Pillow-7.1.2:
      Created temporary directory: c:\users\OneWorld\anaconda3\envs\open-mmlab2\lib\site-packages\~il
      Removing file or directory c:\users\OneWorld\anaconda3\envs\open-mmlab2\lib\site-packages\pil\
      Created temporary directory: c:\users\OneWorld\anaconda3\envs\open-mmlab2\lib\site-packages\~illow-7.1.2.dist-info
      Removing file or directory c:\users\OneWorld\anaconda3\envs\open-mmlab2\lib\site-packages\pillow-7.1.2.dist-info\
      Successfully uninstalled Pillow-7.1.2
  Created temporary directory: C:\Users\OneWorld\AppData\Local\Temp\pip-unpacked-wheel-thrgvqkj

  Created temporary directory: C:\Users\OneWorld\AppData\Local\Temp\pip-unpacked-wheel-9orxl8mp

  Running setup.py develop for mmdet
    Running command 'C:\Users\OneWorld\anaconda3\envs\open-mmlab2\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\OneWorld\\Documents\\DeepLearning\\VideoObjectSegmentation\\mmdetection-2.0.0\\setup.py'"'"'; __file__='"'"'C:\\Users\\OneWorld\\Documents\\DeepLearning\\VideoObjectSegmentation\\mmdetection-2.0.0\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' develop --no-deps
    running develop
    running egg_info
    writing mmdet.egg-info\PKG-INFO
    writing dependency_links to mmdet.egg-info\dependency_links.txt
    writing requirements to mmdet.egg-info\requires.txt
    writing top-level names to mmdet.egg-info\top_level.txt
    reading manifest file 'mmdet.egg-info\SOURCES.txt'
    writing manifest file 'mmdet.egg-info\SOURCES.txt'
    running build_ext
    building 'mmdet.ops.utils.compiling_info' extension
    creating C:\Users\OneWorld\Documents\DeepLearning\VideoObjectSegmentation\mmdetection-2.0.0\build
    creating C:\Users\OneWorld\Documents\DeepLearning\VideoObjectSegmentation\mmdetection-2.0.0\build\temp.win-amd64-3.7
    creating C:\Users\OneWorld\Documents\DeepLearning\VideoObjectSegmentation\mmdetection-2.0.0\build\temp.win-amd64-3.7\Release
    creating C:\Users\OneWorld\Documents\DeepLearning\VideoObjectSegmentation\mmdetection-2.0.0\build\temp.win-amd64-3.7\Release\mmdet
    creating C:\Users\OneWorld\Documents\DeepLearning\VideoObjectSegmentation\mmdetection-2.0.0\build\temp.win-amd64-3.7\Release\mmdet\ops
    creating C:\Users\OneWorld\Documents\DeepLearning\VideoObjectSegmentation\mmdetection-2.0.0\build\temp.win-amd64-3.7\Release\mmdet\ops\utils
    creating C:\Users\OneWorld\Documents\DeepLearning\VideoObjectSegmentation\mmdetection-2.0.0\build\temp.win-amd64-3.7\Release\mmdet\ops\utils\src
    Emitting ninja build file C:\Users\OneWorld\Documents\DeepLearning\VideoObjectSegmentation\mmdetection-2.0.0\build\temp.win-amd64-3.7\Release\build.ninja...
    Compiling objects...
    Allowing ninja to set a default number of workers... (overridable by setting the environment variable MAX_JOBS=N)
    C:\Users\OneWorld\anaconda3\envs\open-mmlab2\lib\site-packages\torch\utils\cpp_extension.py:237: UserWarning: Error checking compiler version for cl: [WinError 2] The system cannot find the file specified
      warnings.warn('Error checking compiler version for {}: {}'.format(compiler, error))
    [1/1] cl /showIncludes /nologo /Ox /W3 /GL /DNDEBUG /MD /MD /wd4819 /EHsc -DWITH_CUDA -IC:\Users\OneWorld\anaconda3\envs\open-mmlab2\lib\site-packages\torch\include -IC:\Users\OneWorld\anaconda3\envs\open-mmlab2\lib\site-packages\torch\include\torch\csrc\api\include -IC:\Users\OneWorld\anaconda3\envs\open-mmlab2\lib\site-packages\torch\include\TH -IC:\Users\OneWorld\anaconda3\envs\open-mmlab2\lib\site-packages\torch\include\THC "-IC:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\include" -IC:\Users\OneWorld\anaconda3\envs\open-mmlab2\include -IC:\Users\OneWorld\anaconda3\envs\open-mmlab2\include "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\winrt" -c C:\Users\OneWorld\Documents\DeepLearning\VideoObjectSegmentation\mmdetection-2.0.0\mmdet\ops\utils\src\compiling_info.cpp /FoC:\Users\OneWorld\Documents\DeepLearning\VideoObjectSegmentation\mmdetection-2.0.0\build\temp.win-amd64-3.7\Release\mmdet\ops\utils\src/compiling_info.obj -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=compiling_info -D_GLIBCXX_USE_CXX11_ABI=0 /std:c++14
    FAILED: C:/Users/OneWorld/Documents/DeepLearning/VideoObjectSegmentation/mmdetection-2.0.0/build/temp.win-amd64-3.7/Release/mmdet/ops/utils/src/compiling_info.obj
    cl /showIncludes /nologo /Ox /W3 /GL /DNDEBUG /MD /MD /wd4819 /EHsc -DWITH_CUDA -IC:\Users\OneWorld\anaconda3\envs\open-mmlab2\lib\site-packages\torch\include -IC:\Users\OneWorld\anaconda3\envs\open-mmlab2\lib\site-packages\torch\include\torch\csrc\api\include -IC:\Users\OneWorld\anaconda3\envs\open-mmlab2\lib\site-packages\torch\include\TH -IC:\Users\OneWorld\anaconda3\envs\open-mmlab2\lib\site-packages\torch\include\THC "-IC:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\include" -IC:\Users\OneWorld\anaconda3\envs\open-mmlab2\include -IC:\Users\OneWorld\anaconda3\envs\open-mmlab2\include "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\winrt" -c C:\Users\OneWorld\Documents\DeepLearning\VideoObjectSegmentation\mmdetection-2.0.0\mmdet\ops\utils\src\compiling_info.cpp /FoC:\Users\OneWorld\Documents\DeepLearning\VideoObjectSegmentation\mmdetection-2.0.0\build\temp.win-amd64-3.7\Release\mmdet\ops\utils\src/compiling_info.obj -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=compiling_info -D_GLIBCXX_USE_CXX11_ABI=0 /std:c++14
    CreateProcess failed: The system cannot find the file specified.
    ninja: build stopped: subcommand failed.
    Traceback (most recent call last):
      File "C:\Users\OneWorld\anaconda3\envs\open-mmlab2\lib\site-packages\torch\utils\cpp_extension.py", line 1400, in _run_ninja_build
        check=True)
      File "C:\Users\OneWorld\anaconda3\envs\open-mmlab2\lib\subprocess.py", line 512, in run
        output=stdout, stderr=stderr)
    subprocess.CalledProcessError: Command '['ninja', '-v']' returned non-zero exit status 1.

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\OneWorld\Documents\DeepLearning\VideoObjectSegmentation\mmdetection-2.0.0\setup.py", line 300, in <module>
        zip_safe=False)
      File "C:\Users\OneWorld\anaconda3\envs\open-mmlab2\lib\site-packages\setuptools\__init__.py", line 144, in setup
        return distutils.core.setup(**attrs)
      File "C:\Users\OneWorld\anaconda3\envs\open-mmlab2\lib\distutils\core.py", line 148, in setup
        dist.run_commands()
      File "C:\Users\OneWorld\anaconda3\envs\open-mmlab2\lib\distutils\dist.py", line 966, in run_commands
        self.run_command(cmd)
      File "C:\Users\OneWorld\anaconda3\envs\open-mmlab2\lib\distutils\dist.py", line 985, in run_command
        cmd_obj.run()
      File "C:\Users\OneWorld\anaconda3\envs\open-mmlab2\lib\site-packages\setuptools\command\develop.py", line 38, in run
        self.install_for_development()
      File "C:\Users\OneWorld\anaconda3\envs\open-mmlab2\lib\site-packages\setuptools\command\develop.py", line 140, in install_for_development
        self.run_command('build_ext')
      File "C:\Users\OneWorld\anaconda3\envs\open-mmlab2\lib\distutils\cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "C:\Users\OneWorld\anaconda3\envs\open-mmlab2\lib\distutils\dist.py", line 985, in run_command
        cmd_obj.run()
      File "C:\Users\OneWorld\anaconda3\envs\open-mmlab2\lib\site-packages\setuptools\command\build_ext.py", line 87, in run
        _build_ext.run(self)
      File "C:\Users\OneWorld\anaconda3\envs\open-mmlab2\lib\site-packages\Cython\Distutils\old_build_ext.py", line 186, in run
        _build_ext.build_ext.run(self)
      File "C:\Users\OneWorld\anaconda3\envs\open-mmlab2\lib\distutils\command\build_ext.py", line 340, in run
        self.build_extensions()
      File "C:\Users\OneWorld\anaconda3\envs\open-mmlab2\lib\site-packages\torch\utils\cpp_extension.py", line 580, in build_extensions
        build_ext.build_extensions(self)
      File "C:\Users\OneWorld\anaconda3\envs\open-mmlab2\lib\site-packages\Cython\Distutils\old_build_ext.py", line 195, in build_extensions
        _build_ext.build_ext.build_extensions(self)
      File "C:\Users\OneWorld\anaconda3\envs\open-mmlab2\lib\distutils\command\build_ext.py", line 449, in build_extensions
        self._build_extensions_serial()
      File "C:\Users\OneWorld\anaconda3\envs\open-mmlab2\lib\distutils\command\build_ext.py", line 474, in _build_extensions_serial
        self.build_extension(ext)
      File "C:\Users\OneWorld\anaconda3\envs\open-mmlab2\lib\site-packages\setuptools\command\build_ext.py", line 208, in build_extension
        _build_ext.build_extension(self, ext)
      File "C:\Users\OneWorld\anaconda3\envs\open-mmlab2\lib\distutils\command\build_ext.py", line 534, in build_extension
        depends=ext.depends)
      File "C:\Users\OneWorld\anaconda3\envs\open-mmlab2\lib\site-packages\torch\utils\cpp_extension.py", line 562, in win_wrap_ninja_compile
        with_cuda=with_cuda)
      File "C:\Users\OneWorld\anaconda3\envs\open-mmlab2\lib\site-packages\torch\utils\cpp_extension.py", line 1140, in _write_ninja_file_and_compile_objects
        error_prefix='Error compiling objects for extension')
      File "C:\Users\OneWorld\anaconda3\envs\open-mmlab2\lib\site-packages\torch\utils\cpp_extension.py", line 1413, in _run_ninja_build
        raise RunOneWorldeError(message)
    RunOneWorldeError: Error compiling objects for extension
Cleaning up...
  Removing source in C:\Users\OneWorld\AppData\Local\Temp\pip-install-voimjxde\mmcv
Removed build tracker: 'C:\\Users\\OneWorld\\AppData\\Local\\Temp\\pip-req-tracker-6eq3f7le'
ERROR: Command errored out with exit status 1: 'C:\Users\OneWorld\anaconda3\envs\open-mmlab2\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\OneWorld\\Documents\\DeepLearning\\VideoObjectSegmentation\\mmdetection-2.0.0\\setup.py'"'"'; __file__='"'"'C:\\Users\\OneWorld\\Documents\\DeepLearning\\VideoObjectSegmentation\\mmdetection-2.0.0\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' develop --no-deps Check the logs for full command output.
Exception information:
Traceback (most recent call last):
  File "C:\Users\OneWorld\anaconda3\envs\open-mmlab2\lib\site-packages\pip\_internal\cli\base_command.py", line 186, in _main
    status = self.run(options, args)
  File "C:\Users\OneWorld\anaconda3\envs\open-mmlab2\lib\site-packages\pip\_internal\commands\install.py", line 404, in run
    use_user_site=options.use_user_site,
  File "C:\Users\OneWorld\anaconda3\envs\open-mmlab2\lib\site-packages\pip\_internal\req\__init__.py", line 71, in install_given_reqs
    **kwargs
  File "C:\Users\OneWorld\anaconda3\envs\open-mmlab2\lib\site-packages\pip\_internal\req\req_install.py", line 802, in install
    unpacked_source_directory=self.unpacked_source_directory,
  File "C:\Users\OneWorld\anaconda3\envs\open-mmlab2\lib\site-packages\pip\_internal\operations\install\editable_legacy.py", line 51, in install_editable
    cwd=unpacked_source_directory,
  File "C:\Users\OneWorld\anaconda3\envs\open-mmlab2\lib\site-packages\pip\_internal\utils\subprocess.py", line 242, in call_subprocess
    raise InstallationError(exc_msg)
pip._internal.exceptions.InstallationError: Command errored out with exit status 1: 'C:\Users\OneWorld\anaconda3\envs\open-mmlab2\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\OneWorld\\Documents\\DeepLearning\\VideoObjectSegmentation\\mmdetection-2.0.0\\setup.py'"'"'; __file__='"'"'C:\\Users\\OneWorld\\Documents\\DeepLearning\\VideoObjectSegmentation\\mmdetection-2.0.0\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' develop --no-deps Check the logs for full command output.

```

Seems like error messages, anything wrong with this?  How can I check that HTC detection is working ?

This is using Windows 10

ContentLicense: CC BY-SA 4.0

Body:
I get the following error in the last stage of the mmdetection install from
https://github.com/open-mmlab/mmdetection/blob/master/docs/install.md

when running

C:\...\mmdetection\python setup.py develop
running develop
running egg_info
writing mmdet.egg-info\PKG-INFO
writing dependency_links to mmdet.egg-info\dependency_links.txt
writing requirements to mmdet.egg-info\requires.txt
writing top-level names to mmdet.egg-info\top_level.txt
reading manifest file 'mmdet.egg-info\SOURCES.txt'
writing manifest file 'mmdet.egg-info\SOURCES.txt'
running build_ext
C:\...\torch\utils\cpp_extension.py:237: UserWarning: Error checking compiler version for cl: [WinError 2] The system cannot find the file specified

warnings.warn('Error checking compiler version for {}: {}'.format(compiler, error))

building 'mmdet.ops.utils.compiling_info' extension
Emitting ninja build file C:\...\mmdetection\build\temp.win-amd64-3.7\Release\build.ninja...
Compiling objects...
Allowing ninja to set a default number of workers... (overridable by setting the environment variable MAX_JOBS=N)

FAILED: C:/.../mmdetection/build/temp.win-amd64-3.7/Release/mmdet/ops/utils/src/compiling_info.obj
cl /showIncludes /nologo /Ox /W3 /GL /DNDEBUG /MD /MD /wd4819 /EHsc -DWITH_CUDA -IC:\torch\include -

CreateProcess failed: The system cannot find the file specified.
ninja: build stopped: subcommand failed.

Traceback (most recent call last):
  File "C:...\torch\utils\cpp_extension.py", line 1400, in _run_ninja_build
    check=True)
  File "C:\anaconda3\envs\open-mmlab\lib\subprocess.py", line 512, in run
    output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['ninja', '-v']' returned non-zero exit status 1.

During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "setup.py", line 300, in <module>
    zip_safe=False)
  File "C:...\setuptools\__init__.py", line 144, in setup
    return distutils.core.setup(**attrs)
  File "C:\...\anaconda3\envs\open-mmlab\lib\distutils\core.py", line 148, in
  File "C:\...\torch\utils\cpp_extension.py", line 1140, in _write_ninja_file_and_compile_objects
    ..............
    error_prefix='Error compiling objects for extension')
  File "C:\...\torch\utils\cpp_extension.py", line 1413, in _run_ninja_build

raise RuntimeError(message)
RuntimeError: Error compiling objects for extension

I was wondering if anyone knows what could be the cause of this error message ?

I am using windows 10

Body:
In github https://github.com/open-mmlab/mmdetection/blob/v2.0.0/docs/install.md

by following the instructions, but this time switching github tag to v2.0.0 and cloning it

typing in this

pip install -v -e .

gives the following.  :-

#sha256=a37ee82f1b8ed4b4645619c504311e71ce845b78f40055e78d71add5fab7da82 (from https://pypi.org/simple/opencv-python/)
  Skipping link: none of the wheel's tags match: cp36-cp36m-manylinux1_x86_64: https://files.pythonhosted.org/packages/72/c2/e9cf54ae5b1102020ef895866a67cb2e1aef72f16dd1fde5b5fb1495ad9c/opencv_python-4.2.0.34-cp36-cp36m-manylinux1_x86_64.whl#sha256=dcb8da8c5ebaa6360c8555547a4c7beb6cd983dd95ba895bb78b86cc8cf3de2b (from https://pypi.org/simple/opencv-python/)
  ... lots more link skipping
  Skipping link: none of the wheel's tags match: cp38-cp38-win32: https://files.pythonhosted.org/packages/e6/d6/516883f8d2f255c41d8c560ef70c91085f2ceac7b70b7afe41432bd8adbb/opencv_python-4.2.0.34-cp38-cp38-win32.whl#sha256=1ab92d807427641ec45d28d5907426aa06b4ffd19c5b794729c74d91cd95090e (from https://pypi.org/simple/opencv-python/)
  Skipping link: none of the wheel's tags match: cp38-cp38-win_amd64: https://files.pythonhosted.org/packages/df/9e/56d8b98652ecac8c8f9e59b7f00d5d99a9fa86661adcf324b8dc73351a6b/opencv_python-4.2.0.34-cp38-cp38-win_amd64.whl#sha256=e2206bb8c17c0f212f1f356d82d72dd090ff4651994034416da9bf0c29732825 (from https://pypi.org/simple/opencv-python/)
Given no hashes to check 18 links for project 'opencv-python': discarding no candidates
Using version 4.2.0.34 (newest of versions: bunch of versions....)
Collecting opencv-python>=3
  Created temporary directory: C:\Users\OneWorld\AppData\Local\Temp\pip-unpack-y8apfmt3
  Looking up "https://files.pythonhosted.org/packages/85/17/bad54f67bbe27d88ba520c3f59315e95b4e254cd28767c20accacb0597d8/opencv_python-4.2.0.34-cp37-cp37m-win_amd64.whl" in the cache
  Current age based on date: 1902095
  Ignoring unknown cache-control directive: immutable
  Freshness lifeOneWorlde from max-age: 365000000
  The response is "fresh", returning cached response
  365000000 > 1902095
  Using cached opencv_python-4.2.0.34-cp37-cp37m-win_amd64.whl (33.0 MB)
  Added opencv-python>=3 from https://files.pythonhosted.org/packages/85/17/bad54f67bbe27d88ba520c3f59315e95b4e254cd28767c20accacb0597d8/opencv_python-4.2.0.34-cp37-cp37m-win_amd64.whl#sha256=d8a55585631f9c9eca4b1a996e9732ae023169cf2f46f69e4518d67d96198226 (from mmcv>=0.5.1->mmdet==2.0.0+unknown) to build tracker 'C:\\Users\\OneWorld\\AppData\\Local\\Temp\\pip-req-tracker-6eq3f7le'
  Removed opencv-python>=3 from https://files.pythonhosted.org/packages/85/17/bad54f67bbe27d88ba520c3f59315e95b4e254cd28767c20accacb0597d8/opencv_python-4.2.0.34-cp37-cp37m-win_amd64.whl#sha256=d8a55585631f9c9eca4b1a996e9732ae023169cf2f46f69e4518d67d96198226 (from mmcv>=0.5.1->mmdet==2.0.0+unknown) from build tracker 'C:\\Users\\OneWorld\\AppData\\Local\\Temp\\pip-req-tracker-6eq3f7le'
Requirement already satisfied: future in c:\users\OneWorld\anaconda3\envs\open-mmlab2\lib\site-packages (from torch>=1.3->mmdet==2.0.0+unknown) (0.18.2)
Building wheels for collected packages: mmcv
  Created temporary directory: C:\Users\OneWorld\AppData\Local\Temp\pip-wheel-93yp2cnh
  Building wheel for mmcv (setup.py) ...   Destination directory: C:\Users\OneWorld\AppData\Local\Temp\pip-wheel-93yp2cnh
  Running command 'C:\Users\OneWorld\anaconda3\envs\open-mmlab2\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\OneWorld\\AppData\\Local\\Temp\\pip-install-voimjxde\\mmcv\\setup.py'"'"'; __file__='"'"'C:\\Users\\OneWorld\\AppData\\Local\\Temp\\pip-install-
amd64-3.7\mmcv\video\optflow_warp
  copying mmcv\video\optflow_warp\flow_warp_module.pyx -> build\lib.win-amd64-3.7\mmcv\video\optflow_warp
....etc.

  running build_ext
  skipping './mmcv/video/optflow_warp\flow_warp_module.cpp' Cython extension (up-to-date)
  building 'mmcv._ext' extension
  creating build\temp.win-amd64-3.7
  creating build\temp.win-amd64-3.7\Release
  creating build\temp.win-amd64-3.7\Release\mmcv
  creating build\temp.win-amd64-3.7\Release\mmcv\video
  creating build\temp.win-amd64-3.7\Release\mmcv\video\optflow_warp
  C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -IC:\Users\OneWorld\anaconda3\envs\open-mmlab2\lib\site-packages\numpy\core\include -IC:\Users\OneWorld\anaconda3\envs\open-mmlab2\include -IC:\Users\OneWorld\anaconda3\envs\open-mmlab2\include "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\winrt" /EHsc /Tp./mmcv/video/optflow_warp/flow_warp.cpp /Fobuild\temp.win-amd64-3.7\Release\./mmcv/video/optflow_warp/flow_warp.obj
  flow_warp.cpp
  ./mmcv/video/optflow_warp/flow_warp.cpp(37): warning C4244: '=': conversion from 'double' to 'int', possible loss of data
  ./mmcv/video/optflow_warp/flow_warp.cpp(38): warning C4244: '=': conversion from 'double' to 'int', possible loss of data
  ./mmcv/video/optflow_warp/flow_warp.cpp(59): warning C4244: '=': conversion from 'double' to 'int', possible loss of data
  ./mmcv/video/optflow_warp/flow_warp.cpp(60): warning C4244: '=': conversion from 'double' to 'int', possible loss of data
  C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -IC:\Users\OneWorld\anaconda3\envs\open-mmlab2\lib\site-packages\numpy\core\include -IC:\Users\OneWorld\anaconda3\envs\open-mmlab2\include -IC:\Users\OneWorld\anaconda3\envs\open-mmlab2\include "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\winrt" /EHsc /Tp./mmcv/video/optflow_warp\flow_warp_module.cpp /Fobuild\temp.win-amd64-3.7\Release\./mmcv/video/optflow_warp\flow_warp_module.obj
  flow_warp_module.cpp
  c:\users\OneWorld\anaconda3\envs\open-mmlab2\lib\site-packages\numpy\core\include\numpy\npy_1_7_deprecated_api.h(14) : Warning Msg: Using deprecated NumPy API, disable it with #define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION
  C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\link.exe /nologo /INCREMENTAL:NO /LTCG /DLL /MANIFEST:EMBED,ID=2 /MANIFESTUAC:NO /LIBPATH:C:\Users\OneWorld\anaconda3\envs\open-mmlab2\libs /LIBPATH:C:\Users\OneWorld\anaconda3\envs\open-mmlab2\PCbuild\amd64 "/LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\LIB\amd64" "/LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\LIB\amd64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.10240.0\ucrt\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\lib\um\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.10240.0\um\x64" /EXPORT:PyInit__ext build\temp.win-amd64-3.7\Release\./mmcv/video/optflow_warp/flow_warp.obj build\temp.win-amd64-3.7\Release\./mmcv/video/optflow_warp\flow_warp_module.obj /OUT:build\lib.win-amd64-3.7\mmcv\_ext.cp37-win_amd64.pyd /IMPLIB:build\temp.win-amd64-3.7\Release\./mmcv/video/optflow_warp\_ext.cp37-win_amd64.lib
  flow_warp_module.obj : warning LNK4197: export 'PyInit__ext' specified multiple OneWorldes; using first specification
     Creating library build\temp.win-amd64-3.7\Release\./mmcv/video/optflow_warp\_ext.cp37-win_amd64.lib and object build\temp.win-amd64-3.7\Release\./mmcv/video/optflow_warp\_ext.cp37-win_amd64.exp
  Generating code
  Finished generating code
  installing to build\bdist.win-amd64\wheel
  running install
  running install_lib
  creating build\bdist.win-amd64
  creating build\bdist.win-amd64\wheel
  creating build\bdist.win-amd64\wheel\mmcv
  creating build\bdist.win-amd64\wheel\mmcv\arraymisc
  copying build\lib.win-amd64-3.7\mmcv\arraymisc\quantization.py -> build\bdist.win-amd64\wheel\.\mmcv\arraymisc
...
... bunch of copying and creating...
...
  running install_egg_info
  Copying mmcv.egg-info to build\bdist.win-amd64\wheel\.\mmcv-0.5.8-py3.7.egg-info
  running install_scripts
  C:\Users\OneWorld\anaconda3\envs\open-mmlab2\lib\site-packages\wheel\pep425tags.py:82: RunOneWorldeWarning: Config variable 'Py_DEBUG' is unset, Python ABI tag may be incorrect
    warn=(impl == 'cp')):
  C:\Users\OneWorld\anaconda3\envs\open-mmlab2\lib\site-packages\wheel\pep425tags.py:87: RunOneWorldeWarning: Config variable 'WITH_PYMALLOC' is unset, Python ABI tag may be incorrect
    sys.version_info < (3, 8))) \
  creating build\bdist.win-amd64\wheel\mmcv-0.5.8.dist-info\WHEEL
  creating 'C:\Users\OneWorld\AppData\Local\Temp\pip-wheel-93yp2cnh\mmcv-0.5.8-cp37-cp37m-win_amd64.whl' and adding 'build\bdist.win-amd64\wheel' to it
  adding 'mmcv/__init__.py'
  adding 'mmcv/_ext.cp37-win_amd64.pyd'
  adding 'mmcv/version.py'
  adding 'mmcv/arraymisc/__init__.py'
  adding 'mmcv/arraymisc/quantization.py'
  adding 'mmcv/cnn/__init__.py'
etc...
  adding 'mmcv/visualization/optflow.py'
  adding 'mmcv-0.5.8.dist-info/METADATA'
  adding 'mmcv-0.5.8.dist-info/WHEEL'
  adding 'mmcv-0.5.8.dist-info/top_level.txt'
  adding 'mmcv-0.5.8.dist-info/RECORD'
  removing build\bdist.win-amd64\wheel
done
  Created wheel for mmcv: filename=mmcv-0.5.8-cp37-cp37m-win_amd64.whl size=184354 sha256=023fa1fdb01a9fbf7d833975737bc93003c5f1c813ce8c4ae27340b19ddb9cc3
  Stored in directory: c:\users\OneWorld\appdata\local\pip\cache\wheels\cc\7c\4c\a2cc81d990c63b3d157ab3c6e2cc4b5b298c0a4a13e6a46e38
Successfully built mmcv
Installing collected packages: addict, pyyaml, yapf, opencv-python, mmcv, Pillow, terminaltables, mmdet
  Created temporary directory: C:\Users\OneWorld\AppData\Local\Temp\pip-unpacked-wheel-n1vstot6

  Created temporary directory: C:\Users\OneWorld\AppData\Local\Temp\pip-unpacked-wheel-qqv40s97

  Created temporary directory: C:\Users\OneWorld\AppData\Local\Temp\pip-unpacked-wheel-yk9n5qrl

  Created temporary directory: C:\Users\OneWorld\AppData\Local\Temp\pip-unpacked-wheel-dmbql_3c

  Created temporary directory: C:\Users\OneWorld\AppData\Local\Temp\pip-unpacked-wheel-6vlnr7x0

  Attempting uninstall: Pillow
    Found existing installation: Pillow 7.1.2
    Uninstalling Pillow-7.1.2:
      Created temporary directory: c:\users\OneWorld\anaconda3\envs\open-mmlab2\lib\site-packages\~il
      Removing file or directory c:\users\OneWorld\anaconda3\envs\open-mmlab2\lib\site-packages\pil\
      Created temporary directory: c:\users\OneWorld\anaconda3\envs\open-mmlab2\lib\site-packages\~illow-7.1.2.dist-info
      Removing file or directory c:\users\OneWorld\anaconda3\envs\open-mmlab2\lib\site-packages\pillow-7.1.2.dist-info\
      Successfully uninstalled Pillow-7.1.2
  Created temporary directory: C:\Users\OneWorld\AppData\Local\Temp\pip-unpacked-wheel-thrgvqkj

  Created temporary directory: C:\Users\OneWorld\AppData\Local\Temp\pip-unpacked-wheel-9orxl8mp

  Running setup.py develop for mmdet
    Running command 'C:\Users\OneWorld\anaconda3\envs\open-mmlab2\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\OneWorld\\Documents\\DeepLearning\\VideoObjectSegmentation\\mmdetection-2.0.0\\setup.py'"'"'; __file__='"'"'C:\\Users\\OneWorld\\Documents\\DeepLearning\\VideoObjectSegmentation\\mmdetection-2.0.0\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' develop --no-deps
    running develop
    running egg_info
    writing mmdet.egg-info\PKG-INFO
    writing dependency_links to mmdet.egg-info\dependency_links.txt
    writing requirements to mmdet.egg-info\requires.txt
    writing top-level names to mmdet.egg-info\top_level.txt
    reading manifest file 'mmdet.egg-info\SOURCES.txt'
    writing manifest file 'mmdet.egg-info\SOURCES.txt'
    running build_ext
    building 'mmdet.ops.utils.compiling_info' extension
    creating C:\Users\OneWorld\Documents\DeepLearning\VideoObjectSegmentation\mmdetection-2.0.0\build
    creating C:\Users\OneWorld\Documents\DeepLearning\VideoObjectSegmentation\mmdetection-2.0.0\build\temp.win-amd64-3.7
    creating C:\Users\OneWorld\Documents\DeepLearning\VideoObjectSegmentation\mmdetection-2.0.0\build\temp.win-amd64-3.7\Release
    creating C:\Users\OneWorld\Documents\DeepLearning\VideoObjectSegmentation\mmdetection-2.0.0\build\temp.win-amd64-3.7\Release\mmdet
    creating C:\Users\OneWorld\Documents\DeepLearning\VideoObjectSegmentation\mmdetection-2.0.0\build\temp.win-amd64-3.7\Release\mmdet\ops
    creating C:\Users\OneWorld\Documents\DeepLearning\VideoObjectSegmentation\mmdetection-2.0.0\build\temp.win-amd64-3.7\Release\mmdet\ops\utils
    creating C:\Users\OneWorld\Documents\DeepLearning\VideoObjectSegmentation\mmdetection-2.0.0\build\temp.win-amd64-3.7\Release\mmdet\ops\utils\src
    Emitting ninja build file C:\Users\OneWorld\Documents\DeepLearning\VideoObjectSegmentation\mmdetection-2.0.0\build\temp.win-amd64-3.7\Release\build.ninja...
    Compiling objects...
    Allowing ninja to set a default number of workers... (overridable by setting the environment variable MAX_JOBS=N)
    C:\Users\OneWorld\anaconda3\envs\open-mmlab2\lib\site-packages\torch\utils\cpp_extension.py:237: UserWarning: Error checking compiler version for cl: [WinError 2] The system cannot find the file specified
      warnings.warn('Error checking compiler version for {}: {}'.format(compiler, error))
    [1/1] cl /showIncludes /nologo /Ox /W3 /GL /DNDEBUG /MD /MD /wd4819 /EHsc -DWITH_CUDA -IC:\Users\OneWorld\anaconda3\envs\open-mmlab2\lib\site-packages\torch\include -IC:\Users\OneWorld\anaconda3\envs\open-mmlab2\lib\site-packages\torch\include\torch\csrc\api\include -IC:\Users\OneWorld\anaconda3\envs\open-mmlab2\lib\site-packages\torch\include\TH -IC:\Users\OneWorld\anaconda3\envs\open-mmlab2\lib\site-packages\torch\include\THC "-IC:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\include" -IC:\Users\OneWorld\anaconda3\envs\open-mmlab2\include -IC:\Users\OneWorld\anaconda3\envs\open-mmlab2\include "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\winrt" -c C:\Users\OneWorld\Documents\DeepLearning\VideoObjectSegmentation\mmdetection-2.0.0\mmdet\ops\utils\src\compiling_info.cpp /FoC:\Users\OneWorld\Documents\DeepLearning\VideoObjectSegmentation\mmdetection-2.0.0\build\temp.win-amd64-3.7\Release\mmdet\ops\utils\src/compiling_info.obj -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=compiling_info -D_GLIBCXX_USE_CXX11_ABI=0 /std:c++14
    FAILED: C:/Users/OneWorld/Documents/DeepLearning/VideoObjectSegmentation/mmdetection-2.0.0/build/temp.win-amd64-3.7/Release/mmdet/ops/utils/src/compiling_info.obj
    cl /showIncludes /nologo /Ox /W3 /GL /DNDEBUG /MD /MD /wd4819 /EHsc -DWITH_CUDA -IC:\Users\OneWorld\anaconda3\envs\open-mmlab2\lib\site-packages\torch\include -IC:\Users\OneWorld\anaconda3\envs\open-mmlab2\lib\site-packages\torch\include\torch\csrc\api\include -IC:\Users\OneWorld\anaconda3\envs\open-mmlab2\lib\site-packages\torch\include\TH -IC:\Users\OneWorld\anaconda3\envs\open-mmlab2\lib\site-packages\torch\include\THC "-IC:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\include" -IC:\Users\OneWorld\anaconda3\envs\open-mmlab2\include -IC:\Users\OneWorld\anaconda3\envs\open-mmlab2\include "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\winrt" -c C:\Users\OneWorld\Documents\DeepLearning\VideoObjectSegmentation\mmdetection-2.0.0\mmdet\ops\utils\src\compiling_info.cpp /FoC:\Users\OneWorld\Documents\DeepLearning\VideoObjectSegmentation\mmdetection-2.0.0\build\temp.win-amd64-3.7\Release\mmdet\ops\utils\src/compiling_info.obj -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=compiling_info -D_GLIBCXX_USE_CXX11_ABI=0 /std:c++14
    CreateProcess failed: The system cannot find the file specified.
    ninja: build stopped: subcommand failed.
    Traceback (most recent call last):
      File "C:\Users\OneWorld\anaconda3\envs\open-mmlab2\lib\site-packages\torch\utils\cpp_extension.py", line 1400, in _run_ninja_build
        check=True)
      File "C:\Users\OneWorld\anaconda3\envs\open-mmlab2\lib\subprocess.py", line 512, in run
        output=stdout, stderr=stderr)
    subprocess.CalledProcessError: Command '['ninja', '-v']' returned non-zero exit status 1.

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\OneWorld\Documents\DeepLearning\VideoObjectSegmentation\mmdetection-2.0.0\setup.py", line 300, in <module>
        zip_safe=False)
      File "C:\Users\OneWorld\anaconda3\envs\open-mmlab2\lib\site-packages\setuptools\__init__.py", line 144, in setup
        return distutils.core.setup(**attrs)
      File "C:\Users\OneWorld\anaconda3\envs\open-mmlab2\lib\distutils\core.py", line 148, in setup
        dist.run_commands()
      File "C:\Users\OneWorld\anaconda3\envs\open-mmlab2\lib\distutils\dist.py", line 966, in run_commands
        self.run_command(cmd)
      File "C:\Users\OneWorld\anaconda3\envs\open-mmlab2\lib\distutils\dist.py", line 985, in run_command
        cmd_obj.run()
      File "C:\Users\OneWorld\anaconda3\envs\open-mmlab2\lib\site-packages\setuptools\command\develop.py", line 38, in run
        self.install_for_development()
      File "C:\Users\OneWorld\anaconda3\envs\open-mmlab2\lib\site-packages\setuptools\command\develop.py", line 140, in install_for_development
        self.run_command('build_ext')
      File "C:\Users\OneWorld\anaconda3\envs\open-mmlab2\lib\distutils\cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "C:\Users\OneWorld\anaconda3\envs\open-mmlab2\lib\distutils\dist.py", line 985, in run_command
        cmd_obj.run()
      File "C:\Users\OneWorld\anaconda3\envs\open-mmlab2\lib\site-packages\setuptools\command\build_ext.py", line 87, in run
        _build_ext.run(self)
      File "C:\Users\OneWorld\anaconda3\envs\open-mmlab2\lib\site-packages\Cython\Distutils\old_build_ext.py", line 186, in run
        _build_ext.build_ext.run(self)
      File "C:\Users\OneWorld\anaconda3\envs\open-mmlab2\lib\distutils\command\build_ext.py", line 340, in run
        self.build_extensions()
      File "C:\Users\OneWorld\anaconda3\envs\open-mmlab2\lib\site-packages\torch\utils\cpp_extension.py", line 580, in build_extensions
        build_ext.build_extensions(self)
      File "C:\Users\OneWorld\anaconda3\envs\open-mmlab2\lib\site-packages\Cython\Distutils\old_build_ext.py", line 195, in build_extensions
        _build_ext.build_ext.build_extensions(self)
      File "C:\Users\OneWorld\anaconda3\envs\open-mmlab2\lib\distutils\command\build_ext.py", line 449, in build_extensions
        self._build_extensions_serial()
      File "C:\Users\OneWorld\anaconda3\envs\open-mmlab2\lib\distutils\command\build_ext.py", line 474, in _build_extensions_serial
        self.build_extension(ext)
      File "C:\Users\OneWorld\anaconda3\envs\open-mmlab2\lib\site-packages\setuptools\command\build_ext.py", line 208, in build_extension
        _build_ext.build_extension(self, ext)
      File "C:\Users\OneWorld\anaconda3\envs\open-mmlab2\lib\distutils\command\build_ext.py", line 534, in build_extension
        depends=ext.depends)
      File "C:\Users\OneWorld\anaconda3\envs\open-mmlab2\lib\site-packages\torch\utils\cpp_extension.py", line 562, in win_wrap_ninja_compile
        with_cuda=with_cuda)
      File "C:\Users\OneWorld\anaconda3\envs\open-mmlab2\lib\site-packages\torch\utils\cpp_extension.py", line 1140, in _write_ninja_file_and_compile_objects
        error_prefix='Error compiling objects for extension')
      File "C:\Users\OneWorld\anaconda3\envs\open-mmlab2\lib\site-packages\torch\utils\cpp_extension.py", line 1413, in _run_ninja_build
        raise RunOneWorldeError(message)
    RunOneWorldeError: Error compiling objects for extension
Cleaning up...
  Removing source in C:\Users\OneWorld\AppData\Local\Temp\pip-install-voimjxde\mmcv
Removed build tracker: 'C:\\Users\\OneWorld\\AppData\\Local\\Temp\\pip-req-tracker-6eq3f7le'
ERROR: Command errored out with exit status 1: 'C:\Users\OneWorld\anaconda3\envs\open-mmlab2\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\OneWorld\\Documents\\DeepLearning\\VideoObjectSegmentation\\mmdetection-2.0.0\\setup.py'"'"'; __file__='"'"'C:\\Users\\OneWorld\\Documents\\DeepLearning\\VideoObjectSegmentation\\mmdetection-2.0.0\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' develop --no-deps Check the logs for full command output.
Exception information:
Traceback (most recent call last):
  File "C:\Users\OneWorld\anaconda3\envs\open-mmlab2\lib\site-packages\pip\_internal\cli\base_command.py", line 186, in _main
    status = self.run(options, args)
  File "C:\Users\OneWorld\anaconda3\envs\open-mmlab2\lib\site-packages\pip\_internal\commands\install.py", line 404, in run
    use_user_site=options.use_user_site,
  File "C:\Users\OneWorld\anaconda3\envs\open-mmlab2\lib\site-packages\pip\_internal\req\__init__.py", line 71, in install_given_reqs
    **kwargs
  File "C:\Users\OneWorld\anaconda3\envs\open-mmlab2\lib\site-packages\pip\_internal\req\req_install.py", line 802, in install
    unpacked_source_directory=self.unpacked_source_directory,
  File "C:\Users\OneWorld\anaconda3\envs\open-mmlab2\lib\site-packages\pip\_internal\operations\install\editable_legacy.py", line 51, in install_editable
    cwd=unpacked_source_directory,
  File "C:\Users\OneWorld\anaconda3\envs\open-mmlab2\lib\site-packages\pip\_internal\utils\subprocess.py", line 242, in call_subprocess
    raise InstallationError(exc_msg)
pip._internal.exceptions.InstallationError: Command errored out with exit status 1: 'C:\Users\OneWorld\anaconda3\envs\open-mmlab2\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\OneWorld\\Documents\\DeepLearning\\VideoObjectSegmentation\\mmdetection-2.0.0\\setup.py'"'"'; __file__='"'"'C:\\Users\\OneWorld\\Documents\\DeepLearning\\VideoObjectSegmentation\\mmdetection-2.0.0\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' develop --no-deps Check the logs for full command output.

Seems like error messages, anything wrong with this?  How can I check that HTC detection is working ?

This is using Windows 10


问:
How can I merge multiple commits onto another branch as a single squashed commit?
I have a remote Git server, here is the scenario which I want to perform:

For each bug/feature I create a different Git branch

I keep on committing my code in that Git branch with un-official Git messages

In top repository we have to do one commit for one bug with official Git message

So how can I merge my branch to remote branch so that they get just one commit for all my check-ins (I even want to provide commit message for this)?

答:
You can use tool I've created to make this process easier: git-squash. For example to squash all commits on feature branch that has been branched from master branch, write:</p>

```<code>git squash master
git push --force
</code>```

Body:
You can use tool I've created to make this process easier: git-squash. For example to squash all commits on feature branch that has been branched from master branch, write:

git squash master
git push --force


答:
Your result can be achieved using the following query:

SELECT Report_Date, Code, DepSite, count(DepSite) TOT_SITE
FROM #tempSite
WHERE Code ='ABCDE'
and Report_Date in ('2020-05-22', '2020-05-24')
group by ROLLUP(Report_Date, Code, DepSite)
having (Code is not null and DepSite is not null)
  or (Code is null and DepSite is null)
```

Title: How to eliminate blanks from SQL Summary Row with Totals with ROLLUP


问:
How to fix AngularJS passing string value as number in JS function parameter
I'm using AngularJS and Bootstrap 4 Accordion. Each card in the accordion will display "system information" including version number (ng-repeat from systemData object array). My application is set up to store the systems version as a text/varchar (postgres DB) as there could be multiple decimals in the version number (e.g. 6.3.1, 7.1.10, etc.)

I've created a JS function in the angular JS controller to display a particular image if the FIRST char in the version string is "8". However, the browser seems to be sending the param as a number, which is causing the JS function to fail when the version has more than 1 decimal point, because it is receiving param as "NaN".

Here is my HTML:

```<code><!-- Accordion-->
    <div class="container">
        <div id="allSystemsAccordion">
            <div class="card" ng-repeat="system in systemData track by $index">
                <div class="card-header" data-toggle="collapse" data-target="#systemsAccordionCollapse{{$index}}">
                    <img ng-show="isVersionEight({{system.version}})" ng-src="./images/logo.png" alt="logo" style="width:30px; border-radius:50%">
                    <a>{{system.version}}</a>
                </div>
                <div id="systemsAccordionCollapse{{$index}}" class="collapse" data-parent="#allSystemsAccordion">
                    <div class="card-body">
                        <a class="text-secondary">Version: </a><strong>{{system.version}}</strong><br>
                        <a class="text-secondary">Owner: </a><strong>{{system.owner}}</strong><br>
                        <a class="text-secondary">URL: </a><strong>{{system.url}}</strong><br>
                    </div>
                </div>
            </div>
    </div>
</code>```

The JS Function (within the angular controller)

```<code>$scope.isVersionEight = function(version) {
        //actual logic will go here, but below is console statements for debugging for now.
        console.log("FUNCTION VERSION AND TYPE: " + version + " " + typeof version + " toString(): " + version.toString() + " " + typeof version.toString());
    };
</code>```

Note that in the anchor tag below the image tag containing the version, as well as the version listed in the card-body, display on the UI just fine, no matter what amount of decimals are present. Also, if I print the contents of systemData (JSON) in the console, I can see the values for version surrounded by quotes, which makes me believe that the client-side is receiving a string from the server as expected, and setting it as that type.

Here is a screenshot example for an object in systemData:

Here is a screenshot of what the console outputs when the function is run:

Why is the system.version value being read as number seemingly only in this function param? How can I get it to be a string BEFORE it gets to my function? I understand I can do a toString() in my function, but this isn't helpful as the argument for my function is already "NaN".

答:
Wow, over-analysis on my part. The fix is embarrassingly simple.
I changed:
ng-show="isVersionEight({{system.version}})"

to:

ng-show="isVersionEight('{{system.version}}')"

Simply missing the quotes!

Body:
I'm using AngularJS and Bootstrap 4 Accordion. Each card in the accordion will display "system information" including version number (ng-repeat from systemData object array). My application is set up to store the systems version as a text/varchar (postgres DB) as there could be multiple decimals in the version number (e.g. 6.3.1, 7.1.10, etc.)

I've created a JS function in the angular JS controller to display a particular image if the FIRST char in the version string is "8". However, the browser seems to be sending the param as a number, which is causing the JS function to fail when the version has more than 1 decimal point, because it is receiving param as "NaN".

Here is my HTML:

                    {{system.version}}

                        Version: {{system.version}}

                        Owner: {{system.owner}}

                        URL: {{system.url}}

The JS Function (within the angular controller)

$scope.isVersionEight = function(version) {
        //actual logic will go here, but below is console statements for debugging for now.
        console.log("FUNCTION VERSION AND TYPE: " + version + " " + typeof version + " toString(): " + version.toString() + " " + typeof version.toString());
    };

Note that in the anchor tag below the image tag containing the version, as well as the version listed in the card-body, display on the UI just fine, no matter what amount of decimals are present. Also, if I print the contents of systemData (JSON) in the console, I can see the values for version surrounded by quotes, which makes me believe that the client-side is receiving a string from the server as expected, and setting it as that type.

Here is a screenshot example for an object in systemData:

Here is a screenshot of what the console outputs when the function is run:

Why is the system.version value being read as number seemingly only in this function param? How can I get it to be a string BEFORE it gets to my function? I understand I can do a toString() in my function, but this isn't helpful as the argument for my function is already "NaN".


问:
Reddit is not callable PRAW Discord.Py
When I try to run my script that collacts memes from reddit, I get this error:

```<code>Traceback (most recent call last):
  File "C:\Users\emirs\PycharmProjects\discordmasterbot\venv\lib\site-packages\discord\ext\commands\bot.py", line 892, in invoke
await ctx.command.invoke(ctx)
  File "C:\Users\emirs\PycharmProjects\discordmasterbot\venv\lib\site-packages\discord\ext\commands\core.py", line 797, in invoke
await injected(*ctx.args, **ctx.kwargs)
  File "C:\Users\emirs\PycharmProjects\discordmasterbot\venv\lib\site-packages\discord\ext\commands\core.py", line 92, in wrapped
raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: TypeError: 'Reddit' object is not callable
</code>```

And my code that trigerrs .reddit command is this:

```<code>@client.command(description="This command is not working right now")
async def reddit(self,ctx,subreddit: str =""):
    self.reddit = praw.Reddit(client_id=reddit_app_id,
client_secret=reddit_app_secret,user_agent="MASTERBOT:½s:1.0")
    if self.reddit():
        chosen_subreddit = reddit_enabled_meme_subreddits[0]
        if subreddit:
            if subreddit in reddit_enabled_meme_subreddits:
                chosen_subreddit = subreddit
            submissions = self.reddit.subreddits(chosen_subreddit).hot()
        post_to_pick = random.randint(1,10)
        for i in range(0, post_to_pick):
            submissions = next(x for x in submissions if not x.stickied)
        await ctx.send(submissions.url)
    else:
        await ctx.send("This is not working")
</code>```

And these are my id,secret and subreddits:

```<code>reddit_enabled_meme_subreddits = ["memes","dankmemes"]
reddit_app_secret = "SECRET"
reddit_app_id = "ID"
</code>```

I have everything imported, everything seems fine when I look into others but mine just doesn't work!

答:
I think your issue is at the line:

if self.reddit():
```

You're trying to call what praw.Reddit() is returning.

Perhaps try removing the parentheses.

Title: Reddit is not callable PRAW Discord.Py

Body:
When I try to run my script that collacts memes from reddit, I get this error:

Traceback (most recent call last):
  File "C:\Users\emirs\PycharmProjects\discordmasterbot\venv\lib\site-packages\discord\ext\commands\bot.py", line 892, in invoke
await ctx.command.invoke(ctx)
  File "C:\Users\emirs\PycharmProjects\discordmasterbot\venv\lib\site-packages\discord\ext\commands\core.py", line 797, in invoke
await injected(*ctx.args, **ctx.kwargs)
  File "C:\Users\emirs\PycharmProjects\discordmasterbot\venv\lib\site-packages\discord\ext\commands\core.py", line 92, in wrapped
raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: TypeError: 'Reddit' object is not callable

And my code that trigerrs .reddit command is this:

@client.command(description="This command is not working right now")
async def reddit(self,ctx,subreddit: str =""):
    self.reddit = praw.Reddit(client_id=reddit_app_id,
client_secret=reddit_app_secret,user_agent="MASTERBOT:½s:1.0")
    if self.reddit():
        chosen_subreddit = reddit_enabled_meme_subreddits[0]
        if subreddit:
            if subreddit in reddit_enabled_meme_subreddits:
                chosen_subreddit = subreddit
            submissions = self.reddit.subreddits(chosen_subreddit).hot()
        post_to_pick = random.randint(1,10)
        for i in range(0, post_to_pick):
            submissions = next(x for x in submissions if not x.stickied)
        await ctx.send(submissions.url)
    else:
        await ctx.send("This is not working")

And these are my id,secret and subreddits:

reddit_enabled_meme_subreddits = ["memes","dankmemes"]
reddit_app_secret = "SECRET"
reddit_app_id = "ID"

I have everything imported, everything seems fine when I look into others but mine just doesn't work!

Body:
I think your issue is at the line:

if self.reddit():

You're trying to call what praw.Reddit() is returning.

Perhaps try removing the parentheses.


问:
Copying and Pasting Data from one workbook to another without overwritting existing data
I am having some issues with the code I have written below, object is of code is to copy data from columns A:E and G:U in one workbook to another without overwriting existing data.

File Path of source file is written in cell H13 and destination worksheet is written in cell H6, this is done because the source file and destination worksheet vary.

```<code>Sub Dataprep2()

Application.ScreenUpdating = False

Dim ws As String
Dim wb As Workbook
Dim cwb As String

Set wb = Workbooks.Open(Range("H13").Value)

ws = ThisWorkbook.Sheets("Macro Control").Range("H6").Value

   ''' CODE ERRORS ON BELOW LINE '''

wb.Worksheets("MAL Corrections").Range("A:E").CopyDestination:=ThisWorkbook.Worksheets(ws).Range("A:E").End(xlUp).Row

wb.Close True

Application.ScreenUpdating = True

End Sub
</code>```

答:
Complicating a Consolidation

Carefully adjust the values in the constants (first) section of the
code in the Sub.

You only run the Sub.

The Functions are being called by the Sub.

The Code

```<code>Option Explicit

Sub Dataprep2()

    ' Source
    Const BookAddress As String = "H13"
    Const SourceName As String = "MAL Corrections"
    Const SourceFirstRow As Long = 2
    ' Target
    Const DataName As String = "Macro Control"
    Const TargetAddress As String = "H6"
    ' Source/Target
    Const STByColumn As Long = 1
    Dim STColumns As Variant
    STColumns = Array("A:E", "G:U")

    ' Define Data Worksheet.
    Dim wsD As Worksheet
    Set wsD = ThisWorkbook.Worksheets(DataName)
    ' Define Source Worksheet.
    Dim wbS As Workbook: Set wbS = Workbooks.Open(wsD.Range(BookAddress).Value)
    Dim wsS As Worksheet: Set wsS = wbS.Worksheets(SourceName)
    ' Define Target Worksheet
    Dim wsT As Worksheet
    Set wsT = ThisWorkbook.Worksheets(wsD.Range(TargetAddress).Value)

    ' Write values of ranges to arrays.
    Dim Source() As Variant, i As Long
    ReDim Source(UBound(STColumns))
    For i = 0 To UBound(Source)
        Source(i) = getColumns(wsS, STColumns(i), STByColumn, SourceFirstRow)
    Next i

    ' Calculate first empty row in target sheet.
    Dim TargetFirstRow As Long
    TargetFirstRow = getFirstEmptyRow(wsT, wsT.Columns(STByColumn).Column)
    If TargetFirstRow = 0 Then Exit Sub

    ' Write values of arrays to target sheet.
    Dim rng As Range
    For i = 0 To UBound(Source)
        Set rng = Intersect(wsT.Columns(STColumns(i)), wsT.Rows(TargetFirstRow))
        rng.Resize(UBound(Source(i)), UBound(Source(i), 2)).Value = Source(i)
    Next i

    wbS.Close False

End Sub

Function getColumns(Sheet As Worksheet, ByVal sourceColumns As String, _
                    Optional ByVal ByColumn As Long = 1, _
                    Optional ByVal FirstRow As Long = 1) As Variant
    Dim rng As Range, LastRow As Long
    Set rng = Sheet.Columns(sourceColumns)
    If ByColumn > rng.Columns.Count Then Exit Function
    Set rng = Sheet.Columns(sourceColumns).Columns(ByColumn) _
      .Find("*", , xlFormulas, , , xlPrevious)
    If rng Is Nothing Then Exit Function
    If rng.Row < FirstRow Then Exit Function
    getColumns = Intersect(Sheet.Columns(sourceColumns), Sheet.Rows(FirstRow)) _
                           .Resize(rng.Row - FirstRow + 1)
End Function

Function getFirstEmptyRow(Sheet As Worksheet, ByVal SourceColumn As Variant)
    Dim rng As Range
    Set rng = Sheet.Columns(SourceColumn) _
                           .Find("*", , xlFormulas, , , xlPrevious)
    If rng Is Nothing Then getFirstEmptyRow = 1: Exit Function
    If rng.Row = Sheet.Rows.Count Then Exit Function
    getFirstEmptyRow = rng.Row + 1
End Function
</code>```

Body:
I am having some issues with the code I have written below, object is of code is to copy data from columns A:E and G:U in one workbook to another without overwriting existing data.

File Path of source file is written in cell H13 and destination worksheet is written in cell H6, this is done because the source file and destination worksheet vary.

Sub Dataprep2()

Application.ScreenUpdating = False

Dim ws As String
Dim wb As Workbook
Dim cwb As String

Set wb = Workbooks.Open(Range("H13").Value)

ws = ThisWorkbook.Sheets("Macro Control").Range("H6").Value

   ''' CODE ERRORS ON BELOW LINE '''

wb.Worksheets("MAL Corrections").Range("A:E").CopyDestination:=ThisWorkbook.Worksheets(ws).Range("A:E").End(xlUp).Row

wb.Close True

Application.ScreenUpdating = True

End Sub

Body:
Complicating a Consolidation

Carefully adjust the values in the constants (first) section of the
code in the Sub.

You only run the Sub.

The Functions are being called by the Sub.

The Code

Option Explicit

Sub Dataprep2()

    ' Source
    Const BookAddress As String = "H13"
    Const SourceName As String = "MAL Corrections"
    Const SourceFirstRow As Long = 2
    ' Target
    Const DataName As String = "Macro Control"
    Const TargetAddress As String = "H6"
    ' Source/Target
    Const STByColumn As Long = 1
    Dim STColumns As Variant
    STColumns = Array("A:E", "G:U")

    ' Define Data Worksheet.
    Dim wsD As Worksheet
    Set wsD = ThisWorkbook.Worksheets(DataName)
    ' Define Source Worksheet.
    Dim wbS As Workbook: Set wbS = Workbooks.Open(wsD.Range(BookAddress).Value)
    Dim wsS As Worksheet: Set wsS = wbS.Worksheets(SourceName)
    ' Define Target Worksheet
    Dim wsT As Worksheet
    Set wsT = ThisWorkbook.Worksheets(wsD.Range(TargetAddress).Value)

    ' Write values of ranges to arrays.
    Dim Source() As Variant, i As Long
    ReDim Source(UBound(STColumns))
    For i = 0 To UBound(Source)
        Source(i) = getColumns(wsS, STColumns(i), STByColumn, SourceFirstRow)
    Next i

    ' Calculate first empty row in target sheet.
    Dim TargetFirstRow As Long
    TargetFirstRow = getFirstEmptyRow(wsT, wsT.Columns(STByColumn).Column)
    If TargetFirstRow = 0 Then Exit Sub

    ' Write values of arrays to target sheet.
    Dim rng As Range
    For i = 0 To UBound(Source)
        Set rng = Intersect(wsT.Columns(STColumns(i)), wsT.Rows(TargetFirstRow))
        rng.Resize(UBound(Source(i)), UBound(Source(i), 2)).Value = Source(i)
    Next i

    wbS.Close False

End Sub

Function getColumns(Sheet As Worksheet, ByVal sourceColumns As String, _
                    Optional ByVal ByColumn As Long = 1, _
                    Optional ByVal FirstRow As Long = 1) As Variant
    Dim rng As Range, LastRow As Long
    Set rng = Sheet.Columns(sourceColumns)
    If ByColumn > rng.Columns.Count Then Exit Function
    Set rng = Sheet.Columns(sourceColumns).Columns(ByColumn) _
      .Find("*", , xlFormulas, , , xlPrevious)
    If rng Is Nothing Then Exit Function
    If rng.Row < FirstRow Then Exit Function
    getColumns = Intersect(Sheet.Columns(sourceColumns), Sheet.Rows(FirstRow)) _
                           .Resize(rng.Row - FirstRow + 1)
End Function

Function getFirstEmptyRow(Sheet As Worksheet, ByVal SourceColumn As Variant)
    Dim rng As Range
    Set rng = Sheet.Columns(SourceColumn) _
                           .Find("*", , xlFormulas, , , xlPrevious)
    If rng Is Nothing Then getFirstEmptyRow = 1: Exit Function
    If rng.Row = Sheet.Rows.Count Then Exit Function
    getFirstEmptyRow = rng.Row + 1
End Function


问:
golang force net/http client to use IPv4 / IPv6
I' using go1.11 net/http and want to decect if a domain is ipv6-only.

What did you do?

I create my own DialContext because want I to detect if a domain is ipv6-only. code below

package main
import (
    "errors"
    "fmt"
    "net"
    "net/http"
    "syscall"
    "time"
)
func ModifiedTransport() {
    var MyTransport = &http.Transport{
        DialContext: (&net.Dialer{
            Timeout:   30 * time.Second,
            KeepAlive: 30 * time.Second,
            DualStack: false,
            Control: func(network, address string, c syscall.RawConn) error {
                if network == "ipv4" {
                    // I want to  cancel connection here client.Get("http://myexample.com") return a non-nil err.
                    return errors.New("you should not use ipv4")
                }
                return nil
            },
        }).DialContext,
        MaxIdleConns:          100,
        IdleConnTimeout:       90 * time.Second,
        TLSHandshakeTimeout:   10 * time.Second,
        ExpectContinueTimeout: 1 * time.Second,
    }
    var myClient = http.Client{Transport: MyTransport}
    resp, myerr := myClient.Get("http://www.github.com")
    if myerr != nil {
        fmt.Println("request error")
        return
    }
    var buffer = make([]byte, 1000)
    resp.Body.Read(buffer)
    fmt.Println(string(buffer))
}
func main(){
    ModifiedTransport();
}
```

I do not now how to close the request even when I can get into network == "ipv4".

addition

Python can solve the question via Force requests to use IPv4 / IPv6. I do not know how to do it in golang. Could someone one help me?
Thanks so much!

答:
I think even when the server is listening on "tcp6", client running net.Dial using "tcp" should work fine - in dual stack setups.

When I ran into this issue, the culprit was /etc/hosts. It had an entry for the host which was mapped to an ipv4 address instead of ipv6 address. This lead to connection refusal.

My test example as follows:

Client Code:

```<code>package main

import "net"
import "fmt"

func main() {
    conn, err := net.Dial("tcp", "hostname:9876")
    if err != nil {
        fmt.Println("Error in net.Dial", err)
        return
    }

    conn.Close()
    fmt.Println("Successful")
}
</code>```

Server Code:

```<code>package main

import "net"
import "fmt"

func main() {
    lis, err := net.Listen("tcp6", ":9876")
    if err != nil {
        fmt.Println("Error in listen", err)
        return
    }

    for {
        _, err := lis.Accept()
        if err != nil {
            fmt.Println("Error in Accept", err)
            return
        }
    }
}
</code>```

This code should work fine with clean /etc/hosts file on dual stack setups.

Thanks.

Body:
I' using go1.11 net/http and want to decect if a domain is ipv6-only.

What did you do?

I create my own DialContext because want I to detect if a domain is ipv6-only. code below

package main
import (
    "errors"
    "fmt"
    "net"
    "net/http"
    "syscall"
    "time"
)
func ModifiedTransport() {
    var MyTransport = &http.Transport{
        DialContext: (&net.Dialer{
            Timeout:   30 * time.Second,
            KeepAlive: 30 * time.Second,
            DualStack: false,
            Control: func(network, address string, c syscall.RawConn) error {
                if network == "ipv4" {
                    // I want to  cancel connection here client.Get("http://myexample.com") return a non-nil err.
                    return errors.New("you should not use ipv4")
                }
                return nil
            },
        }).DialContext,
        MaxIdleConns:          100,
        IdleConnTimeout:       90 * time.Second,
        TLSHandshakeTimeout:   10 * time.Second,
        ExpectContinueTimeout: 1 * time.Second,
    }
    var myClient = http.Client{Transport: MyTransport}
    resp, myerr := myClient.Get("http://www.github.com")
    if myerr != nil {
        fmt.Println("request error")
        return
    }
    var buffer = make([]byte, 1000)
    resp.Body.Read(buffer)
    fmt.Println(string(buffer))
}
func main(){
    ModifiedTransport();
}

I do not now how to close the request even when I can get into network == "ipv4".

addition

Python can solve the question via Force requests to use IPv4 / IPv6. I do not know how to do it in golang. Could someone one help me?
Thanks so much!

Body:
I think even when the server is listening on "tcp6", client running net.Dial using "tcp" should work fine - in dual stack setups.

When I ran into this issue, the culprit was /etc/hosts. It had an entry for the host which was mapped to an ipv4 address instead of ipv6 address. This lead to connection refusal.

My test example as follows:

Client Code:

package main

import "net"
import "fmt"

func main() {
    conn, err := net.Dial("tcp", "hostname:9876")
    if err != nil {
        fmt.Println("Error in net.Dial", err)
        return
    }

    conn.Close()
    fmt.Println("Successful")
}

Server Code:

package main

import "net"
import "fmt"

func main() {
    lis, err := net.Listen("tcp6", ":9876")
    if err != nil {
        fmt.Println("Error in listen", err)
        return
    }

    for {
        _, err := lis.Accept()
        if err != nil {
            fmt.Println("Error in Accept", err)
            return
        }
    }
}

This code should work fine with clean /etc/hosts file on dual stack setups.

Thanks.


问:
Re-run the same macro until last row of data
I'm a beginner. Just learning by Googleing, but cannot find a solution for this. Please help.

I want to run the below macro.
I have multiple cells named "CV_=CVCAL" in the same column.
What I want is for the macro to find the first cell with the value "CV_=CVCAL" and offset to the adjacent cell. If the adjacent cell has a particular value, if the value is below lets say "1.5" i want to fill it will a cell style 'bad'.

I want the macro to go through all the cells that have the name CV_=CVCAL and do the same thing until there is no more cells named CV_=CVCAL.

```<code>Sub If_CV()

Range("A1").Select

    Set FoundItem = Range("C1:C1000").Find("CV_=CVCAL")
    FoundItem.Offset(columnOffset:=1).Select

    If ActiveCell.Value >= 1.5 Then
    ActiveCell.Style = "Bad"

    End If

End Sub
</code>```

答:
A basic loop would be simpler:</p>

```<code>Sub If_CV()

    Dim c As Range, ws As Worksheet
    For Each ws in ActiveWorkbook.Worksheets
        For Each c in ws.Range("C1:C1000").Cells
            If c.Value = "CV_=CVCAL" Then
                With c.offset(0, 1)
                    If .Value >= 1.5 Then .Style = "Bad"
                End With
            End If
        Next ws
    Next c

End Sub
</code>```

Body:
I'm a beginner. Just learning by Googleing, but cannot find a solution for this. Please help.

I want to run the below macro.
I have multiple cells named "CV_=CVCAL" in the same column.
What I want is for the macro to find the first cell with the value "CV_=CVCAL" and offset to the adjacent cell. If the adjacent cell has a particular value, if the value is below lets say "1.5" i want to fill it will a cell style 'bad'.

I want the macro to go through all the cells that have the name CV_=CVCAL and do the same thing until there is no more cells named CV_=CVCAL.

Sub If_CV()

Range("A1").Select

    Set FoundItem = Range("C1:C1000").Find("CV_=CVCAL")
    FoundItem.Offset(columnOffset:=1).Select

    If ActiveCell.Value >= 1.5 Then
    ActiveCell.Style = "Bad"

    End If

End Sub

Body:
A basic loop would be simpler:

Sub If_CV()

    Dim c As Range, ws As Worksheet
    For Each ws in ActiveWorkbook.Worksheets
        For Each c in ws.Range("C1:C1000").Cells
            If c.Value = "CV_=CVCAL" Then
                With c.offset(0, 1)
                    If .Value >= 1.5 Then .Style = "Bad"
                End With
            End If
        Next ws
    Next c

End Sub


问:
Revert some of commits and separating them into new branch
Suppose that there is commits A, B, C and D and they're all in master branch, so the history looks like this.

```<code>A -> B -> C -> D -> HEAD.
</code>```

C and D brings some features that are not quite tested, and you need to separate them into new branch (which you should've done in the first place), test them, etc. and then merge back.

So how do i revert master to commit B and separate C and D into new branch so the branch tree looks like this?

```<code>A -> B -> master's HEAD.
      \-> C -> D -> new branch's HEAD.
</code>```

答:
Lots of ways. You want a new branch label on D and the master branch label on B.  There's the way in comments, or this slightly-shorter way:

```<code>git branch newbranch
git reset --hard @~2
</code>```

or this way that leaves you on the new branch, so there's less work tree churn if that's where you're working from:

```<code>git checkout -b newbranch
git branch -f master @~2
</code>```

one note: there's only one HEAD, it is the parent git commit will use. As a matter of clarity, branches have tips. HEAD is usually attached to (i.e. a symbolic link to) whatever you last checked out, committed, or reset to, so when you check out a branch, git sets HEAD to be a symbolic ref, an alias, for that branch tip.

Body:
Suppose that there is commits A, B, C and D and they're all in master branch, so the history looks like this.

A -> B -> C -> D -> HEAD.

C and D brings some features that are not quite tested, and you need to separate them into new branch (which you should've done in the first place), test them, etc. and then merge back.

So how do i revert master to commit B and separate C and D into new branch so the branch tree looks like this?

A -> B -> master's HEAD.
      \-> C -> D -> new branch's HEAD.

Body:
Lots of ways. You want a new branch label on D and the master branch label on B.  There's the way in comments, or this slightly-shorter way:

git branch newbranch
git reset --hard @~2

or this way that leaves you on the new branch, so there's less work tree churn if that's where you're working from:

git checkout -b newbranch
git branch -f master @~2

one note: there's only one HEAD, it is the parent git commit will use. As a matter of clarity, branches have tips. HEAD is usually attached to (i.e. a symbolic link to) whatever you last checked out, committed, or reset to, so when you check out a branch, git sets HEAD to be a symbolic ref, an alias, for that branch tip.


问:
preserve namespaces with xml.etree
When namespaces are defined in the root element of a source file, lxml reproduces all of them in the output. I need to do this with xml.etree. Even better would be to only output those that are used, but xml.etree does not find all of them.

One solution is to add the namespaces forcibly with root.set(). However, this duplicates any namespaces that xml.etree does find, as shown below.

Complete example suitable for pasting in a command prompt:

```<code>import xml.etree.ElementTree as ET
try:
    from io import StringIO
except ImportError:
    from StringIO import StringIO

def get_namespaces(sourcestring):
    sourcefile = StringIO(sourcestring)
    return dict(
        [node for _, node in ET.iterparse(sourcefile, events=['start-ns'])])

ET._namespace_map = dict()  # remove any previously registered namespaces
sourcetext = (
    '<desc xmlns="uri_a" xmlns:b="uri_b" xmlns:c="uri_c"'
    ' b:foo="c:bar">a</desc>')
source = ET.fromstring(sourcetext)
namespaces = get_namespaces(sourcetext)
for prefix, uri in namespaces.items():
    ET.register_namespace(prefix, uri)
    if prefix:
        tag = 'xmlns:' + prefix
    else:
        tag = 'xmlns'
    source.set(tag, uri)

print(ET.tostring(source, encoding='unicode'))
</code>```

The result, which causes my application to fail:

```<code><desc xmlns="uri_a" xmlns:b="uri_b" xmlns="uri_a" xmlns:b="uri_b" xmlns:c="uri_c" b:foo="c:bar">a</desc>
</code>```

This is similar to Forcing xml.etree to output "unused" namespaces, but the namespaces come from a source file so they are not known by the Python code.

答:
First, generate the output without adding the missing namespaces. Get the namespaces found from that output. Then, generate the final output by adding the namespaces that were not found.

```<code>def add_namespaces_not_found(root):
    result_with_namespaces_found = ET.tostring(root, encoding='unicode')
    namespaces_found = get_namespaces(result_with_namespaces_found)
    for prefix, uri in namespaces.items():
        if prefix not in namespaces_found:
            if prefix:
                tag = 'xmlns:' + prefix
            else:
                tag = 'xmlns'
            root.set(tag, uri)
</code>```

Result:

```<code><desc xmlns="uri_a" xmlns:b="uri_b" xmlns:c="uri_c" b:foo="c:bar">a</desc>
</code>```

Solutions that do not require generating the output twice are welcome.

Title: preserve namespaces with xml.etree

Body:
When namespaces are defined in the root element of a source file, lxml reproduces all of them in the output. I need to do this with xml.etree. Even better would be to only output those that are used, but xml.etree does not find all of them.

One solution is to add the namespaces forcibly with root.set(). However, this duplicates any namespaces that xml.etree does find, as shown below.

Complete example suitable for pasting in a command prompt:

import xml.etree.ElementTree as ET
try:
    from io import StringIO
except ImportError:
    from StringIO import StringIO

def get_namespaces(sourcestring):
    sourcefile = StringIO(sourcestring)
    return dict(
        [node for _, node in ET.iterparse(sourcefile, events=['start-ns'])])

ET._namespace_map = dict()  # remove any previously registered namespaces
sourcetext = (
    '<desc xmlns="uri_a" xmlns:b="uri_b" xmlns:c="uri_c"'
    ' b:foo="c:bar">a</desc>')
source = ET.fromstring(sourcetext)
namespaces = get_namespaces(sourcetext)
for prefix, uri in namespaces.items():
    ET.register_namespace(prefix, uri)
    if prefix:
        tag = 'xmlns:' + prefix
    else:
        tag = 'xmlns'
    source.set(tag, uri)

print(ET.tostring(source, encoding='unicode'))

The result, which causes my application to fail:

<desc xmlns="uri_a" xmlns:b="uri_b" xmlns="uri_a" xmlns:b="uri_b" xmlns:c="uri_c" b:foo="c:bar">a</desc>

This is similar to Forcing xml.etree to output "unused" namespaces, but the namespaces come from a source file so they are not known by the Python code.

Body:
First, generate the output without adding the missing namespaces. Get the namespaces found from that output. Then, generate the final output by adding the namespaces that were not found.

def add_namespaces_not_found(root):
    result_with_namespaces_found = ET.tostring(root, encoding='unicode')
    namespaces_found = get_namespaces(result_with_namespaces_found)
    for prefix, uri in namespaces.items():
        if prefix not in namespaces_found:
            if prefix:
                tag = 'xmlns:' + prefix
            else:
                tag = 'xmlns'
            root.set(tag, uri)

Result:

<desc xmlns="uri_a" xmlns:b="uri_b" xmlns:c="uri_c" b:foo="c:bar">a</desc>

Solutions that do not require generating the output twice are welcome.