小编Bar*_*ett的帖子

重复脉冲动画

我正在尝试在ImageView中创建无限脉冲效果.但是如何保持偏移呢?

<set xmlns:android="http://schemas.android.com/apk/res/android"
android:shareInterpolator="false">
<scale
    android:duration="700"
    android:fromXScale="1"
    android:fromYScale="1"
    android:pivotX="50%"
    android:pivotY="50%"
    android:toXScale="0.5"
    android:toYScale="0.5"/>
<scale
    android:duration="700"
    android:fromXScale="1"
    android:fromYScale="1"
    android:pivotX="50%"
    android:pivotY="50%"
    android:startOffset="700"
    android:toXScale="2"
    android:toYScale="2"/>
</set>
Run Code Online (Sandbox Code Playgroud)

animation android loops

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

如何删除包过滤器?

如何禁用包过滤器?我一直收到这条消息......

Ignoring unknown package filter 'build-tools-23.0.0_rc2'
Warning: The package filter removed all packages. There is nothing to install.
     Please consider trying to update again without a package filter.
Run Code Online (Sandbox Code Playgroud)

filter package

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

尝试使用ESAPI但收到错误

我正在尝试使用ESAPI.jar为我的Web应用程序提供安全性.基本上我刚开始使用ESAPI.jar.但问题是我无法使用ESAPI运行一个简单的程序.小代码片段是:

String clean = ESAPI.encoder().canonicalize("someString");
Randomizer r=ESAPI.randomizer();    
System.out.println(r);
System.out.println(clean);
Run Code Online (Sandbox Code Playgroud)

我收到此错误:

Attempting to load ESAPI.properties via file I/O.
Attempting to load ESAPI.properties as resource file via file I/O.
Not found in 'org.owasp.esapi.resources' directory or file not readable: D:\Eclipse-Workspace\Test\ESAPI.properties
Not found in SystemResource Directory/resourceDirectory: .esapi\ESAPI.properties
Not found in 'user.home' (C:\Documents and Settings\user.user) directory: C:\Documents and Settings\user.user\esapi\ESAPI.properties
Loading ESAPI.properties via file I/O failed. Exception was: java.io.FileNotFoundException
Attempting to load ESAPI.properties via the classpath.
ESAPI.properties could not be loaded by any means. Fail. Exception …
Run Code Online (Sandbox Code Playgroud)

java security web-applications esapi

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

translate vs transform-origin css3

我想知道是否有人可以帮助我.我一直无法理解css3属性究竟是什么:transform-origin.我似乎无法按照它正在移动的方向.

例如,假设您有一个方形div,并将其旋转40度.然后你执行一个transform-origin: 100% 0%.你能做到translateX(and some value)吗?看起来translateX会在执行旋转后相对于新旋转的轴沿x轴移动它.我似乎无法跟随变换原点正在做什么,或者它究竟是什么.

一个清晰而彻底的例子将非常受欢迎.=)

css transform css3

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

Java getClass().getResource("file")导致NullPointerException

我正在关注zetcode Snake java游戏教程并始终收到此错误:

ImageIcon iid = new ImageIcon(this.getClass().getResource("ball.png"));
ball = iid.getImage();

Exception in thread "main" java.lang.NullPointerException
    at javax.swing.ImageIcon.<init>(Unknown Source)
    at snake2.Board.<init>(Board.java:52)
    at snake2.Snake.<init>(Snake.java:10)
    at snake2.Snake.main(Snake.java:22)
Run Code Online (Sandbox Code Playgroud)

我实际上只是复制并粘贴代码以查看它是如何工作的.它们也在合适的包装中; 但是当我尝试运行它时,我总是会遇到这个错误.

java nullpointerexception embedded-resource imageicon

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

vim启动时vim错误在fish shell中运行时

这是我的错误:

~> vim .tmux.conf 
Error detected while processing /Users/###/.spf13-vim-3/.vim/bundle/syntastic/plugin/syntastic.vim:
line   23:
E484: Can't open file /var/folders/c4/4nb5t7cs3wb17_g1w5030xc40000gn/T/vmIMCqB/0
Error detected while processing /Users/###/.spf13-vim-3/.vim/bundle/vim-preview/plugin/preview.vim:
line   94:
E484: Can't open file /var/folders/c4/4nb5t7cs3wb17_g1w5030xc40000gn/T/vmIMCqB/1
Press ENTER or type command to continue
Run Code Online (Sandbox Code Playgroud)

我已经检查了每个文件中的那些行,并且它们都调用了系统('uname'),我对此并不熟悉.我认为这个错误可能与TERM(在tmux外面是xterm-256color,在里面是screen-256color)有关,但是在.tmux.conf中更改它没有任何效果.

任何文件都会发生这种情况

我在Mac OS X 10.8.1,vim 7.3,tmux 1.6上使用鱼壳.

vim shell fish tmux

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

如何从Fish Shell函数返回一个数组

我试图从函数返回一个数组.下面的代码不起作用.

function testArray
   echo 1 2 3 4
end

set r (testArray)

echo $r[2]
# error
Run Code Online (Sandbox Code Playgroud)

使用fish shell从函数返回多个值的正确方法是什么?

fish

14
推荐指数
2
解决办法
3947
查看次数

如何添加鱼壳历史的条目?

在我的fish函数中,我正在评估构造的命令行 eval (commandline),具体来说 - 我正在寻找fzf中的一些文件名,然后分析命令行是否被预先添加vim.如果是 - 而不是之后返回vim filename按回车,我只是评价它,正如我之前所示.

问题是,如果我评估它,而不是手动输入,它不会进入历史 - 例如,我不能通过按下来看它作为上一个命令.

set -x history (commandline) $history在eval之后尝试过,但它显示了一个错误set: Tried to change the read-only variable “history”

有没有办法手动将自定义字符串(在我的情况下,命令行缓冲区)添加到历史记录中?谢谢.

fish

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

用可选参数编​​写鱼壳脚本

我有一个fish shell脚本,其默认行为是在完成后发送电子邮件.我想修改它以响应nomail命令行中的参数.因此,例如,正常运行脚本会生成一封电子邮件:

michaelmichael: ~/bin/myscript

但如果使用nomail交换机运行,它将不会发送确认电子邮件:

michaelmichael: ~/bin/myscript nomail

如果我使用nomail参数运行脚本,它运行正常.没有nomail,$argv是未定义的,它会抛出错误.我已经搜索了鱼壳文档,但似乎找不到任何可行的东西.这是我到目前为止所拥有的

switch $argv
  case nomail
    ## Perform normal script functions
  case ???
    ## Perform normal script functions
    mailx -s "Script Done!"
end
Run Code Online (Sandbox Code Playgroud)

运行此命令会引发以下错误:

switch: Expected exactly one argument, got 0

显然它需要一个参数,我只是不知道告诉它不接受任何参数的语法,或者它是否存在的语法.

我猜这是非常基本的,但我只是不太了解shell脚本.

shell fish

12
推荐指数
2
解决办法
5728
查看次数

如何在鱼壳中获得用户确认?

我正在尝试收集鱼类shellcript中的用户输入,特别是以下常见形式的用户输入:

This command will delete some files. Proceed (y/N)?
Run Code Online (Sandbox Code Playgroud)

经过一番搜索后,我仍然不确定如何干净利落地做到这一点.

这是鱼的特殊方式吗?

user-input confirmation fish

12
推荐指数
2
解决办法
3120
查看次数