问题列表 - 第189108页

Mockito Matchers.any(...)仅针对一个论点

我想做这个:

 verify(function, Mockito.times(1)).doSomething(argument1, Matchers.any(Argument2.class));
Run Code Online (Sandbox Code Playgroud)

自变量1的类型的specfic实例参数1参数2是该类型的任何实例ARGUMENT2.

但是我收到一个错误:

org.mockito.exceptions.misusing.InvalidUseOfMatchersException:  Invalid use of argument matchers! 2 matchers expected, 1 recorded. This exception may occur if matchers are combined with raw values:
    //incorrect:
    someMethod(anyObject(), "raw String"); When using matchers, all arguments have to be provided by matchers. For example:
    //correct:
    someMethod(anyObject(), eq("String by matcher"));
Run Code Online (Sandbox Code Playgroud)

按照这个建议我可以写下面的内容,一切都很好:

 verify(function, Mockito.times(1)).doSomething(Matchers.any(Argument1.class), Matchers.any(Argument2.class));
Run Code Online (Sandbox Code Playgroud)

我正在寻找Argument1类型的任何争论和Argument2类型的任何参数.

我怎样才能实现这种理想的行为?

java testing matcher mockito

9
推荐指数
1
解决办法
5534
查看次数

带有Rails的Dropzonejs从页面中删除文件

我正在使用carrierwave和dropzonejs.一切似乎都很好,但当我尝试按下删除图片按钮时,即使它从数据库中删除,图片仍保留在容器上.

这是它的样子;

在此输入图像描述

当我点击删除所有文件链接时,它变成;

在此输入图像描述

所以我点击了所有删除文件按钮,它们将从数据库中删除,但保留在页面上.我认为这是因为下面的js代码(结束部分),

