我想知道Heroku服务器状态,无法找到有关此主题的任何文档.
例:
Process exited with status 143
Run Code Online (Sandbox Code Playgroud)
谁能解释一下这个例子?我在哪里可以找到资源以供将来参考?
当我在Heroku服务器上部署我的应用程序时,服务器自动生成一个应用程序,我在我的资源上找到了一个git url.示例:git@heroku.com:myapp-ss-1338.git
.如何通过Web浏览器访问此URL以查看源代码或文件夹?
我尝试在<%=和%>之间获取字符串,这是我的实现:
String str = "ZZZZL <%= dsn %> AFFF <%= AFG %>";
Pattern pattern = Pattern.compile("<%=(.*?)%>");
String[] result = pattern.split(str);
System.out.println(Arrays.toString(result));
Run Code Online (Sandbox Code Playgroud)
它回来了
[ZZZZL , AFFF ]
Run Code Online (Sandbox Code Playgroud)
但我的期望是:
[ dsn , AFG ]
Run Code Online (Sandbox Code Playgroud)
我错在哪里以及如何纠正它?
我想创建一个模拟列表来测试下面的代码:
for (String history : list) {
//code here
}
Run Code Online (Sandbox Code Playgroud)
这是我的实现:
public static List<String> createList(List<String> mockedList) {
List<String> list = mock(List.class);
Iterator<String> iterHistory = mock(Iterator.class);
OngoingStubbing<Boolean> osBoolean = when(iterHistory.hasNext());
OngoingStubbing<String> osHistory = when(iterHistory.next());
for (String history : mockedList) {
osBoolean = osBoolean.thenReturn(true);
osHistory = osHistory.thenReturn(history);
}
osBoolean = osBoolean.thenReturn(false);
when(list.iterator()).thenReturn(iterHistory);
return list;
}
Run Code Online (Sandbox Code Playgroud)
但是当测试运行时,它会在行中抛出异常:
OngoingStubbing<DyActionHistory> osHistory = when(iterHistory.next());
Run Code Online (Sandbox Code Playgroud)
详情:
org.mockito.exceptions.misusing.UnfinishedStubbingException:
Unfinished stubbing detected here:
-> at org.powermock.api.mockito.PowerMockito.when(PowerMockito.java:495)
E.g. thenReturn() may be missing.
Examples of correct stubbing:
when(mock.isOk()).thenReturn(true);
when(mock.isOk()).thenThrow(exception);
doThrow(exception).when(mock).someVoidMethod();
Hints: …
Run Code Online (Sandbox Code Playgroud) 我是Bootstrap的新手,我遇到了这个例子的问题:
<!-- Trigger the modal with a button -->
<button type="button" class="btn btn-info btn-lg" data-toggle="modal" data-target="#myModal">Open Modal</button>
<!-- Modal -->
<div id="myModal" class="modal fade" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title">Modal Header</h4>
</div>
<div class="modal-body">
<p>Some text in the modal.</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
根据我的理解data-dismiss="modal"
属性应该关闭模式,如果你点击它,但我不明白它如何在幕后工作.我检查了官方文档:http://getbootstrap.com/javascript/#modals-examples但没有解释.
我使用本教程在我的64位Ubuntu操作系统上安装mongodb:
http://docs.mongodb.org/manual/tutorial/install-mongodb-on-linux/
完成安装后,我输入:
mongo
Run Code Online (Sandbox Code Playgroud)
从那时起,出现错误消息:
mongod: error while loading shared libraries: libc++.so.1: cannot open shared object file: No such file or directory
Run Code Online (Sandbox Code Playgroud)
你有什么想法解决这个问题吗?这是我的系统信息:
OS: Ubuntu 14.04 LTS.
OS Type: 64 bit.
MongoDB version: mongodb-linux-x86_64-ubuntu1410-clang-3.0.6.
Run Code Online (Sandbox Code Playgroud) 嗨,我正在使用此代码为我的CQ5示例应用程序创建一个Post方法.
package com.adobe.cq.sling;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.net.HttpURLConnection;
import java.net.URL;
import java.rmi.ServerException;
import java.util.Dictionary;
import org.apache.felix.scr.annotations.Properties;
import org.apache.felix.scr.annotations.Property;
import org.apache.felix.scr.annotations.Reference;
import org.apache.felix.scr.annotations.sling.SlingServlet;
import org.apache.sling.api.SlingHttpServletRequest;
import org.apache.sling.api.SlingHttpServletResponse;
import org.apache.sling.api.servlets.SlingSafeMethodsServlet;
import org.apache.sling.commons.osgi.OsgiUtil;
import org.apache.sling.jcr.api.SlingRepository;
import org.apache.felix.scr.annotations.Reference;
import org.osgi.service.component.ComponentContext;
import javax.jcr.Session;
import javax.jcr.Node;
import org.json.simple.JSONObject;
import java.util.UUID;
@SlingServlet(paths="/bin/mySearchServlet", methods = "POST", metatype=true)
public class HandleClaim extends org.apache.sling.api.servlets.SlingAllMethodsServlet {
private static final long serialVersionUID = 2598426539166789515L;
@Override
protected void doPost(SlingHttpServletRequest request, SlingHttpServletResponse response) throws ServerException, IOException { …
Run Code Online (Sandbox Code Playgroud) 对于经典UI,我们可以轻松地在rteplugins标签内添加插件,Adobe在他们的Geometrix-Outdoor项目上构建了一个很好的例子:
<summary
jcr:primaryType="cq:Widget"
fieldLabel="Summary"
name="./summary"
xtype="richtext">
<rtePlugins jcr:primaryType="nt:unstructured">
<table
jcr:primaryType="nt:unstructured"
features="*"/>
<format
jcr:primaryType="nt:unstructured"
features="*"/>
<lists
jcr:primaryType="nt:unstructured"
features="*"/>
<justify
jcr:primaryType="nt:unstructured"
features="*"/>
<edit
jcr:primaryType="nt:unstructured"
features="[paste-wordhtml]"/>
<findreplace
jcr:primaryType="nt:unstructured"
features="*"/>
<paraformat
jcr:primaryType="nt:unstructured"
features="*"/>
<subsuperscript
jcr:primaryType="nt:unstructured"
features="*"/>
<misctools
jcr:primaryType="nt:unstructured"
features="*"/>
<links
jcr:primaryType="nt:unstructured"
features="*"/>
<spellcheck
jcr:primaryType="nt:unstructured"
features="*"
invalidStyle="background-color: #ffdddd;"/>
<undo
jcr:primaryType="nt:unstructured"
features="*"/>
<image
jcr:primaryType="nt:unstructured"
features="*"/>
</rtePlugins>
</summary>
Run Code Online (Sandbox Code Playgroud)
但是我们不能在Touch UI环境中应用相同的东西,他们也在Geometrix-Outdoor上做了一个例子,但是插件没有完全显示功能:
<summary
jcr:primaryType="nt:unstructured"
sling:resourceType="cq/gui/components/authoring/dialog/richtext"
fieldLabel="Summary"
name="./summary"
renderReadOnly="{Boolean}true"/>
Run Code Online (Sandbox Code Playgroud)
反正有没有让TouchUi显示器上的插件显示为经典UI?
如果我想在页面A中设置可编辑的cq5组件,但在页面B中不可编辑,是否可行.
例如:在页面A,我有C组件,我们允许作者打开对话框并编辑组件.但是我们不允许作者打开对话框来编辑页面B上的组件C.我尝试研究cq:EditConfig 链接,但这还不足以解决我的问题.
在学习Spring MVC知识时,有一些关于Spring返回类型的东西让我很困惑.
在本文档中:使用@RequestMapping映射请求它们返回appointments/new
和redirect:/appointments
.
码
@RequestMapping(method = RequestMethod.POST)
public String add(@Valid AppointmentForm appointment, BindingResult result) {
if (result.hasErrors()) {
return "appointments/new";
}
appointmentBook.addAppointment(appointment);
return "redirect:/appointments";
}
Run Code Online (Sandbox Code Playgroud)
这两种返回类型之间的主要区别是什么?据我所知,第一种类型作为前进动作返回,但如果我是对的,为什么它们也forward:/
作为返回类型发布?
我看一下Hive 语言手册
并认识到 Hive 查询不支持 IN/EXIST 运算符,他们建议使用 LEFT SEMI JOIN 作为替代。你知道原因吗?
在Java中,我发现一些开发人员写道:
public static functionName() {}
Run Code Online (Sandbox Code Playgroud)
但其他人写道:
static public functionName() {}
Run Code Online (Sandbox Code Playgroud)
这两者有什么区别?
java ×8
aem ×3
sling ×3
heroku ×2
coding-style ×1
deployment ×1
git ×1
hadoop ×1
hive ×1
jackrabbit ×1
javascript ×1
jcr ×1
jquery ×1
junit ×1
linux ×1
mocking ×1
mockito ×1
modifiers ×1
mongodb ×1
post ×1
regex ×1
server-side ×1
servlets ×1
sightly ×1
spring ×1
spring-mvc ×1
sql ×1
string ×1
ubuntu ×1
unit-testing ×1