小编Ami*_*Pal的帖子

哪里可以找到"Microsoft.VisualStudio.TestTools.UnitTesting"缺少dll?

我在C#visual studio项目中遇到以下错误:

命名空间"Microsoft"中不存在类型或命名空间名称"VisualStudio"(您是否缺少程序集引用?)

我也试图找到microsoft.dll文件,但无法获得任何参考.我在搜索错误的DLL吗?

using Microsoft.VisualStudio.TestTools.UnitTesting;  
using Kya.MsFx.Services.Swiper;

namespace Kya.MsFx.Devices.Swiper.Test
{
[TestClass]
public class SwiperWindowTest
{

    private SwiperWebServiceHost m_SwiperWS = null;
    /// <summary>
    ///     start web service on a separate thread, so tests 
    ///     can be executed withut blocking the application thread
    /// </summary>
    [ClassInitialize]
    public void SetupSwiperTests() {

        m_SwiperWS = SwiperWebServiceHost.StartService();

    }

    /// <summary>
    /// Stop service started during class initialize and kill the thread
    /// </summary>
    [ClassCleanup]
    public void CleanupSwiperTests() {
        m_SwiperWS.Stop();
    }


    /// <summary>
    ///   simulate init, …
Run Code Online (Sandbox Code Playgroud)

c# dll visual-studio-2010

122
推荐指数
6
解决办法
13万
查看次数

如何在android中为每个不同的屏幕大小定义dimens.xml?

Android中支持不同的屏幕尺寸(密度)时,通常关注的是为每个可能的屏幕创建不同的布局.IE

  • LDPI
  • MDPI
  • 华电国际
  • xhdpi
  • xxhdpi
  • xxxhdpi

我为xhdpi屏幕设计了一个布局作为参考,并在dimens.xml中定义了它的尺寸.现在我想支持每个可能的屏幕尺寸.我怎样才能做到这一点?

据我所知,我可以使用工具找出适合其他屏幕尺寸的dimens.xml并将其添加到我的项目中.这是在我的情况下这样做的正确方法吗?

另一个问题,我是否只需要为上面的屏幕尺寸创建dimens.xml?如果是,那么是什么w820dp

谢谢你的帮助.我只需要支持手机(不是平板电脑或其他设备).

android android-layout android-screen-support android-activity

118
推荐指数
7
解决办法
14万
查看次数

CMake无法找到BOOST库

我尝试了一切:

  1. 配置环境变量
  2. 做新鲜的
  3. 从源代码重新安装BOOST
  4. sudo apt-get install libboost-all-dev

但仍然得到以下错误:

CMake Error at /usr/share/cmake-2.8/Modules/FindBoost.cmake:1131 (message):
 Unable to find the requested Boost libraries.

 Unable to find the Boost header files.  Please set BOOST_ROOT to the root
 directory containing Boost or BOOST_INCLUDEDIR to the directory containing
 Boost's headers.
Call Stack (most recent call first):
   CMakeLists.txt:147 (find_package)


CMake Error at /usr/share/cmake-2.8/Modules/FindBoost.cmake:1131 (message):
Unable to find the requested Boost libraries.

Unable to find the Boost header files.  Please set BOOST_ROOT to the root
directory containing …
Run Code Online (Sandbox Code Playgroud)

c++ bash boost cmake

48
推荐指数
3
解决办法
9万
查看次数

Cmake无法找到Python库

得到此错误:

sudo: unable to resolve host coderw@ll
-- Could NOT find PythonLibs (missing:  PYTHON_LIBRARIES PYTHON_INCLUDE_DIRS) 
CMake Error at /usr/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:108     
(message):
Could NOT find PythonInterp (missing: PYTHON_EXECUTABLE)
Call Stack (most recent call first):
/usr/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:315  
(_FPHSA_FAILURE_MESSAGE)
/usr/share/cmake-2.8/Modules/FindPythonInterp.cmake:139 
(FIND_PACKAGE_HANDLE_STANDARD_ARGS)
Code/cmake/Modules/FindNumPy.cmake:10 (find_package)
CMakeLists.txt:114 (find_package)



-- Configuring incomplete, errors occurred!
See also "/home/coderwall/Desktop/rdkit/build/CMakeFiles/CMakeOutput.log".
See also "/home/coderwall/Desktop/rdkit/build/CMakeFiles/CMakeError.log".
Run Code Online (Sandbox Code Playgroud)

我已经安装了:

  1. sudo apt-get install python-dev
  2. 环境变量已设置如下:

    PYTHON_INCLUDE_DIRS=/usr/include/python2.7 
    PYTHON_LIBRARIES=/usr/lib/python2.7/config/libpython2.7.so
    
    Run Code Online (Sandbox Code Playgroud)

位置python.h:/usr/lib/include/python2.7/python.h

pythonlibs的位置:/usr/lib/python2.7/ 如何解决这个问题?

python cmake python-2.7

34
推荐指数
7
解决办法
7万
查看次数

如何在processStartInfo中传递多个参数?

我想cmdc#代码中运行一些命令.我跟着一些博客和教程得到了答案,但我有点困惑,即我应该如何传递多个参数?

我使用以下代码:

System.Diagnostics.Process process = new System.Diagnostics.Process();
System.Diagnostics.ProcessStartInfo startInfo = new System.Diagnostics.ProcessStartInfo();
startInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Normal;
startInfo.FileName = "cmd.exe";
startInfo.Arguments = 
...
Run Code Online (Sandbox Code Playgroud)

startInfo.Arguments以下命令行代码的值是多少?

  • makecert -sk server -sky exchange -pe -n CN=localhost -ir LocalMachine -is Root -ic MyCA.cer -sr LocalMachine -ss My MyAdHocTestCert.cer

