小编K.T*_*ess的帖子

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

$ elem.hide不是angular-datatable中的函数

我想使用分页插件angular-datatable.我用bower安装它但它不起作用.它给出了以下错误

TypeError:$ elem.hide不是postLink上的Object.showLoading(http:// localhost:8000/vendor/angular-datatables.js:698:15)中的函数(http:// localhost:8000/vendor/angular- datatables.js:47:31)在nodeLinkFn上的http:// localhost:8000/vendor/angular.js:8783:44 at invokeLinkFn(http:// localhost:8000/vendor/angular.js:8789:9)http:// localhost:8000/vendor/angular.js:8289:11)在compositeLinkFn(http:// localhost:8000/vendor/angular.js:7680:13)的compositeLinkFn(http:// localhost:8000 /) vendor/angular.js:7684:13)在compositeLinkFn(http:// localhost:8000/vendor/angular.js:7684:13)在compositeLinkFn(http:// localhost:8000/vendor/angular.js:7684:13)的compositeLinkFn(http:// localhost:8000 /) vendor/angular.js:7684:13)

我使用Zero配置,这是我使用的html代码

<table datatable="" class="row-border hover">
    <thead>
        <tr>
            <th>ID</th>
            <th>First name</th>
            <th>Last name</th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td>1</td>
            <td>Foo</td>
            <td>Bar</td>
        </tr>
        <tr>
            <td>123</td>
            <td>Someone</td>
            <td>Youknow</td>
        </tr>
        <tr>
            <td>987</td>
            <td>Iamout</td>
            <td>Ofinspiration</td>
        </tr>
    </tbody>
</table>
Run Code Online (Sandbox Code Playgroud)

npm angularjs bower angular-datatables

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

解释这个关于对象引用转换的输出?

interface I {
}
class A {
}
class B {
}
public class Test {
    public static void main(String args[]) {
        A a = null;
        B b = (B)a; // error: inconvertible types

        I i = null;
        B b1 = (B)i;
    }
}
Run Code Online (Sandbox Code Playgroud)

我知道为什么a不能被施展B,因为B不是从继承A.
我的问题是,为什么B b1 = (B)i;允许,因为B不是实现I
为什么B b1 = (B)i;这一行不会强制运行时异常,因为它i是null?

java casting interface

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

解释在java中访问内部类的方法?

class Outer {    
    class Inner {       

    }    
}

public class Demo {
    public static void main(String args[]) {

        Outer o = new Outer();
        Outer.Inner inner = o.new Inner();    

    }    
}
Run Code Online (Sandbox Code Playgroud)

我为Inner类对象创建引用的方式就像访问类中的static成员一样Outer
你能解释一下这背后的机制吗?

java inner-classes

7
推荐指数
2
解决办法
8965
查看次数

使用子类名访问父类静态字段不会加载子类?

class A {
    static int super_var = 1;
    static {
        System.out.println("super");
    }
}

class B extends A {
    static int sub_var = 2;
    static {
        System.out.println("sub");
    }    
}
public class Demo{
    public static void main(String []args){
        System.out.println(B.super_var);
    }
}
Run Code Online (Sandbox Code Playgroud)

产出是:

super
1
Run Code Online (Sandbox Code Playgroud)

这意味着子类不会加载或任何其他东西?它是如何工作的?

java inheritance static

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

手动触发焦点输入Iphone问题

我试图在点击另一个元素后聚焦textarea.桌面浏览器似乎工作正常但不是Iphone.

$('.reveal_below').on('change', function(e) {

    e.preventDefault();
    var item_id = $(this).attr('data-item-id');
    if (this.checked) {

        $('.hidden_below__' + item_id).css({
                        'margin-left': '0px',
                        display: 'block',
                        opacity: '0'
                    }).animate({ 
                       'margin-left': '15px',
                        opacity: '1'
        }, 
 250, function() {
    console.log("-----------");
    $("#x").focus();
})
    } else {
        $('.hidden_below__' + item_id).slideUp();
    }
});
Run Code Online (Sandbox Code Playgroud)

这是一个小小的演示

它会将textarea集中在复选框的更改事件上.这就是问题,如何通过演示中的动画来解决这个问题?

iphone jquery onfocus ios

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

使用 spring security 连续 3 次登录尝试失败后阻止用户帐户

如何保存连续登录失败的次数,以及如何在达到3次连续登录失败后阻止用户帐户?

我所能做的,使用实施AuthenticationFailureHandlerApplicationListenerAuthenticationFailureBadCredentialsEvent?如果是这样怎么办?

authentication spring-mvc spring-security

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

JVM如何在Java中加载父类

码:

class A {
    static {
        System.out.println("loading A static 1");
    }
    static {
        System.out.println("loading A static 2 B.c= "+B.c);        
    }
    static {
        System.out.println("loading static 3");
    }
    static int a=10; 
    A(){        
    }
}

class B extends A{
    static {
       System.out.println("loading B A.a= "+A.a);
    }
    static int c = 50;
}
public class Test {
    public static void main(String[] args) {
        new B();
    }
}
Run Code Online (Sandbox Code Playgroud)

输出:

loading A static 1
loading A static 2 B.c= 0
loading static 3
loading B A.a= …
Run Code Online (Sandbox Code Playgroud)

java inheritance initialization classloader

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

Laravel 4.2 BIT数据类型问题

bit(1)数据库表中有一个类型列.但它不像我预期的那样工作.

问题是

$invitee = new Invitee();
$invitee->name = "name1";
$invitee->email = "example@mail.com";
$invitee->isActive = 0;    // "b'0'", '0', false,   are also not working
$invitee->save();
Run Code Online (Sandbox Code Playgroud)

我需要0isActive列中放置零,但1每当我尝试使用a添加记录时,它的值都会增加0.

我在这里发现了一个问题..但答案并没有描述问题的原因.很高兴,如果有人能解释这个问题.

mysql bit laravel-4

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

解释这个输出

class A {
    private int a = 10;

    public int getA() {
        return a;
    }

    public void setA(int a) {
        this.a = a;       
    }    
}

class B extends A {
    public int a = 20;
}

public class Demo {
    public static void main(String args[]) {
        B a = new B();
        System.out.println(a.getA());        
    }
}
Run Code Online (Sandbox Code Playgroud)

输出:10
因为父类中的所有字段都存在于Child对象中,所以在Child对象中有两个共享相同名称(a)和getter和setter的字段,因此java如何解析父对象中的私有字段的getter和setter方法上课?

java inheritance getter-setter

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