小编ufk*_*ufk的帖子

php:每当我尝试编写UTF-8时都使用DomDocument,它会写入十六进制表示法

当我尝试使用DomDocument将UTF-8字符串写入XML文件时,它实际上写入字符串的十六进制表示法而不是字符串本身.

例如:

__CODE__

而不是:ירושלים

任何想法如何解决这个问题?

php utf-8 hebrew domdocument

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

eclipse jsp - 没有颜色,代码完成和错误检测

我正在尝试找到一种方法来在jsp页面中进行颜色和代码完成以及错误检测.我有

面向Web开发人员的Eclipse Java EE IDE.版本:Helios Service Release 2.

我无法使用eclipse web工具平台安装任何东西,因为一切都已安装.有任何想法吗 ?

谢谢!

java eclipse

10
推荐指数
1
解决办法
9899
查看次数

将spring bean加载到servlet中

关于如何完成这项任务有很多文件,但我仍然无法解决我的问题.我刚接触servlet,所以我可能错过了一些东西.

我使用red5使用tomcat 6来创建一个servlet,它使用一个用于数据库操作的MysqlDb类的spring bean.

当我使用端口5080指向red5时,它充当常规的tomcat服务器,我可以浏览jsp和servlet页面.

我的web.xml包含以下相关信息:

<listener>
 <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>

<servlet>
  <servlet-name>fbauth</servlet-name>
  <servlet-class>com.xpogames.FbAuth</servlet-class>
</servlet>

<servlet-mapping>
  <servlet-name>fbauth</servlet-name>
  <url-pattern>/fbauth</url-pattern>
</servlet-mapping>
Run Code Online (Sandbox Code Playgroud)

我的applicationContext.xml:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">

<bean id="placeholderConfig" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
    <property name="location" value="/WEB-INF/red5-web.properties" />
</bean>

<bean id="idDataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
    <property name="driverClassName"><value>${db.driver}</value></property>
    <property name="url"><value>${db.url}</value></property>
    <property name="username"><value>${db.username}</value></property>
    <property name="password"><value>${db.password}</value></property>
    <property name="poolPreparedStatements"><value>true</value></property>
    <property name="maxActive"><value>10</value></property>
    <property name="maxIdle"><value>10</value></property>
 </bean>

 <bean id="MysqlDb" class="com.xpogames.MysqlDb">
    <property name="idDataSource" ref="idDataSource"/>
 </bean>


</beans>
Run Code Online (Sandbox Code Playgroud)

我的FbAuth servlet:

package com.xpogames;

import java.io.IOException;

import java.io.PrintWriter;


import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.BeanFactory;
import …
Run Code Online (Sandbox Code Playgroud)

java spring web.xml javabeans

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

Adobe Flash Builder(flex4):addChild()在此类中不可用.

我想将swf加载到flex 4应用程序中以便使用它的类.

var ldr:Loader=new Loader();
ldr.load(new URLRequest("file://path/to/fileswf"));
ldr.contentLoaderInfo.addEventListener(Event.INIT, loaded);
function loaded(evt:Event):void { addChild(ldr); }
Run Code Online (Sandbox Code Playgroud)

我收到错误:

错误:此类中没有addChild().相反,如果你有皮肤,请使用addElement()或修改皮肤.

主要/私有的spark.components.supportClasses :: SkinnableComponent/addChild()[E:\ dev\gumbo_beta2\frameworks\projects\spark\src\spark\components\supportClasses\SkinnableComponent.as:966]:init/loaded( )[C:\ Documents and Settings\ufk\Adob​​e Flash Builder Beta 2\xpogames-toolkit-test\src\main.mxml:22]

如果我addChild()改为addElement(),我收到以下编译错误:

1067:flash.display类型值的隐式强制:对不相关类型的加载器mx.core:IVisualElement.main.mxml path/dir line 22 Flex问题

有任何想法如何解决这个问题?

apache-flex loader addchild flash-builder flex4

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

