我试过把信号发送到nginx.我试过杀死所有进程,但他们似乎只是回来了.
$ which nginx
/opt/local/sbin/nginx
$ sudo nginx -s stop
$ sudo /opt/local/sbin/nginx -s stop
$ ps -ef | grep nginx
141: 0 24627 1 0 2:29PM ?? 0:00.00 nginx: master process /opt/local/sbin/nginx
142: -2 24628 24627 0 2:29PM ?? 0:00.02 nginx: worker process
143: -2 24629 24627 0 2:29PM ?? 0:00.07 nginx: worker process
144: -2 24630 24627 0 2:29PM ?? 0:00.07 nginx: worker process
145: -2 24631 24627 0 2:29PM ?? 0:00.07 nginx: worker process
146: -2 24632 …Run Code Online (Sandbox Code Playgroud) Android提供了许多用于在设备上持久存储数据的选项.我选择了内部存储,所以请不要提出存储在SD卡上的建议.(我见过太多关于内部存储的问题有SD卡的答案!!)
我想在我的应用程序的内部存储目录中创建子目录.我按照这个SO答案,转载如下.
File mydir = context.getDir("mydir", Context.MODE_PRIVATE); //Creating an internal dir;
File fileWithinMyDir = new File(mydir, "myfile"); //Getting a file within the dir.
FileOutputStream out = new FileOutputStream(fileWithinMyDir); //Use the stream as usual to write into the file.
Run Code Online (Sandbox Code Playgroud)
不幸的是,那是用"app_"前缀创建子目录.因此,从示例中,子目录看起来像"app_mydir"(不理想).
这个SO问题的答案表明你可以通过这种方式摆脱"app_"前缀:
m_applicationDir = new File(this.getFilesDir() + "");
m_picturesDir = new File(m_applicationDir + "/mydir");
Run Code Online (Sandbox Code Playgroud)
但我想写一个像/data/data/com.mypackages/files/mydir/the.zip这样的拉链.
所以,最后,我的代码如下所示:
File appDir = new File(getApplicationContext().getFilesDir() + "");
File subDir = new File(appDir + "/subDir");
File outFile = new File(subDir, "/creative.zip");
Run Code Online (Sandbox Code Playgroud)
但是,当我尝试这个时,这会产生另一个错误:"文件不存在": …
我takePicture用jpeg事件的回调调用:camera.takePicture(null, null, this);
这是回调处理程序:
@Override
public void onPictureTaken(final byte[] data, Camera camera) {
Bitmap picture = BitmapFactory.decodeByteArray(data, 0, data.length);
MediaStore.Images.Media.insertImage(getContentResolver(), picture, "name" , "description");
}
Run Code Online (Sandbox Code Playgroud)
在测试中,我发现图像总是围绕y轴镜像.有谁知道(1)这是否适用于所有设备,以及(2)为什么?我真的不明白为什么字节数据不能代表我在相机预览中看到的内容.这是不合理的期待吗?
根据敏捷开发书,我有一个Admin控制用户登录方式的MVC.在ApplicationController,我有一个before_filter检查授权.因此,这将检查用户是否已登录每个页面.
问题是我希望每个人都能够访问该new方法,例如,在用户中(也就是说,任何人都应该能够创建新用户 - 当然!只有管理员用户才能访问UsersController中的其他方法,例如as edit等).最好的方法是什么?
我为每个SO条目设置编辑器:如何使用msysgit / gitk设置DiffMerge?。
我想知道如何撤消此操作,因为我想切换回默认编辑程序。
我是haml的新手,所以我还在试图找出格式.
我有一个index.haml文件,其中包含以下代码.
%h1
Welcome to Solidarity
Hello,
= @profile.first_name
!
Run Code Online (Sandbox Code Playgroud)
它呈现如下:
欢迎来到团结
你好,用户!
这是页面来源:
<h1>
Welcome to Solidarity
</h1>
Hello,
frances
!
Run Code Online (Sandbox Code Playgroud)
它在@ profile.first_name和感叹号之间有一个空格.这是为什么?而且,我该如何解决?
我设置了facebooker来挖掘我的Ruby on Rails应用程序.
问题是我想在本地测试.也就是说,每次我想看到我的更改时,我都不想要启动隧道.
现在,当我使用ruby script/server(而不是rake facebooker:tunnel:background_start事先调用)启动应用程序时,帮助程序创建的链接(例如,stylesheet_link_tag,javascript_include_tag,image_tag)将附加到我的tunnlr地址:http://web1.tunnlr.com:myPort /.(例如,CSS链接在页面源中如下所示:http://web1.tunnlr.com:myPort //stylesheets/appName.css?1234567890.)
我不想要那个功能; 我不能在不必先启动隧道的情况下看到我的CSS或JavaScript更改.我希望链接是相对的,而不是绝对的.所以,stylesheet_link_tag应该生产/stylesheets/appName.css?1234567890.
有谁知道为什么它首先这样做以及如何解决它?
提前致谢.
这是问题的截图:

请注意,我们在stalk页面上.我写的CSS应该改变活动页面的颜色.这是CSS:
#nav {
border-top:10px solid #A7C1D1;
height:45px;
padding-left:100px;
padding-top:20px;
margin-left:0;
color:#000;
}
#nav a {
color:#000;
text-decoration:none;
}
#nav a:visited {
color:#000;
}
#nav a:hover {
color:#93AFBF;
}
#nav .active {
color:#93AFBF;
}
Run Code Online (Sandbox Code Playgroud)
以前,我有CSS用于#nav .active在活动页面周围创建边框.这很有效,当我在/ stalk页面上时,我可以看到"stalk"这个词的边界.但这一次,我决定改变这个词的颜色.这是我遇到问题的地方.
这是为页面呈现的HTML:
<div id="nav">
<a href="/">home</a> · <a href="/stalk" class="active">stalk</a> · <a href="#">link3</a> · <a href="#">link4</a>
</div>
Run Code Online (Sandbox Code Playgroud)
如果我拿走CSS #nav a:visited然后CSS #nav .active工作,但现在访问链接是蓝色的,当我希望它们保持黑色.
我在这里找到了关于如何运行Android操作系统的教程:http://www.javacodegeeks.com/2010/06/install-android-os-on-pc-with.html
有没有人试图使用该设置作为模拟器的替代品?如果是这样,你是怎么做到的?
我想接受像“jan do”这样的查询,并让它匹配像“jane doe”、“don janek”这样的值——当然还有:“jan do”、“do jan”。
所以目前我能想到的规则是:
到目前为止,我有这个映射
PUT /test
{
"settings": {
"analysis": {
"analyzer": {
"my_keyword": {
"type": "custom",
"tokenizer": "keyword",
"filter": [
"asciifolding",
"lowercase"
]
}
}
}
},
"mappings": {
"question": {
"properties": {
"title": {
"type": "string"
},
"answer": {
"type": "object",
"properties": {
"text": {
"type": "string",
"analyzer": "my_keyword",
"fields": {
"stemmed": {
"type": "string",
"analyzer": "standard"
}
}
}
}
}
}
}
}
}
Run Code Online (Sandbox Code Playgroud)
我一直在搜索词组:
POST /test/_search …Run Code Online (Sandbox Code Playgroud) android ×3
css ×1
facebooker ×1
filter ×1
haml ×1
msysgit ×1
nginx ×1
text-editor ×1
tunneling ×1