当常春藤缓存损坏时,我从sbt得到以下错误
[error] unresolved dependency:commons-codec#commons-codec; 1.10:commons-codec#commons-codec中找不到的配置; 1.10:'主(编译)'.缺少配置:'compile'.它来自com.typesafe.play#play_2.11; 2.4.3编译
如果我删除常春藤缓存中的文件夹commons-codec并运行sbt update,sbt将重新下载依赖项,一切都会好的.
有没有办法告诉sbt删除文件夹并自动重新下载依赖项?
我想问一下如何在像C#这样的javascript中实现虚函数
通过下面的这个例子,我希望得到一个'B'警报,而不是'A'.
function A() {
this.virtualFunction();
}
A.prototype.virtualFunction = function() {
alert('A');
};
//-------------------------------------
function B() {}
B.prototype = new A();
B.prototype.virtualFunction = function() {
alert('B');
};
var b = new B();Run Code Online (Sandbox Code Playgroud)
如果我们在instanced之后调用函数,就像这样,那么它没关系,但我需要"在构造函数内部"
var b = new B();
b.virtualFunction();Run Code Online (Sandbox Code Playgroud)
我有一堆表格数据需要粘贴到Confluence网页上.通常的机制对我不起作用.
什么"通常的机制?"
将数据复制到Excel然后复制/粘贴到Confluence.
使用wiki标记格式化内容,意思是:
并将其粘贴到Wiki页面中.
第一个选项让我得到一个表,但它不显示网格线,并且排序不起作用.
第二个选项将标记放入页面,但不对其执行任何操作.如果我转到第一行并在最后一个栏后点击<return>,它会将该行转换为带有标题行的表(因为它有双条).如果我转到第二行并在最后一个栏后点击<return>,它会创建一个包含数据的SEPARATE TABLE.我可以转到第一个表(从标题行创建),告诉Confluence在下面添加一行,然后将第二个表中的数据复制到第二行,它就可以了.但我需要为每个数据行重复该序列.
我过去只是在这里生活过.当只有几行时,没有大事.但我正在尝试创建一个包含200多行的表.这个顺序对于这项工作量是不可接受的.
关于如何使这项工作的建议?
在Notepad ++中,我正在编写一个JavaScript文件,但有些东西不起作用:单击按钮时必须显示警报,但它无法正常工作.
我使用了Notepad ++提供的自动完成插件,它提供给我onClick.
当我把资本C变成小资本时c,它确实有效.
首先,在查看自动完成中的函数时,我注意到很多使用大写的函数.
但是当你改变getElementById时getelementbyid,你也会得到一个错误,更糟糕的是,我的学校手册用大写字母写了所有的东西,但解决方案都是用小写字母完成的.
那么JavaScript是什么以及它的选择性本质,哪些函数可以在其中包含大写字母,哪些不可以呢?
我正在使用新的RHEL系统.
我似乎无法通过yum install安装任何软件包.
yum install nmap
Run Code Online (Sandbox Code Playgroud)
目前的回购
ls /etc/yum.repos.d/
google-chrome.repo redhat.repo rhel-source.repo
Run Code Online (Sandbox Code Playgroud)
怎么可能出错?
YUM安装的输出:
$ sudo yum install nmap
[sudo] password for user:
Loaded plugins: product-id, refresh-packagekit, security, subscription-manager
Updating certificate-based repositories.
Setting up Install Process
No package nmap available.
Error: Nothing to do
Run Code Online (Sandbox Code Playgroud) 我有一种情况,我调用外部API A并使用其响应来提供API B的请求并调用它,然后将响应返回给API A的调用者.如下所示
method(){
response = call API A
}
method_for_API_A(){
handler() ->{
API_B
}
return response;
}
method_for_API_B(){
//code to call API B
}
Run Code Online (Sandbox Code Playgroud)
我在这里面临的是API A方法返回响应而不等待从B获得响应.
我检查了vert.x的executeBlocking方法,并尝试使用'阻塞队列',但无法实现我打算做的事情.有人可以指导我做正确的方法.谢谢.
编辑:只是解释确切的情况
Class MyClass{
public Response method_A (Request request){
String respFromApiA = Call_API_A(request) ; // STEP 1
Response respFromApiB = Call_API_B(request, respFromApiA); // STEP 2
Print(respFromApiB) // PRINT FINAL Response
return respFromApiB; // STEP 3
}
String Call_API_A(Request request){
// Implementation
Print(string); // PRINT API A response
return string
}
Response Call_API_B(Response …Run Code Online (Sandbox Code Playgroud) 我正在使用JavaFx Print-Dialog来自定义打印作业.所有属性都将存储在PrinterJob#JobSettings变量中,但是当我从jobSetting接收纸张来源时,纸张来源始终是默认值.
如何获得我设置的纸张来源?
这是一个简短的例子:
public class PrinterPaperSourceTest extends Application {
public static void main(String[] args) {
launch( args );
}
@Override
public void start(Stage primaryStage) {
primaryStage.setTitle("Printer");
Button btn = new Button();
btn.setText("Show Printer Settings ");
btn.setOnAction( new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent event) {
PrinterJob job = PrinterJob.createPrinterJob(Printer.getDefaultPrinter());
job.showPageSetupDialog(null);
Alert alert = new Alert(AlertType.INFORMATION);
PaperSource paperSource = job.getJobSettings().getPaperSource();
alert.setContentText("PaperSource: " + paperSource.getName());
alert.show();
}
});
StackPane root = new StackPane();
root.getChildren().add(btn);
primaryStage.setScene(new Scene(root, 300, 250));
primaryStage.show();
}
}
Run Code Online (Sandbox Code Playgroud) 我需要在下面的Runnable Thread中访问Spring bean(featureService和uxService),但是我得到了null值,applicationContext因此我无法在Runnable中获得Spring bean.我想知道是否可以访问runnable中的spring bean?如果没有,请建议我另一种方法.
我正在使用Spring 4.0.6和Java 8
@Component
public class UserMenuUpdateTask implements Runnable, Serializable, ApplicationContextAware {
private static final long serialVersionUID = 3336518785505658027L;
List<User> userNamesList;
FeatureService featureService;
UXService uxService;
private ApplicationContext applicationContext;
public UserMegaMenuUpdateTask() {}
public UserMegaMenuUpdateTask(List<User> userNamesList) {
this.userNamesList = userNamesList;
}
@Override
public void run() {
try {
for (User user : userNamesList) {
featureService = (FeatureService) applicationContext.getBean("featureService");
uxService = (UxService) applicationContext.getBean("uxService");
//.........
}
} catch …Run Code Online (Sandbox Code Playgroud) 我在一个Web应用程序上工作,从其代码中调用多个Web服务客户端.
每个Web服务都有一些常见的命名空间,但是当我生成每个客户端时,我正在将这些命名空间映射到不同的包
例如
Web Service 1的namespace1 - > com.company.webservice.client1.service
Web Service 2的namespace1 - > com.company.webservice.client2.service
其中namespace1引用相同的命名空间URL.
使用Wsdl2Java的namespace2package选项:
// Web Service Client 1's namespace parameter
--namespace2package http://www.multispeak.org/Version_3.0=com.company.webservice.client1.service
// Web Service Client 2's namespace parameter
--namespace2package http://www.multispeak.org/Version_3.0=com.company.webservice.client2.service
Run Code Online (Sandbox Code Playgroud)
我可以毫无问题地为这些服务生成Web服务客户端代码,只要生成的客户端jar中只有一个在给定Web服务调用的类路径上,我就可以自己调用每个客户端.但是,如果我将两个Web服务客户端jar放在类路径上,则只有一个Web服务客户端可以工作(其各自的客户端jar首先在类路径上).
尝试调用时,其他Web服务客户端失败,但以下情况除外:
java.lang.ClassCastException:com.company.webservice.client1.service.impl.GetAllMetersResponseDocumentImpl无法强制转换为com.company.webservice.client2.service.GetAllMetersResponseDocument
我已经混淆了上面的一些实际值.
因此,问题似乎是关于Axis2/XMLBeans如何查找适当的类以匹配给定的XML来解析.
我可以更改命名空间映射,以便它们相互匹配,之后它可以正常工作.但是,缺点是我在同一个包结构中有多个包含相同生成代码的Web服务客户端jar,这些类只能从它在类路径中找到的第一个客户端jar中的模型中实例化.
有没有办法这样做,以便我可以为每个Web服务客户端jar保留不同的命名空间?
或者我只是被迫将每个命名空间映射到使用该命名空间的每个客户端的同一个包?
希望这个问题有意义,但是如果我需要提供其他任何有用的东西,请告诉我,我将进一步详细说明这个问题,但希望有使用Wsdl2Java的Axis2/XMLBeans/web服务客户端生成知识的人应该是能够在没有更多信息的情况下回答这个
更新1: 我终于放弃了,只是使所有的命名空间映射指向同一个包而不是每个Web服务客户端的定制,并且在类路径上的各个JAR中获得了同一个类的多个副本.不像我希望的那样优雅,但至少它有效.
如果有人能想出一个更好的解决方案,允许我在每个客户端使用定制副本,请告诉我.
更新2: 这种方法同样不起作用,因为尽管使用相同的命名空间,两个Web服务产生不同版本的命名空间模型,现在导致编译时错误依赖于类路径顺序.那么......回到原点......
我在页面上有一个按钮点击事件,最终使用以下内容更新表:
protected void Button2_Click(object sender, EventArgs e)
{
this.AccessDataSource6.Insert();
}
Run Code Online (Sandbox Code Playgroud)
绑定到不同AccessDataSource的GridView显示由Insert更新的数据.
我需要在Button2_Click中包含什么才能刷新GridView?
java ×4
javascript ×2
asp.net ×1
axis2 ×1
c# ×1
confluence ×1
data-binding ×1
dom ×1
event-driven ×1
html ×1
javafx ×1
linux ×1
oop ×1
printing ×1
rhel ×1
sbt ×1
spring ×1
spring-mvc ×1
vert.x ×1
web-services ×1
wsdl2java ×1
xmlbeans ×1
yum ×1