我可以获得PreparedStatement即将执行的完整查询吗?

我正在PreparedStatement使用MySQL服务器.

例:

String myQuery = "select id from user where name = ?";
PreparedStatement stmt  = sqlConnection.prepareStatement(myQuery);
stmt.setString(1, "test");
stmt.executeQUery();
ResultSet rs = stmt.getResultSet();
Run Code Online (Sandbox Code Playgroud)

如何收到即将在MySQL服务器上执行的完整SQL查询?

谢谢!

java mysql prepared-statement

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

跳过std :: istream中的行

我正在使用std :: getline()从std :: istream派生类中读取行,如何向前移动几行?

我必须阅读并丢弃它们吗?

c++ istream

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

java c3p0:我如何配置autoreconnect = true?

我正在使用Java编写一个red5应用程序,我正在使用c3p0进行数据库交互.

似乎在我的MySQL服务器中连接超时后,我的应用程序停止使用建议配置autoreconnect = true.

我怎么能这样做?

这是我用来创建数据源的函数:

private ComboPooledDataSource _createDataSource() {
    Properties props = new Properties();
    // Looks for the file 'database.properties' in {TOMCAT_HOME}\webapps\{RED5_HOME}\WEB-INF\
    try {
        FileInputStream in = new FileInputStream(System.getProperty("red5.config_root") + "/database.properties");
        props.load(in);
        in.close();
    } catch (IOException ex) {
        log.error("message: {}", ex.getMessage());
        log.error("stack trace: " + ExceptionUtils.getFullStackTrace(ex));
        return null;
    }

    // It will load the driver String from properties
    String drivers = props.getProperty("jdbc.drivers");
    String url = props.getProperty("jdbc.url");
    String username = props.getProperty("jdbc.username");
    String password = props.getProperty("jdbc.password");

    ComboPooledDataSource cpds = new ComboPooledDataSource(); …
Run Code Online (Sandbox Code Playgroud)

java mysql red5 c3p0

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

在变量中放置多行输出

我正在用bash编写一个脚本,我希望它能够执行命令并分别处理每一行.例如:

LINES=$(df)
echo $LINES
Run Code Online (Sandbox Code Playgroud)

它将返回所有输出转换带空格的新行.

例:

如果输出应该是:

1
2
3
Run Code Online (Sandbox Code Playgroud)

然后我会得到

1 2 3
Run Code Online (Sandbox Code Playgroud)

如何将命令的输出放入变量中,使新行仍然是新行,这样当我打印变量时,我会获得正确的输出?

bash bash4

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

filepath.Walk() - 我可以提供哪些目录不要走的规则?

我正在使用Go 1.7rc1编写GoLang应用程序.

现在我想找到特定路径中的所有go文件.除此之外,我不想走一些目录..例如..隐藏的目录,如.git.

有没有办法提供Walk()一些规则?或..是否有不同的库提供这些功能?

现在这是我的代码:

func visit(path string, f os.FileInfo, err error) error {
    fmt.Printf("Visited: %s\n", path)
    return nil
}

func main() {
    filepath.Walk(path,visit)
}
Run Code Online (Sandbox Code Playgroud)

任何有关该问题的信息将不胜感激.谢谢!

directory go

8
推荐指数
1
解决办法
2281
查看次数

hyperkube doesn't start any manifest from /etc/kubernetes/manifests

I have Container Linux by CoreOS alpha (1325.1.0) Installed on a pc at home.

I played with kubernetes for a couple of month, but now after reinstalling ContainerOS and trying to install kubernetes using my fork at https://github.com/kfirufk/coreos-kubernetes I fail to properly install kubernetes.

I use hyperkube image v1.6.0-beta.0_coreos.0.

the problem is that it seems that hyperkube doesn't try to initiate any manifests from /etc/kubernetes/manifests. I configured kubelet to run with rkt.

when I run journalctl -xef -u …

coreos kubernetes rkt kubelet containeros

8
推荐指数
1
解决办法
1200
查看次数