这是我第一次尝试在我的盒子中本地安装Apache HTTP服务器作为普通用户(非root用户).
我已经下载了Apache 2.4.1版本的Apache HTTP服务器[http://httpd.apache.org/download.cgi].但是,当我尝试在我的框中本地构建和安装时,我收到以下错误:
httpd/httpd-2.4.1 1059> ./configure
checking for chosen layout... Apache
checking for working mkdir -p... yes
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
Configuring Apache Portable Runtime library ...
checking for APR... no
configure: error: APR not found. Please read the documentation.
Run Code Online (Sandbox Code Playgroud)
我不确定它正在寻找什么依赖 - 我的意思是下载包不包含它?我需要做什么来构建/部署Apache HTTP服务器?
提前致谢.
枚举名是用Java实现的吗?
即保证enum1.name() == enum2.name()在同名的情况下?与enum.name()保证被实习的字符串进行比较是否安全.
我有两个几乎相同的简单JS小提琴调用选择更改的函数.在这两种情况下,函数名称与选择ID相同,但由于某种原因,第一个小提琴工作正常,第二个失败,出现JavaScript错误is not a function:
http://jsfiddle.net/AZkfy/7/ - 在FF9(Linux),Chromium 16(Linux),IE8(Windows)中运行良好:
<script>
function border(border) { alert(border); }
</script>
<select id='border' name='border' onchange='border(this.value)'>
<option value='foo'>foo</option>
<option value='bar'>bar</option>
</select>
Run Code Online (Sandbox Code Playgroud)
和
http://jsfiddle.net/cYVzk/ - 在FF9(Linux),Chromium 16(Linux),IE8(Windows)中失败:
<script>
function border(border) { alert(border); }
</script>
<form>
<select id='border' name='border' onchange='border(this.value)'>
<option value='foo'>foo</option>
<option value='bar'>bar</option>
</select>
</form>
Run Code Online (Sandbox Code Playgroud)
首先,我不明白为什么第一个工作正常,第二个工作失败.
第二 - 有关于冲突的JS函数名称和元素ID的JS规范或限制吗?
http://www.vaannila.com/spring/spring-hibernate-integration-1.html
阅读本教程后,他们没有提到在DB中创建表的任何内容.一旦我指定它们,Hibernate是否通过创建表和字段来自动处理它.
这是我的bean配置.
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:p="http://www.springframework.org/schema/p"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
<bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver" p:prefix="/WEB-INF/jsp/" p:suffix=".jsp" />
<bean id="myDataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
<property name="driverClassName" value="com.mysql.jdbc.Driver"/>
<property name="url" value="jdbc:mysql://127.0.0.1:3306/spring"/>
<property name="username" value="monwwty"/>
<property name="password" value="www"/>
</bean>
<bean id="mySessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
<property name="dataSource" ref="myDataSource" />
<property name="annotatedClasses">
<list>
<value>uk.co.vinoth.spring.domain.User</value>
</list>
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect</prop>
<prop key="hibernate.show_sql">true</prop>
<prop key="hibernate.hbm2ddl.auto">create</prop>
</props>
</property>
</bean>
<bean id="myUserDAO" class="uk.co.vinoth.spring.dao.UserDAOImpl">
<property name="sessionFactory" ref="mySessionFactory"/>
</bean>
<bean name="/user/*.htm" class="uk.co.vinoth.spring.web.UserController" >
<property name="userDAO" ref="myUserDAO" />
</bean>
</beans>
Run Code Online (Sandbox Code Playgroud) System.out.println(Integer.MAX_VALUE + 1 == Integer.MIN_VALUE);
是真的.
我知道Java中的整数是32位,不能超过2 ^ 31-1,但我不明白为什么在MAX_VALUE中加1会导致MIN_VALUE而不是某种异常.没有像Ruby那样透明地转换为更大的类型.
是否在某处指定了此行为?我可以依靠它吗?
有时您需要在servlet/JSP /基于内容的任何内容中构建Web应用程序上下文的完整URL HttpServletRequest.像http://server.name:8080/context/这样的东西.Servlet API没有一种方法可以实现这一点.
直接的方法是将所有URL组件附加到a StringBuffer,例如
ctxUrl = sb.append(req.getScheme()).append("://")
.append(req.getgetServerName()).append(":")
.append(req.getServerPort()) etc
Run Code Online (Sandbox Code Playgroud)
我想知道这个替代方案是否有任何问题(速度提高了10倍):
ctxUrl = req.getRequestURL();
ctxUrl = ctxUrl.substring(0, ctxUrl.lastIndexOf("/")));
Run Code Online (Sandbox Code Playgroud)
以上两种方法总会产生相同的结果吗?
什么是在Scala中延迟函数执行的最简单方法,比如JavaScript setTimeout?理想情况下,每次延迟执行都不会产生线程,即顺序执行.我能找到的最接近的是Akka的Scheduler,但这太过分了.
为了我的测试目的,我打开了数千个连接,然后他们在10秒钟内获得响应.在node.js中,它看起来像:
http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'text/plain'});
setTimeout(function() {res.end('Hello World\n');}, 10000 );
}).listen(8080, '127.0.0.1');
Run Code Online (Sandbox Code Playgroud)
但是最接近的Scala版本会做同样的事情吗?我不在乎res.end是在多个线程中执行还是在一个线程中排队.
这非常有效:
require 'net/http'
uri = URI('http://api.twitter.com/1/statuses/user_timeline.json')
args = {include_entities: 0, include_rts: 0, screen_name: 'johndoe', count: 2, trim_user: 1}
uri.query = URI.encode_www_form(args)
resp = Net::HTTP.get_response(uri)
puts resp.body
Run Code Online (Sandbox Code Playgroud)
但是从http变为https导致无意义的错误.我不是在问为什么错误毫无意义,我想知道最接近的做法get_response是https什么?
我在Net :: HTTP文档中看到了'HTTPS'示例,但它看起来不是很令人印象深刻,并且会让我手动编写来自我的参数哈希的URL - 没有用.
我找不到任何方法来禁用Passenger的X-Powered-By标题:
X-Powered-By: Phusion Passenger (mod_rails/mod_rack) 3.0.11
Run Code Online (Sandbox Code Playgroud)
是否可以在不修改其源和删除HTTP服务器级别的标头的情况下执行此操作?
我试图降级java版本.
如果我apt-get install sun-java6-jdk在Ubuntu上使用,它将安装java版本1.6.26.
我想要的是java 1.6.20.我怎样才能降级java?