  • netsh http add sslcert ipport=127.0.0.1:8085 certhash=0000000000003ed9cd0c315bbb6dc1c08da5e6 appid={00112233-4455-6677-8899-AABBCCDDEEFF} clientcertnegotiation=enable

c# cmd makecert netsh

32
推荐指数
2
解决办法
9万
查看次数

在Django模型中保存时区

我正在Django中创建一个表单.我必须输入一个输入类型字段,该字段仅存储数据库中的时区(用户将从表单下拉列表中选择).我无法找到创建此时区模型的任何方法,以及它将如何根据保存的时区返回本地时间.我选择了以下字段,但它也存储了分钟和秒

 timestamp = models.DateTimeField()
Run Code Online (Sandbox Code Playgroud)

下拉列表应采用以下形式:... GMT +5:30 GMT +6:00 ......依此类推.

python django timezone django-models

17
推荐指数
4
解决办法
1万
查看次数

获取错误107(net :: ERR_SSL_PROTOCOL_ERROR):SSL协议错误

我知道在stackoverflow上有很多与相同主题相关的问题,但在这里我有一些不同的问题:

我用的installer classreserve a portbind it with hashwin7/Winxp:

if (Environment.OSVersion.Version.Major > 5)
{
    startInfo.Arguments = @"/c netsh http add urlacl url=https://127.0.0.1:8083/ user=EVERYONE";
    netsh http add sslcert ipport=127.0.0.1:8083 certhash=df03c4b0b32f3302a3b70abe6b5dfd864d0986a5 appid={00112233-4455-6677-8899-CCBBCCDDEEFF} clientcertnegotiation=enable;
}
else
{
    startInfo.Arguments = @"/c httpcfg set urlacl /u https://127.0.0.1:8083/";
    httpcfg set ssl -i 127.0.0.1:8083 -h df03c4b0b32f3302a3b70abe6b5dfd864d0986a5 -f 2
}
Run Code Online (Sandbox Code Playgroud)

代码没有问题setup project.一切正常,除了以下几点:

  • 每当我安装exewin7它运行WCF成功的web服务.
  • 每当我WinXP(SP#)在我的本地机器上使用它时会抛出一个错误:

    错误107(net :: ERR_SSL_PROTOCOL_ERROR):SSL协议错误

  • 但是当我使用teamviewer登录任何WinXp虚拟机时,它运行成功.

怎么可能,我试了好几次但得到了同样的结果.它运行在Xp(在VM上运行)但不在真正的XP机器上运行? …

c# ssl windows-xp httpcfg.exe visual-studio-2010

16
推荐指数
1
解决办法
6915
查看次数

如何从另一个文件调用python类函数

我在parser.py文件中有这个类

class HostInfo(object):
def __init__(self, host_id):
    self.osclass = []
    self.osmatch = []
    self.osfingerprint = []
    self.portused = []
    self.ports = []
    self.extraports = []
    self.tcpsequence = {}
    self.hostnames = []
    self.tcptssequence = {}
    self.ipidsequence = {}
    self.trace = {'port': '', 'proto': '', 'hop': []}
    self.status = {}
    self.address = []
    self.hostscript = []

    # Umit extension
    self.id = host_id
    self.comment = ''

    # XXX this structure it not being used yet.
    self.nmap_host = {
            'status': {'state': '', 'reason': ''},
            'smurf': …
Run Code Online (Sandbox Code Playgroud)

python

15
推荐指数
1
解决办法
2万
查看次数

如何在java执行器类中停止所有可运行的线程?

final ExecutorService executor = Executors.newFixedThreadPool(1);
final Future<?> future = executor.submit(myRunnable);
executor.shutdown();
if(executor.awaitTermination(10, TimeUnit.SECONDS)) {
  System.out.println("task completed");
}else{
  System.out.println("Executor is shutdown now");
}

//MyRunnable method is defined as task which I want to execute in a different thread.
Run Code Online (Sandbox Code Playgroud)

这是run执行者类的方法:

public void run() {
try {
     Thread.sleep(20 * 1000);
} catch (InterruptedException e) {
 // TODO Auto-generated catch block
 e.printStackTrace();
}}
Run Code Online (Sandbox Code Playgroud)

在这里它等待20第二,但是当我运行代码时它抛出一个异常:

java.lang.InterruptedException: sleep interrupted
at java.lang.Thread.sleep(Native Method)
Run Code Online (Sandbox Code Playgroud)

我无法关闭并发线程破坏Java Executor class.这是我的代码流程:

  • 创建一个带有Java执行器类的新线程来运行一些任务,即写入 MyRunnable
  • executor 等待10秒钟完成任务.
  • 如果任务已完成,则runnable线程也会终止. …

java multithreading executorservice

13
推荐指数
2
解决办法
5万
查看次数

如何在Visual c ++中将字节数组转换为十六进制字符串?

方法声明如下:

//some.h
void TDES_Decryption(BYTE *Data, BYTE *Key, BYTE *InitalVector, int Length);
Run Code Online (Sandbox Code Playgroud)

我从以下代码调用此方法:

//some.c
extern "C" __declspec(dllexport) bool _cdecl OnDecryption(LPCTSTR stringKSN, LPCTSTR BDK){
    TDES_Decryption(m_Track1Buffer, m_cryptoKey, init_vector, len);
    return m_Track1Buffer;
}
Run Code Online (Sandbox Code Playgroud)

其中数据类型m_Track1BufferBYTE m_Track1Buffer[1000]; 现在我想在上面的方法中进行一些更改,即想要返回String in hex而不是Byte.我应该如何将其转换m_Track1bufferHex string

c++ string hex visual-c++

10
推荐指数
4
解决办法
4万
查看次数