我知道以root身份运行php-fpm的风险.但是,有些人需要这样做,例如设备,访问操作系统资源,甚至用于测试目的.
我尝试将php-fpm.d/www.conf的用户和组更改为root,当我重新启动php-fpm进程时出现错误:
Starting php-fpm: [26-Jun-2014 00:39:07] ERROR: [pool www] please specify user and group other than root
[26-Jun-2014 00:39:07] ERROR: FPM initialization failed
[FAILED]
Run Code Online (Sandbox Code Playgroud)
我该怎么办.有人帮吗?
我的定义XML是:
<CheckedTextView android:textSize="18.0dip"
android:text="@string/text"
android:textColor="@color/white"
android:id="@+id/test"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:checkMark="?android:attr/textCheckMark" />
Run Code Online (Sandbox Code Playgroud)
一切正常,但文本始终位于视图的左上角,复选框位于中心垂直位置.他们不在同一条线上.如何对齐它们.
参数是ArrayList <T>如何获取T的className
public static <T extends Object> void test(ArrayList<T> list){
T temp;
Class classType=temp.getClass();
System.out.println(classType.getName());
}
Run Code Online (Sandbox Code Playgroud)
编译失败的原因是:本地变量temp可能尚未初始化.
但是如何获取模板类的className.
当我使用 python-libtorrent 实现客户端时,我在 GitHub 上找到了一个示例
import libtorrent as lt
import time
ses = lt.session()
ses.listen_on(6881, 6891)
e = lt.bdecode(open("test.torrent", 'rb').read())
info = lt.torrent_info(e)
h = ses.add_torrent(info, "d:\\temp")
while (not h.is_seed()):
s = h.status()
state_str = ['queued', 'checking', 'downloading metadata', \
'downloading', 'finished', 'seeding', 'allocating', 'checking fastresume']
print s.download_rate
print '%.2f%% complete (down: %.1f kb/s up: %.1f kB/s peers: %d) %s' % \
(s.progress * 100, s.download_rate / 1000, s.upload_rate / 1000, \
s.num_peers, state_str[s.state])
time.sleep(1)
Run Code Online (Sandbox Code Playgroud)
效果很好。但它会下载所有包含文件
我想要求用户选择文件,并且该客户端应该只下载特定文件。
如何 ?谢谢。
我知道我们可以通过使用系统操作"com.android.camera.action.CROP"来捕获imageView
但有些时候我想自己剪切图像,如:
imageView A的位图是300dip*300dip;
子图像应该是四点左上角(0,0)左下角(0,100)右下角(100,100),右上角(100,0)的范围.
如何创建子图像(位图)?