小编gvl*_*sov的帖子

罗盘和萨斯之间的区别?

我知道这是一个愚蠢的问题,但我一直在搜索谷歌,我找不到任何答案:/那么SASS和指南针,SASS和SCSS之间有什么区别?我真的很困惑.

谢谢你的任何信息:)

sass compass-sass

49
推荐指数
4
解决办法
9066
查看次数

如何在YII2中将控制器中的参数传递给布局

我想从控制器发送参数到布局(即main.php).但是我无法在main.php中获得参数

我试过了:

控制器代码:

$this->render('index',array('param' => $paramValue));
Run Code Online (Sandbox Code Playgroud)

这就是我试图在布局中得到这个的方式.main.php

  1. $this->param (如yii 1)
  2. $param

但我无法在布局中获得参数值.谁能告诉我怎么做?

php yii2

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

如何创建接口的匿名实现?

我有一个界面:

interface TileSet {
    fun contains(x: Int, y: Int) : Boolean
}
Run Code Online (Sandbox Code Playgroud)

我希望能够创建多组瓷砖(瓷砖是一对x和y整数坐标):

fun TileSet.union(another: TileSet) : TileSet = 
   // ..
Run Code Online (Sandbox Code Playgroud)

在Java 8中,我可以这样做:

@FunctionalInterface
public interface TileSet {
    boolean contains(int x, int y);

    public default TileSet unite(TileSet another) {
        return (x, y) -> TileSet.this.contains(x, y) && another.contains(x, y);
    }
}
Run Code Online (Sandbox Code Playgroud)

所以接口是用lambda实现的TileSet#unite().或者它可以用旧的匿名类方法实现:

public default TileSet unite(TileSet another) {
    return new TileSet() {
         @Override
         public boolean contains(int x, int y) {
             return TileSet.this.contains(x, y) && another.contains(x, y);
         }
    }
} …
Run Code Online (Sandbox Code Playgroud)

interface kotlin

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

如何从Java中的特定字符串中删除特定字符?

例如,我从文本文件中提取文本字符串,我需要这些字来形成一个数组.但是,当我做所有这些时,一些单词以逗号(,)或句号(.)结尾,或者甚至附加括号(这都是完全正常的).

我想要做的就是摆脱那些角色.我一直试图在Java中使用那些预定义的String方法来做到这一点,但我无法解决它.

java string immutability

40
推荐指数
3
解决办法
13万
查看次数

怎么做功能组合?

虽然不耐烦地等待Java 8发布,在阅读Brian Goetz的精彩"Lambda状态"文章之后,我注意到功能组合根本没有被覆盖.

根据上面的文章,在Java 8中应该可以:

// having classes Address and Person
public class Address {

    private String country;

    public String getCountry() {
        return country;
    }
}

public class Person {

    private Address address;

    public Address getAddress() {
        return address;
    }
}

// we should be able to reference their methods like
Function<Person, Address> personToAddress = Person::getAddress;
Function<Address, String> addressToCountry = Address::getCountry;
Run Code Online (Sandbox Code Playgroud)

现在,如果我想将这两个函数组合成一个函数映射Person到country,我怎样才能在Java 8中实现这一点?

java java-8

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

Spring 4和Java 8无效的字节标记异常

我试图使用Spring和Java 8 JDK运行一个简单的JUnit测试:

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = {"classpath:applicationContext.xml"})
@WebAppConfiguration
public class UserServicesTest{

  @Test
  public void testJava8() {
    Set<String> strings = new HashSet<>();
    strings.add("a");
    strings.add("b");
    strings.add("c");
    strings.stream().filter(a -> a.equals("a")).forEach(p -> p.toString());
  }
Run Code Online (Sandbox Code Playgroud)

我在启动时遇到了这个运行时错误:

org.aspectj.apache.bcel.classfile.ClassFormatException: Invalid byte tag in constant pool: 18
    at org.aspectj.apache.bcel.classfile.Constant.readConstant(Constant.java:133)
    at org.aspectj.apache.bcel.classfile.ConstantPool.<init>(ConstantPool.java:45)
    at org.aspectj.apache.bcel.classfile.ClassParser.readConstantPool(ClassParser.java:186)
    at org.aspectj.apache.bcel.classfile.ClassParser.parse(ClassParser.java:131)
    at org.aspectj.apache.bcel.util.NonCachingClassLoaderRepository.loadJavaClass(NonCachingClassLoaderRepository.java:262)
    at org.aspectj.apache.bcel.util.NonCachingClassLoaderRepository.loadClass(NonCachingClassLoaderRepository.java:242)
    at org.aspectj.apache.bcel.util.NonCachingClassLoaderRepository.loadClass(NonCachingClassLoaderRepository.java:249)
    at org.aspectj.weaver.reflect.Java15AnnotationFinder.getAnnotations(Java15AnnotationFinder.java:202)
    at org.aspectj.weaver.reflect.ReflectionBasedResolvedMemberImpl.unpackAnnotations(ReflectionBasedResolvedMemberImpl.java:211)
    at org.aspectj.weaver.reflect.ReflectionBasedResolvedMemberImpl.hasAnnotation(ReflectionBasedResolvedMemberImpl.java:163)
    at org.aspectj.weaver.patterns.ExactAnnotationTypePattern.matches(ExactAnnotationTypePattern.java:109)
    at org.aspectj.weaver.patterns.ExactAnnotationTypePattern.matches(ExactAnnotationTypePattern.java:96)
    at org.aspectj.weaver.patterns.AnnotationPointcut.matchInternal(AnnotationPointcut.java:156)
    at org.aspectj.weaver.patterns.Pointcut.match(Pointcut.java:137)
    at org.aspectj.weaver.internal.tools.PointcutExpressionImpl.getShadowMatch(PointcutExpressionImpl.java:239)
    at org.aspectj.weaver.internal.tools.PointcutExpressionImpl.matchesExecution(PointcutExpressionImpl.java:105)
    at org.aspectj.weaver.internal.tools.PointcutExpressionImpl.matchesMethodExecution(PointcutExpressionImpl.java:96)
    at org.springframework.aop.aspectj.AspectJExpressionPointcut.getShadowMatch(AspectJExpressionPointcut.java:404)
    at org.springframework.aop.aspectj.AspectJExpressionPointcut.matches(AspectJExpressionPointcut.java:271)
    at org.springframework.aop.support.AopUtils.canApply(AopUtils.java:224)
    at …
Run Code Online (Sandbox Code Playgroud)

java spring java-ee java-8

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

Yii2:为什么类User中的auth键?

由于标题阐明了为什么在Yii2中引入了auth密钥?它的主要用途是什么以及它在身份验证中的用途?

php yii yii2

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

IntelliJ IDEA 13.1 - 更新maven存储库索引身份验证失败

当我想从中央Maven存储库更新索引时,我总是收到错误:

java.lang.RuntimeException:java.io.IOException:检索nexes-maven-repository-index.properties的授权异常.

我在这里缺少什么?

maven-2 intellij-idea intellij-13

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

通过ID WordPress获取用户角色

我需要以某种方式检查某人的角色只有他们的身份.我找到了current_user_can()支票.但这仅适用于已登录的用户.如果该用户不是当前用户,我该如何检查?我正在使用电话订购系统,但使用管理员/特定帐户为其他人订购.

谢谢

php wordpress user-roles

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

无法在Windows上登录jboss 7.1管理控制台

无法登录Windows Server 2008 HPC Edition上的jboss 7.1和7.1.1管理控制台.我也尝试添加一个新用户(add-user.bat).即使是默认用户:admin = admin也不起作用.

此问题发生在域和独立.

jboss7.x

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