为什么我不能管adb shell?
[klm@kth ~]$ echo foo | adb shell cat
^C
Run Code Online (Sandbox Code Playgroud)
上面的命令挂起我的4.0.1模拟器,我没有看到预期的foo输出.
我认为这是因为adb shell它没有将stdin传递到它的子进程'stdout,并且cat坐着等待永远.这真的没有实现adb,或者我错过了什么?
如何从Canvas获取当前翻译位置?我正在尝试绘制我的坐标是相对(相互)和绝对(相对于画布)混合的东西.
让我们说我想做
canvas.translate(x1, y1);
canvas.drawSomething(0, 0); // will show up at (x1, y1), all good
// now i want to draw a point at x2,y2
canvas.translate(x2, y2);
canvas.drawSomething(0, 0); // will show up at (x1+x2, y1+y2)
// i could do
canvas.drawSomething(-x1, -y1);
// but i don't always know those coords
Run Code Online (Sandbox Code Playgroud)
这有效但很脏:
private static Point getCurrentTranslate(Canvas canvas) {
float [] pos = new float [2];
canvas.getMatrix().mapPoints(pos);
return new Point((int)pos[0], (int)pos[1]);
}
...
Point p = getCurrentTranslate(canvas);
canvas.drawSomething(-p.x, -p.y);
Run Code Online (Sandbox Code Playgroud)
画布有一个getMatrix方法,它有一个setTranslate但没有 …
我想配置Emacs滚动我的缓冲区而不移动点,即使它离开了屏幕.在我当前的设置中,当我做(scroll-up 4)足够长的时间时,我的观点最终将被移动以使其保持在可见缓冲区内.
我想改变它,因为我idle-highlight会在符号中着色,我希望看到它的出现.当我滚动得足够远时,我的观点会在它离开屏幕并idle-highlight退回之前被移动.我怎么能改变这个?
我正在使用Emacs 24.