<script type="text/javascript">
$(document).ready(function(){
    // disable auto discover
    Dropzone.autoDiscover = false;

    // grap our upload form by its id
    $("#picture-dropzone").dropzone({
        // restrict image size to a maximum 5MB
        maxFilesize: 5,
        // changed the passed param to one accepted by
        // our rails app
        paramName: "picture[image]",

        acceptedFiles: "image/*", 
        // show remove links on each image upload
        addRemoveLinks: true,
        // if the upload was successful
        success: function(file, response){
            // find the remove button link of the uploaded file and …
Run Code Online (Sandbox Code Playgroud)

javascript ajax refresh ruby-on-rails image

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

从相同的代码生成略有不同的APK

我开发了一款使用Parsepush notifications(GCM Google Cloud Messaging)的小游戏.但是,当我尝试将我的应用程序上传到亚马逊商店时,他们说它不会在某些设备上发布,因为它使用的是GCM.

所以,解决方案很简单,只需删除即可notifications.我遇到的问题是我想尽可能地自动生成apk代.在iOS下(我是iOS开发人员,Android新手),我只创建2个目标并使用DEFINE我可以根据目标修改代码.我想有类似的东西,所以我manifest在亚马逊版本中使用另一个,当然我删除了推送代码.

使用时我该怎么做Android Studio?我怀疑我必须使用gradle或者模块的概念,因为在创建signed apkAndroid Studio我必须选择“app” module.

你有什么想法,建议或链接吗?谢谢.

android amazon-appstore android-studio android-productflavors

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

angular-cookies绝对类型

我正在使用angularjs和创建一个应用程序typescript.我使用cookie来存储有关用户登录和权限等的相同数据.我遇到了angular-cookies.d.ts文件的问题.

$ cookieStore工作得很好但是根据AngularJS docs这个服务已被弃用,所以我尝试使用$ cookies代替.使用$ cookies在编译时导致错误,Property 'put' does not exist因此我检查了定义,并且在ICookiesService接口中确实没有具有此类名称的属性.

declare module "angular-cookies" {
    var _: string;
    export = _;
}

declare module angular.cookies {

    interface ICookiesService {
        [index: string]: any;
    }

    interface ICookieStoreService {
        get(key: string): any;
        put(key: string, value: any): void;
        remove(key: string): void;
    }
}
Run Code Online (Sandbox Code Playgroud)

这种类型定义中是否存在错误或我做错了什么?谢谢你的回复.

typescript definitelytyped angular-cookies

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

Silverlight无法使用chrome

我已经更新了Chrome,我安装了Silverlight,但它无法运行.我试图重新安装Silverlight,看看chrome:plugins,我无法在那里找到它.我重新启动了我的机器几次,它不会工作.

但同时Silverlight在IE11中运行良好.

silverlight google-chrome

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

无法获得%宽度来处理div表

因此,我正在为网站制作每日计划视图,但我无法格式化它.这是我下面的代码:

CSS

.responsive-calendar .controls {
    color: #666;
    font-weight: normal;
    font-size: 18px;
    font-family: "Open Sans",Arial,Verdana,sans-serif;
    text-align: left;
}

.responsive-calendar .controls a {
    cursor: pointer;
}

.responsive-calendar .controls h4 {
    display: inline;
}

.responsive-calendar .day-headers, .responsive-calendar .days, .responsive-calendar .timeslots {
    font-size: 0;
}

.responsive-calendar .header {
    background-color: #f3f2f2 !important;
    box-shadow: 0px 1px 0px 0px rgb(255, 255, 255) inset;
    color: rgb(102, 102, 102);
    font-size: 13px;
    line-height: 18px;
    padding: 10px 0px;
    font-weight: bold;
    cursor:default !important;
}

/* Daily Planner CSS */
.responsive-calendar .timeslot { …
Run Code Online (Sandbox Code Playgroud)

html css twitter-bootstrap

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

重载乘法运算符失败

我正在尝试为AVR项目编写RGB类.但是当我尝试使用它时,它在某些运营商处失败了.

Error   415 no match for 'operator*' (operand types are 'const float' and 'RGB')    ...\Animation\Wall\Wall.cpp 321 18  Cube
Run Code Online (Sandbox Code Playgroud)

以下是它的外观:

class RGB
{
//variables
public:
    uint8_t r, g, b;
//functions
public:
    RGB();
    //assignment
    RGB &operator=( const RGB &other );

    RGB &operator+(const RGB &other);

    RGB &operator* (const uint8_t &other);
    RGB &operator* (const float &other);
//some more operators here
}; //RGB
Run Code Online (Sandbox Code Playgroud)

并实施:

RGB::RGB(): r(0), g(0), b(0)
{
}

RGB &RGB::operator=( const RGB &other)
{
    if(this != &other) //no self assignment
    {
        r = …
Run Code Online (Sandbox Code Playgroud)

c++ operator-overloading

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

大熊猫用大写字母排序

运行此代码:

df = pd.DataFrame(['ADc','Abc','AEc'],columns = ['Test'],index=[0,1,2])
df.sort(columns=['Test'],axis=0, ascending=False,inplace=True)
Run Code Online (Sandbox Code Playgroud)

返回有序的数据帧列:[Abc, AEc, ADc].ADc应该在AEc之前,发生了什么?

sorting pandas

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

c++ 如何打印另一种类型变量的 String 属性的值?

String我想在控制台中显示 C++ 的值 -但该特定值String不是独立定义的 - 它是另一种类型变量的属性...我当前尝试用来显示其值的行是:

printf("\n CSARSixSectorItem.cpp line 530. rm_WPSequence[liSARIndex -1]: %s", rm_WPSequence[liSARIndex-1].rm_RefPointDB->m_Name);
Run Code Online (Sandbox Code Playgroud)

在引号之外,我将变量:传递rm_WPSequence[liSARIndex-1].rm_RefPointDB->m_Name给.%sprintf

m_Name是 String 类型的变量,定义为:

std::string m_Name;
Run Code Online (Sandbox Code Playgroud)

rm_RefPointDB是一个指向 a 的指针CGenericRefPoint,定义为:

CGenericRefPoint * rm_RefPointDB;
Run Code Online (Sandbox Code Playgroud)

rm_WPSequence 的vector定义如下:

vector< CUserWaypointListElement > rm_WPSequence;
Run Code Online (Sandbox Code Playgroud)

但是,虽然我尝试显示的实际变量是 a string,但当在控制台中打印该行时,我没有给出字符串的内容,而是给出一些不可读的字符,例如L,%...显示的字符每次都会改变该行被打印。我想知道这是否是因为它String是另一个变量的成员?如果是这样,我怎样才能显示字符串的值?我真的不想知道有关其父变量的任何信息,但是我还需要做其他事情才能单独访问字符串吗?

c++ string

6
推荐指数
1
解决办法
7854
查看次数

粘性导航栏有故障行为

所以我尝试定制一个导航栏,它设置在页面边框的正下方。我做了一个插图来帮助解释: 在此处输入图片说明

在页面上,我在整个页面周围有一个边框(蓝色),然后是导航栏(红色),它会随着页面滚动,直到它到达导航栏的顶部并一直保持到用户向上滚动为止。

我的问题是,一旦 js 启动(当用户滚动超过顶部边框时),似乎有什么东西将我的导航栏及其内容向右推,做出明显的猛拉动作。

在此处输入图片说明

这是我的 html:

    <html>
    <head>
      <title>Title</title>
      <%= stylesheet_link_tag    'application', media: 'all', 'data-turbolinks-track' => true %>
      <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
      <%= csrf_meta_tags %>
    </head>

    <body>
      <%= yield :scss %>

      <div class="container-main <%= layout %>">

        <nav class="main-nav">
          <a class="navbar-brand" href="#">
            <i class="fa fa-bars menu-icon"></i>
          </a>
        </nav>

        <div class="container">
          <%= yield %>
        </div>

      </div>

      <%= yield :js %>

    </body>
    </html>
Run Code Online (Sandbox Code Playgroud)

有谁知道如何解决这个问题?我不确定它是否是需要覆盖的引导程序还是什么......我试图设置导航栏的左边距以等同于运动,但它最终弄乱了我设置的引导程序列.. .任何建议表示赞赏!

这是我的 CSS:

    .main-nav {
      text-align: center;
      margin-top: 50px;
      background: transparent;
      height: 50px;
      z-index: 150; …
Run Code Online (Sandbox Code Playgroud)

javascript css jquery twitter-bootstrap

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