小编bou*_*ppo的帖子

java.io.IOException - IO流读取结束

代码似乎打破了session.connect.

com.jcraft.jsch.JSchException: Session.connect: java.io.IOException: End of IO Stream Read
Run Code Online (Sandbox Code Playgroud)

堆栈跟踪

com.jcraft.jsch.JSchException: Session.connect: java.io.IOException: End of IO Stream Read
    at com.jcraft.jsch.Session.connect(Session.java:534)
    at com.jcraft.jsch.Session.connect(Session.java:162)
    at session.connect in uploadFile(ftpService.java:280)
Run Code Online (Sandbox Code Playgroud)

try {
    JSch jsch = new JSch();
    Session session = null;
    session = jsch.getSession(ftpUserName, ftpServer, 22);
    session.setClientVersion("StrictHostKeyChecking");
    //session.setConfig("StrictHostKeyChecking", "no");
    session.setPassword(ftpPassword);
    session.connect();

    Channel channel = session.openChannel("sftp");
    channel.connect();
    ChannelSftp sftpChannel = (ChannelSftp) channel;
    //sftpChannel.get("remotefile.txt", "localfile.txt");
    String path="C:\\srcFolder";
    String remotePath="C:\\destFolder";
    try {
        sftpChannel.put(new FileInputStream(new File(path)), remotePath  );
    } catch (FileNotFoundException e) {
        // TODO …
Run Code Online (Sandbox Code Playgroud)

java sftp

7
推荐指数
1
解决办法
1万
查看次数

如何在Eclipse的Maven依赖项中编辑`.class`文件

好的,所以我有我的Java项目,并且在项目资源管理器上的Maven依赖项目文件夹下,我遇到一个jar文件夹,并且其中有一个.class文件。现在,单击Download Sources,我可以将.class文件查看为Java文件,但是无法在Eclipse中进行编辑。

我该怎么办?

java eclipse jar maven

6
推荐指数
1
解决办法
5548
查看次数

phoneGap/Cordova有哪些技术限制?

首先,感谢令人惊叹的apache cordova团队制作一个独立于平台的本地应用程序构建平台 - 非常棒的东西.

但是,我们知道HTML5仍处于草案模式,而我正在考虑将Cordova应用于这个方向,那么现在Cordova的技术限制是什么?

与Sencha Touch 2相比,有什么优点和缺点,因为我看到在我的Cordova搜索过程中出现了ST2.

mobile html5 cordova

5
推荐指数
1
解决办法
4911
查看次数

jQuery美元符号未定义

在我获取历史信息的过程中,我尝试使用以下代码.Chrome调试器说明了这一点Uncaught ReferenceError: $ is not defined.你能提出一个解决方案吗,我真的被卡住了.我只需要在Chrome上工作,我正在使用YQL和Yahoo API.

这里是jsFiddle http://jsfiddle.net/pCK5q/1/

<html>
  <head>      
    <script type='text/javascript' src='http://www.google.com/jsapi'></script>
    <script type='text/javascript'>
      google.load('visualization', '1', {'packages':['annotatedtimeline']});
      google.setOnLoadCallback(drawChart);
      function drawChart() {
        var data = new google.visualization.DataTable();

        /* historical data code that breaks */
        var url = 'http://query.yahooapis.com/v1/public/yql';
        var startDate = '2012-01-01';
        var endDate = '2012-01-08';
        var jsonData = encodeURIComponent('select * from yahoo.finance.historicaldata where symbol in ("YHOO","AAPL","GOOG","MSFT") and startDate = "' + startDate + '" and endDate = "' + endDate + '"');
        $.getJSON(url, 'q=' + data …
Run Code Online (Sandbox Code Playgroud)

javascript jquery google-visualization yql

5
推荐指数
2
解决办法
1万
查看次数

使用javascript或其他方法检查bean是否为null

当用于创建myBean的值不为null时,以下代码片段起作用.

myBean值为null 时,如何处理场景?有没有办法检查bean的价值?

<bean:define id="myBean" name="<%=myName%>" property="<%=myProp%>"/>
Run Code Online (Sandbox Code Playgroud)

现在if myName和/或myProp为null,

错误 javax.servlet.jsp.JspException: Define tag cannot set a null value错误.

尝试解决方案:

<c:if test="${not empty myBean}">
            <bean:define id="myBean" name="<%=myName%>" property="<%=myProp%>"/>
            </c:if>
Run Code Online (Sandbox Code Playgroud)

html javascript jsp struts

5
推荐指数
1
解决办法
8756
查看次数

从YouTube链接在特定时间段捕获缩略图

1)是否有一种API方法可以以3:59捕获/存储YouTube视频的缩略图,而不是原始上传者上传的自动生成的缩略图或封面缩略图?关于SO似乎没有确定的答案

2)如果(1)不可能,我是否可以下载原始视频,在所需的时间范围内抓取缩略图,然后在我的应用中使用这些缩略图,以归功于原始来源并归功于原始来源?

youtube-api youtube-javascript-api

5
推荐指数
1
解决办法
2737
查看次数

使用 JSP 标记库在选择中嵌套选择

<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<td colspan="1" width="100">
<c:choose>
  <c:when>
  </c:when>

  <c:when>
  </c:when>

  <c:when>
    <c:choose>
       <c:when></c:when><c:otherwise><c:when></c:when></c:otherwise>
    </c:choose>
  </c:when>

  <c:otherwise>
  </c:otherwise>
</c:choose>
</td>
Run Code Online (Sandbox Code Playgroud)

在选择中嵌套选择是否有限制,例如这样?

编辑:如果我将另一个 <c:when></c:when> 放在 else 中,JSP 编译器一直抱怨我没有结束标记。

html java jsp

4
推荐指数
1
解决办法
9493
查看次数

从xsl:template传递字符串参数并在另一个xsl文件中使用它

<xsl:template match="HtmlCode">
    <xsl:copy-of select="child::*|text()"/>
</xsl:template>

<xsl:call-template name="HappyFriend">
    <xsl:with-param name="text" select="'i am a friggin' RRRRROOOOOOOVVVERRRRR~~'"/>
</xsl:call-template> 

<xsl:template name="HappyFriend">
        <xsl:param name="text"/>
        <HtmlCode>
            &lt;span&gt; &lt;%="text"%&gt;   &lt;/span&gt;
        </HtmlCode>
<xsl:template>
Run Code Online (Sandbox Code Playgroud)

不知何故,我一直在收到XSLT问题......我所要做的就是获取变量"text"的值,这是"我是一个frigggin RRROVERRR",在"HappyFriend"中出现了一个frigggggin'RRROOOVVVERRRR ~~ "模板.

我究竟做错了什么?

xslt

4
推荐指数
1
解决办法
2万
查看次数

FTPSClient返回MalformedServerReplyException:无法解析响应代码

我有一个SFTP连接设置.我使用WinCSP和Filezilla,测试服务器没有问题.java代码来自于apache commons-net 2.0它,它给了我意想不到的错误

private String ftpServer="XXX.xx.x.XX";
private int ftpPort=99;
private String ftpUserName="myUserName";
private String ftpPassword="myPassword";

FTPSClient ftp = null;
        try{
            ftp = new FTPSClient();
            ftp.connect(hostname, port)
        } catch (Exception e){
           Logger.debug(e)
        }
Run Code Online (Sandbox Code Playgroud)

堆栈跟踪

Server reply:SSH-2.0-WeOnlyDo-wodFTPD 2.3.6.165
org.apache.commons.net.MalformedServerReplyException: Could not parse response code.
at org.apache.commons.net.ftp.FTP.__getReply(FTP.java:315)
    at org.apache.commons.net.ftp.FTP._connectAction_(FTP.java:364)
    at org.apache.commons.net.ftp.FTPClient._connectAction_(FTPClient.java:540)
    at org.apache.commons.net.ftp.FTPSClient._connectAction_(FTPSClient.java:167)
    at org.apache.commons.net.SocketClient.connect(SocketClient.java:178)
    at myHomeFtpService.getFtpConnection(HomeFtpService.java:40)
Run Code Online (Sandbox Code Playgroud)

java ftps apache-commons

4
推荐指数
1
解决办法
2万
查看次数

在mongodb中使用索引的运行时

基于mongodb 文档

ensureIndex()函数仅在不存在时创建索引.

一旦集合在密钥上编入索引,对与指定密钥匹配的查询表达式的随机访问就会很快.如果没有索引,MongoDB必须遍历每个文档,检查查询中指定键的值:

db.things.find({j:2});  // fast - uses index
db.things.find({x:3});  // slow - has to check all because 'x' isn't 
Run Code Online (Sandbox Code Playgroud)

这是否意味着第一行代码运行时是big_theta = 1,第二行代码是big_theta = n

algorithm indexing runtime mongodb

3
推荐指数
1
解决办法
540
查看次数